![]() |
|
Message-ID: <20250507125540.GE1827@brightrain.aerifal.cx> Date: Wed, 7 May 2025 08:55:40 -0400 From: Rich Felker <dalias@...c.org> To: "Zhao, Lihua (CN)" <Lihua.Zhao.CN@...driver.com> Cc: "musl@...ts.openwall.com" <musl@...ts.openwall.com> Subject: Re: sigtimedwait always retry when receive -EINTR On Wed, May 07, 2025 at 03:03:15AM +0000, Zhao, Lihua (CN) wrote: > Current sigtimedwait code: > > int sigtimedwait(const sigset_t *restrict mask, siginfo_t *restrict si, const struct timespec *restrict timeout) > { > int ret; > do ret = do_sigtimedwait(mask, si, timeout); > while (ret==-EINTR); > return __syscall_ret(ret); > } > > sigtimedwait always retry when receive -EINTR, it conflicts with https://pubs.opengroup.org/onlinepubs/9799919799/ It does not conflict; that is a "may fail" (allowance for the implementation to return with an error) not a "shall fail" (requirement that the implementation treat the condition as an error). Generally we avoid "may fail" conditions, and also we try to suppress rather than pass through EINTR where possible, since various Linux versions have had bugs where they produce EINTR under conditions where it's not allowed, and suppressing it avoids conformance problems (and possibly real applicaiton breakage) there. Rich
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.