> > On Linux, all non-blocked, non-ignored signals stop select(2) --
> > even if that signal has SA_RESTART specified. This is BSD-derived
> > behaviour; things are different on SysV Unices. For more information,
> > see _Advanced_Programming_in_the_UNIX_Environment_ [Stevens 1990] and
> > sigaction(3).
> I wish I had read this before I posted to comp.os.linux but I guess
> I'll bring it up here as well.
> According to the man page (sigaction(2) on my system, not sigaction(3))
> SA_RESTART has a totally different meaning than what SysV and BSD give
> it. I don't see any flags for controlling whether an interrupted
> system call gets restarted or not.
man 2 sigaction:
Provide behaviour compatible with BSD signal
semantics by making certain system calls
restartable across signals.
> I also questioned whether the SA_ONESHOT default behavior made it not
> POSIX compliant. I have not read the POSIX spec but according to
> "Unlike earlier systems with their unreliable signals, POSIX.1
> requires that a signal handler remain installed until explicitly
> To get this behavior on Linux you would have to use the SA_RESTART
> flag which is non-portable.
SA_ONESHOT or SA_RESETHAND
Restore the signal action to the default
state once the signal handler has been
called. (This is the default behavior of
the signal(2) system call.)
sigaction(2) defaults to persistant signal handlers, signal(2)
defaults to one-shot.
Quote:> Can anybody explain why the default behavior and flags were chosen
> this way?
It seems to make sense to me --- perhaps your man pages are out of date?