From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13505 Path: news.gmane.org!.POSTED!not-for-mail From: Orivej Desh Newsgroups: gmane.linux.lib.musl.general Subject: Re: sem_wait and EINTR Date: Thu, 6 Dec 2018 02:43:40 +0000 Message-ID: <20181206024340.202e0fc4@orivej.orivej.org> References: <20181205191605.72492698@orivej.orivej.org> <20181205194759.GA32233@voyager> <20181205212716.sx6ra2xqhuei735q@core.my.home> <20181205215826.GX23599@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1544064108 21861 195.159.176.226 (6 Dec 2018 02:41:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 6 Dec 2018 02:41:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-13521-gllmg-musl=m.gmane.org@lists.openwall.com Thu Dec 06 03:41:44 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gUjbk-0005bn-Mo for gllmg-musl@m.gmane.org; Thu, 06 Dec 2018 03:41:44 +0100 Original-Received: (qmail 16035 invoked by uid 550); 6 Dec 2018 02:43:54 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 16013 invoked from network); 6 Dec 2018 02:43:53 -0000 In-Reply-To: <20181205215826.GX23599@brightrain.aerifal.cx> X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-Provags-ID: V03:K1:h347pNMWJVRvlYQ401G2C4Z6ODodokYlxqoXbtPDC7yZZ1eWzrR MBGi+siRZfmVPCCcqyUZa3bKQgNmYe6YwCxdQWH96dB3C8o2t2eU11DTccSez7TE1WAs0Q9 gP61ZUCVTcyg+MQ/iE5fJ6HWl1AjbO0NYgqGdJqWuc0KwSCB4qmrHqELdmn3qTR6rWKyN7E /161h7nlvh7K48aEbLMfw== X-UI-Out-Filterresults: notjunk:1;V03:K0:TMDS04157UE=:4gPDOa4acPAf2Jl/1pRmwn i8pIZORfjMS4S2eKsoi/UBX8fsS8dpHZJgTaZpcBlhsuyt302l0eZLZlPDo5X2YmzDW8ODkbv ASiAEI1yQUXLfVFkLR6W6xdJwGrvmQcqWuFNDREENs4LMLOHtvM+g4LxMQCg2F70tjPwGYPtp 45kP1hPJW16gi+4sIVKHgGb65hDReNQ0wD499OrELvFprfyd9L4L5SvQZnK1veAW/vbCtypwi AL1XHirTC8UiLcjUX6efnxWuY1wDKXgoEnlHWycDDbWms5baKDNAe8XPegZAIitYYpV09KvYs dhDs/55RzaJJkJlKsX3EMPJvWLi84XWUMxVpgAlM4w9hYtJ0TRUSxCXF4+eEAa1fmD23awun8 v3SOyVGGGWvoFEa+QsresCvY8azXs9ntWng0D/lTdwX8CUEuGkqVft/ETpwKNRUQlrGvetuO0 d85wX9d6UaSGjpOLaDtWaPq0rsUUt+IBQu7rkLm/6f+Cs7RRi2rQa0lK/IZKQRNfDJfTnCOtJ 3Dv6Gc1AlJA2+ph/G4PGrA6WaFsvtn5srBO+7XTQ3w/mK6lUZZUdnG/++0Qlk74+LujL0PhPk JocCvrVg2pxu5wXKsjtlrTplWbb0hriMDddti5oTkJvJ820WFJhTXabP2D6hNjMM2stT95di0 G8SEdKI1m1uEad9m+k4dufwS4qcBEumwH3/jTA+HEdyMCy/KA7Qdgk+rnb5nmVy8ozgfBRhS0 Cfjxhc/eofT6l4Pf53U4fKpyP6FC4qUZ7B0PpeCnJMtn6qhAZL6T+wV3kSYPyDEgEA1QhaoV Xref: news.gmane.org gmane.linux.lib.musl.general:13505 Archived-At: * Rich Felker [2018-12-05] > On Wed, Dec 05, 2018 at 10:27:16PM +0100, Ondřej Jirman wrote: > > On Wed, Dec 05, 2018 at 08:47:59PM +0100, Markus Wichmann wrote: > > > > It's specified by POSIX: > > > > https://pubs.opengroup.org/onlinepubs/9699919799/functions/sem_wait.html > > > > Sates: "The sem_wait() function is interruptible by the delivery of a signal." > > This seems contradictory with EINTR being a "may fail" error, and, if > interpreted the way you want to interpret it, seems to be > contradictory with SA_RESTART semantics, since it doesn't say anything > about whether that signal is an interrupting one. I think we should > attempt to obtain a clarification on what the intent is here. Does "is > interruptible" mean that it needs to fail on signals (only without > SA_RESTART?) or simply that signal handlers must be permitted to run > (i.e. the wait can't happen with signals blocked)? There is a definition of interruptible functions on the sigaction page: SA_RESTART This flag affects the behavior of interruptible functions; that is, those specified to fail with errno set to [EINTR]. If set, and a function specified as interruptible is interrupted by this signal, the function shall restart and shall not fail with [EINTR] unless otherwise specified. If the flag is not set, interruptible functions interrupted by this signal shall fail with errno set to [EINTR]. https://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html