Michael Lestinsky <michael@...> wrote:
> Was hier passiert ist, dass das wait tatsaechlich wartet, bis das Kind von
> alleine terminiert. In der Manpage lese ich zu wait(2) jedoch:
>
> The wait() function suspends execution of its calling process until
> status information is available for a terminated child process, or a sig-
> nal is received.
>
> wait() sollte also auch auf ein eingehendes Signal hin terminieren.
Ich zitiere mal ein bisschen weiter:
If a signal is caught while any of the wait() calls are pending, the call
may be interrupted or restarted when the signal-catching routine returns,
depending on the options in effect for the signal; see discussion of
SA_RESTART in sigaction(2).
Und signal(3):
For some system calls, if a signal is caught while the call is executing
and the call is prematurely terminated, the call is automatically
restarted. Any handler installed with signal(3) will have the SA_RESTART
flag set, meaning that any restartable system call will not return on
receipt of a signal. The affected system calls include read(2),
write(2), sendto(2), recvfrom(2), sendmsg(2) and recvmsg(2) on a communi-
cations channel or a low speed device and during a ioctl(2) or wait(2).
--
Christian "naddy" Weisgerber naddy@...
--
http://mailman.uugrn.org/mailman/listinfo/uugrn
Wiki: http://wiki.uugrn.org/wiki/UUGRN:Mailingliste
Archiv: http://lists.uugrn.org/