Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
 <PH7PR11MB5795BB44A4223FA35F6E4E44B388A@PH7PR11MB5795.namprd11.prod.outlook.com>
Date: Wed, 7 May 2025 13:15:37 +0000
From: "Zhao, Lihua (CN)" <Lihua.Zhao.CN@...driver.com>
To: Rich Felker <dalias@...c.org>, Markus Wichmann <nullplan@....net>
CC: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
Subject: RE: sigtimedwait always retry when receive -EINTR

Thank you for your reply. The original intention of sigtimewait is to selectively wait for specific signals, so EINTR may mislead the application. I accept this suggestion.

Lihua

-----Original Message-----
From: Rich Felker <dalias@...c.org> 
Sent: Wednesday, May 7, 2025 8:56 PM
To: Zhao, Lihua (CN) <Lihua.Zhao.CN@...driver.com>
Cc: musl@...ts.openwall.com
Subject: Re: [musl] sigtimedwait always retry when receive -EINTR

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

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.

OSZAR »