Date: Thu, 25 Aug 2011 01:12:22 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Jilles Tjoelker <jilles@stack.nl> Cc: freebsd-stable@freebsd.org, Slawa Olhovchenkov <slw@zxy.spb.ru> Subject: Re: sigwait return 4 Message-ID: <20110824221222.GE17489@deviant.kiev.zoral.com.ua> In-Reply-To: <20110824212929.GC17489@deviant.kiev.zoral.com.ua> References: <20110824181907.GA48394@zxy.spb.ru> <20110824190703.GY17489@deviant.kiev.zoral.com.ua> <20110824205609.GA96070@stack.nl> <20110824212929.GC17489@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
--n/5ZWAgLgY6CQBJc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 25, 2011 at 12:29:29AM +0300, Kostik Belousov wrote: > > Solaris is simply wrong in the same way we were wrong. Although POSIX > > may not be as clear on this as one may like, its intention is clear and > > additionally not returning EINTR reduces subtle portability problems. > Can you, please, describe why do you consider the behaviour prohibiting > return of EINTR reasonable ? I do consider that the Solaris behaviour is > useful. >=20 > Since we went the other route, the addition to sigwait(2) manpage that > clarifies this looks useful. And, sigwait(2) shall be sigwait(3). Also, > the sentence "the sigwaitinfo() function is equivalent to sigwait() ..." > in the sigwaitinfo(2) is not complete, due to EINTR. Like this (svn cp to be applied). diff --git a/lib/libc/sys/sigwait.2 b/lib/libc/sys/sigwait.2 index 8c00cf4..a9e605c 100644 --- a/lib/libc/sys/sigwait.2 +++ b/lib/libc/sys/sigwait.2 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGWAIT 2 .Os .Sh NAME @@ -82,6 +82,14 @@ selected, it will be the lowest numbered one. The selection order between realtime and non-realtime signals, or between multiple pending non-realtime signals, is unspecified. +.Sh IMPLEMENTATION NOTES +The +.Fn sigwait +function is implemented as a wrapper around the +.Fn __sys_sigwait +system call, which retries the call on +.Er EINTR +error. .Sh RETURN VALUES If successful, .Fn sigwait diff --git a/lib/libc/sys/sigwaitinfo.2 b/lib/libc/sys/sigwaitinfo.2 index 41be9e2..a83de06 100644 --- a/lib/libc/sys/sigwaitinfo.2 +++ b/lib/libc/sys/sigwaitinfo.2 @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 11, 2005 +.Dd August 24, 2011 .Dt SIGTIMEDWAIT 2 .Os .Sh NAME @@ -116,6 +116,16 @@ except that the selected signal number shall be stored= in the member, and the cause of the signal shall be stored in the .Va si_code member. +Besides this, the +.Fn sigwaitinfo +and +.Fn sigtimedwait +system calls may return +.Er EINTR +if interrupted by signal, which is not allowed for the +.Fn sigwait +function. +.Pp If any value is queued to the selected signal, the first such queued value is dequeued and, if the info argument is .Pf non- Dv NULL , --n/5ZWAgLgY6CQBJc Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk5Vd0YACgkQC3+MBN1Mb4gBnQCgsdPM135ib5x5OM0Fj0KyZRNY FmwAnig6jM9oSBXuH8O5NnHe+JuRA+zS =fag8 -----END PGP SIGNATURE----- --n/5ZWAgLgY6CQBJc--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110824221222.GE17489>