sigwait() cancellation point

Jilles Tjoelker jilles at stack.nl
Wed Sep 8 17:56:11 UTC 2010


On Tue, Sep 07, 2010 at 05:38:06PM +0000, David Xu wrote:
> Jilles Tjoelker wrote:
> > Our sigwait() implementation may not be POSIX-compliant as it returns
> > EINTR when it is interrupted by a caught signal. (Unfortunately I can
> > only find this in SUSv4 in the Rationale, B.2.3 Error Numbers,
> > Disallowing Return of the [EINTR] Error Code; the sigwait() page in XSH
> > does not list an [EINTR] error condition, but does not prohibit one
> > either like pthread_mutex_lock() and various others do.)

> A system call can not return EINTR is not flexible, I think why don't
> we fix it in libc and libthr, but let kernel returns EINTR?

> I have worked out a patch:

> http://people.freebsd.org/~davidxu/patch/sigwait.diff

The idea and patch seem sensible. Some man page changes seem in order
though: sigwaitinfo.2 should mention this difference between sigwait()
and sigwaitinfo() more explicitly.

-- 
Jilles Tjoelker


More information about the freebsd-threads mailing list