Hello,

[email protected], le mar. 03 mars 2026 04:08:15 +0000, a ecrit:
> #### POSIX-3: `sigwait` returns -1 on error instead of error number (HIGH)
> 
> **POSIX** (`sigwait`, RETURN VALUE):
> "Upon successful completion, sigwait() shall store the signal number of the
> received signal at the location referenced by sig and return zero. Otherwise,
> an error number shall be returned to indicate the error."
> 
> **Implementation** (`sysdeps/mach/hurd/sigwait.c:31-37`): Delegates to
> `__sigtimedwait` which returns -1 and sets errno. `__sigwait` propagates -1
> instead of returning the error number directly. This violates the return
> value contract (sigwait uses pthread-style returns, not errno-style).
> 
> **Proposed Fix**: Translate the errno-style return from `__sigtimedwait` into 
> a
> pthread-style return:
> 
> ```c
> int
> __sigwait (const sigset_t *set, int *sig)
> {
>   int ret = __sigtimedwait (set, NULL, NULL);
>   if (ret < 0)
>     return errno;
>   *sig = ret;
>   return 0;
> }
> ```

Indeed, tiny but still important detail :)

Samuel

Reply via email to