lkml.org 
[lkml]   [1996]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: On SIGCHLD signal semantics

> Marc La France, wrote;
> The circumstances addressed are when a parent process decides to wait
> for termination of one of its child processes, but does so with
> its SIGCHLD signal handler set to SIG_IGN. If the child process
> terminates while its parent is waiting, this is not a problem. But
> if the child terminates before the parent waits, then the parent
> will be told it has no children (because the kernel has already gotten
> rid of any indication of the child's existence). This can confuse the
> parent process.

> Marc.

wait(2) should fail if a process has no existing unwaited-for child
processes. errno should be set to ECHILD. The parent shouldn't get
confused if it is written correctly.
This is traditional behaviour; I'm sure POSIX.2 hasn't broken it :(

I believe this is what Linux already does (or did do, havn't checked
recently...).

markhe




\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.324 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site