From patchwork Mon Feb 7 17:44:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 50871 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 409A93858418 for ; Mon, 7 Feb 2022 17:47:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 409A93858418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1644256029; bh=4Yh2kKSrIs1XX3cLkNfUKCej4qzU1F76lGhWQmOPt8o=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=eA9w6UNphTXiLn3YqP0asy2Mv9dMGQUINZfQekEtZlULduyolRRLNac4uPQdWQXTw 4RRySKyJyoAwP3XwtwIVH03ADCIqNVFmI4vzw9uqB+3Yy7Xi1JW52RcpBhtfUtJNgR TAETjjQavrcYrTmdybmyrbWH/CkxvJBomSQAou5w= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by sourceware.org (Postfix) with ESMTPS id EF6C13858420 for ; Mon, 7 Feb 2022 17:44:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EF6C13858420 Received: by mail-oi1-x22e.google.com with SMTP id r27so17833531oiw.4 for ; Mon, 07 Feb 2022 09:44:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Yh2kKSrIs1XX3cLkNfUKCej4qzU1F76lGhWQmOPt8o=; b=D1n5JcdIYjTIfTbaDyM7ff+aIzdDx0kx5B5iCaw2Jd2Am0AkldIAfv0SUUlAWsHa2w YUlPM6eEB3nUEUJs24+yXfWEicuLOtjXFU3l7Dl6iNRH9pDv5noEZlEoZ/5GaJg0rlr/ b9PpzX0Q7xfXx7u8oVK8MLnCjzASCGJhbaQ+eRTMfxhhrCCkPR2ZtyVeGeriCpsxYi6h 4zyYyvBoxtgAfwCJhXoI8dODSev38Lz6OUBsQg7pCY/HS0ocEbcqgWXg49+qbVL33WYP AzHvaNdMKMqEyEcfJ95b4apWmVB38iOnq8+LBdJXkmxzz24HhFks0seWWRT8VZZRro2j RsOA== X-Gm-Message-State: AOAM532bwlnyQKH8HpgpNzmkO8XPB6RmRVjlM8rUMlzi7tZ1UKTulKl2 Xcy3ujsVv3PqGjUb1MuSxG8gDKs8T3PoHg== X-Google-Smtp-Source: ABdhPJzycbhCF0JoNsm5f1934f3dBo8Pd2970JhEsf1i6pzaPlwyYP/0FLm/IIMuPgeah9btGYnRhg== X-Received: by 2002:a05:6808:17a9:: with SMTP id bg41mr11765oib.41.1644255880187; Mon, 07 Feb 2022 09:44:40 -0800 (PST) Received: from birita.. ([2804:431:c7ca:733:4cdc:e08a:54c6:5108]) by smtp.gmail.com with ESMTPSA id l22sm4270334otj.44.2022.02.07.09.44.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 07 Feb 2022 09:44:40 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH v2 04/15] linux: Add P_PIDFD Date: Mon, 7 Feb 2022 14:44:20 -0300 Message-Id: <20220207174431.360355-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220207174431.360355-1-adhemerval.zanella@linaro.org> References: <20220207174431.360355-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" It was added on Linux 5.4 (3695eae5fee0605f316fbaad0b9e3de791d7dfaf) to extend waitid to wait on pidfd. Reviewed-by: Carlos O'Donell Tested-by: Carlos O'Donell --- posix/Makefile | 2 +- posix/sys/wait.h | 7 +------ sysdeps/mach/hurd/bits/types/idtype_t.h | 12 ++++++++++++ sysdeps/unix/sysv/linux/bits/types/idtype_t.h | 14 ++++++++++++++ 4 files changed, 28 insertions(+), 7 deletions(-) create mode 100644 sysdeps/mach/hurd/bits/types/idtype_t.h create mode 100644 sysdeps/unix/sysv/linux/bits/types/idtype_t.h diff --git a/posix/Makefile b/posix/Makefile index 9b30b53a7c..cfebb8ef06 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -32,7 +32,7 @@ headers := sys/utsname.h sys/times.h sys/wait.h sys/types.h unistd.h \ bits/waitflags.h bits/waitstatus.h sys/unistd.h sched.h \ bits/sched.h bits/cpu-set.h re_comp.h wait.h bits/environments.h \ cpio.h spawn.h bits/unistd.h bits/types/struct_sched_param.h \ - bits/unistd_ext.h + bits/unistd_ext.h bits/types/idtype_t.h routines := \ uname \ diff --git a/posix/sys/wait.h b/posix/sys/wait.h index 79bcdb013d..4d649cd4b1 100644 --- a/posix/sys/wait.h +++ b/posix/sys/wait.h @@ -71,12 +71,7 @@ typedef __pid_t pid_t; /* The following values are used by the `waitid' function. */ #if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 -typedef enum -{ - P_ALL, /* Wait for any child. */ - P_PID, /* Wait for specified process. */ - P_PGID /* Wait for members of process group. */ -} idtype_t; +# include #endif diff --git a/sysdeps/mach/hurd/bits/types/idtype_t.h b/sysdeps/mach/hurd/bits/types/idtype_t.h new file mode 100644 index 0000000000..207eb777ba --- /dev/null +++ b/sysdeps/mach/hurd/bits/types/idtype_t.h @@ -0,0 +1,12 @@ +#ifndef __idtype_t_defined +#define __idtype_t_defined + +/* The following values are used by the `waitid' function. */ +typedef enum +{ + P_ALL, /* Wait for any child. */ + P_PID, /* Wait for specified process. */ + P_PGID, /* Wait for members of process group. */ +} idtype_t; + +#endif diff --git a/sysdeps/unix/sysv/linux/bits/types/idtype_t.h b/sysdeps/unix/sysv/linux/bits/types/idtype_t.h new file mode 100644 index 0000000000..fc084c7774 --- /dev/null +++ b/sysdeps/unix/sysv/linux/bits/types/idtype_t.h @@ -0,0 +1,14 @@ +#ifndef __idtype_t_defined +#define __idtype_t_defined + +/* The following values are used by the `waitid' function. */ +typedef enum +{ + P_ALL, /* Wait for any child. */ + P_PID, /* Wait for specified process. */ + P_PGID, /* Wait for members of process group. */ + P_PIDFD, /* Wait for the child referred by the PID file + descriptor. */ +} idtype_t; + +#endif