Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 24 Jan 2002 01:06:32 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        Dag-Erling Smorgrav <des@ofug.org>
Cc:        arch@freebsd.org
Subject:   Re: Nit in wait(2) man page?
Message-ID:  <3C4FCE98.2C0BE57E@mindspring.com>
References:  <xzpadv4dtbz.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
Dag-Erling Smorgrav wrote:
> The wait(2) man page says:
> 
>      [EINTR]            The call was interrupted by a caught signal, or the
>                         signal did not have the SA_RESTART flag set.
> 
> Should this be s/or/and/?

Yes.  Interrupted system calls do not return error codes if
the restart flag is set, they are restarted, instead.

I think you may need to be careful here, though, based on
the interaction with threads.  I'm not sure how the wrapped
system calls find themselves restarted, if they are
interrupted by a signal handler.  In tehory, this should be
transparent, but in practice, there is a heck of a lot of
voodoo in the wrapper code to deal with masks and stuff,
mostly to deal with the fact that system call restart is no
longer the default behaviour, thanks to POSIX.

The historical interface was to always restart system calls
unless siginterrupt(2) has been called, and prior to the
siginterrupt(2) being introduces (ULTRIX 4.1), the only way
a signal could interrupt a system call was as a result of
a longjmp(3) out of the signal handler, with a corresponding
setjmp(3) before the system call.  All in all, this was a
much more UNIX-like behaviour (complex behaviour emergent
from a small set of not-so-complex building blocks).

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C4FCE98.2C0BE57E>