From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: Re: [PATCH 5/7] linux: Use waitid on wait4 if __NR_wait4 is not defined
Date: Thu, 21 Nov 2019 17:53:00 -0000 [thread overview]
Message-ID: <ae1017d0-906c-7e76-b2e8-00f5f67e3281@linaro.org> (raw)
In-Reply-To: <20191114144704.19002-5-adhemerval.zanella@linaro.org>
On 14/11/2019 11:47, Adhemerval Zanella wrote:
> +pid_t
> +__wait4 (pid_t pid, int *stat_loc, int options, struct rusage *usage)
> +{
> +#if __NR_wait4
> + return SYSCALL_CANCEL (wait4, pid, stat_loc, options, usage);
> +#elif defined (__ASSUME_WAITID_PID0_P_PGID)
[...]
> +# else
> +/* Linux waitid prior kernel 5.4 does not support waiting for the current
> + process. It would be possible to emulate it by calling getpgid for pid 0,
> + however, it would require an additional syscall and it is inherent racy:
> + after the current process group is received and before it is passed
> + to waitid a signal could arrive causing the current process group to
> + change. */
> +# error "The kernel ABI does not provide a way to implement wait4"
> +#endif
So the only design here that I am not sure is if the best one is to trigger
a build error to avoid an architecture to not define __NR_wait4 and also
support kernels older than 5.4 (which would not define
__ASSUME_WAITID_PID0_P_PGID), or if it should do as generic implementation
and return ENOSYS along with a stub.
Thoughts?
next prev parent reply other threads:[~2019-11-21 17:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-14 14:47 [PATCH 1/7] Remove __waitpid_nocancel Adhemerval Zanella
2019-11-14 14:47 ` [PATCH 5/7] linux: Use waitid on wait4 if __NR_wait4 is not defined Adhemerval Zanella
2019-11-15 18:27 ` Alistair Francis
2019-11-21 17:48 ` Adhemerval Zanella
2019-11-21 17:53 ` Adhemerval Zanella [this message]
2019-11-21 18:47 ` Alistair Francis
2019-11-22 12:15 ` Adhemerval Zanella
2019-11-22 20:01 ` Alistair Francis
2019-11-25 12:39 ` Adhemerval Zanella
2019-11-25 12:42 ` Adhemerval Zanella
2019-12-03 19:04 ` Alistair Francis
2019-12-03 19:18 ` Adhemerval Zanella
2019-11-14 14:47 ` [PATCH 7/7] Consolidate wait3 implementations Adhemerval Zanella
2019-11-14 15:44 ` Alistair Francis
2019-12-19 15:33 ` Adhemerval Zanella
2019-11-14 14:47 ` [PATCH 6/7] Implement waitpid in terms of wait4 Adhemerval Zanella
2019-11-14 14:47 ` [PATCH 3/7] nptl: Move waitpid implementation to libc Adhemerval Zanella
2019-11-14 14:47 ` [PATCH 2/7] nptl: Move wait " Adhemerval Zanella
2019-11-14 14:47 ` [PATCH 4/7] Implement wait in terms of waitpid Adhemerval Zanella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ae1017d0-906c-7e76-b2e8-00f5f67e3281@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).