diff options
author | yar <yar@FreeBSD.org> | 2004-06-07 11:01:39 +0000 |
---|---|---|
committer | yar <yar@FreeBSD.org> | 2004-06-07 11:01:39 +0000 |
commit | 68060b2236dc8453f4a0471f0b41e12e21711d18 (patch) | |
tree | 13efc13191bd58a4e268f252e63b25106b748ed5 /lib/libc | |
parent | 76e830207900fd1ac155c5d6702335b25fff43de (diff) | |
download | FreeBSD-src-68060b2236dc8453f4a0471f0b41e12e21711d18.zip FreeBSD-src-68060b2236dc8453f4a0471f0b41e12e21711d18.tar.gz |
Finally document the option to avoid zombie creation
through ignoring SIGCHLD.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/signal.3 | 23 | ||||
-rw-r--r-- | lib/libc/sys/sigaction.2 | 12 | ||||
-rw-r--r-- | lib/libc/sys/wait.2 | 8 |
3 files changed, 41 insertions, 2 deletions
diff --git a/lib/libc/gen/signal.3 b/lib/libc/gen/signal.3 index 74c6531..b329691 100644 --- a/lib/libc/gen/signal.3 +++ b/lib/libc/gen/signal.3 @@ -32,7 +32,7 @@ .\" @(#)signal.3 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 19, 1994 +.Dd June 7, 2004 .Dt SIGNAL 3 .Os .Sh NAME @@ -204,6 +204,22 @@ to the function; ignored signals remain ignored. .Pp +If a process explicitly specifies +.Dv SIG_IGN +as the action for the signal +.Dv SIGCHLD , +the system will not create zombie processes when children +of the calling process exit. +As a consequence, the system will discard the exit status +from the child processes. +If the calling process subsequently issues a call to +.Xr wait 2 +or equivalent, it will block until all of the calling process's +children terminate, and then return a value of \-1 with +.Va errno +set to +.Er ECHILD . +.Pp See .Xr sigaction 2 for a list of functions @@ -239,6 +255,7 @@ or .Xr sigaltstack 2 , .Xr sigprocmask 2 , .Xr sigsuspend 2 , +.Xr wait 2 , .Xr fpsetmask 3 , .Xr setjmp 3 , .Xr siginterrupt 3 , @@ -248,3 +265,7 @@ This .Fn signal facility appeared in .Bx 4.0 . +The option to avoid the creation of child zombies through ignoring +.Dv SIGCHLD +appeared in +.Fx 5.0 . diff --git a/lib/libc/sys/sigaction.2 b/lib/libc/sys/sigaction.2 index a93ccea..451a95c 100644 --- a/lib/libc/sys/sigaction.2 +++ b/lib/libc/sys/sigaction.2 @@ -32,7 +32,7 @@ .\" From: @(#)sigaction.2 8.2 (Berkeley) 4/3/94 .\" $FreeBSD$ .\" -.Dd April 3, 1994 +.Dd June 7, 2004 .Dt SIGACTION 2 .Os .Sh NAME @@ -201,6 +201,12 @@ a (or equivalent), it blocks until all of the calling process's child processes terminate, and then returns a value of -1 with errno set to .Er ECHILD . +The same effect of avoiding zombie creation can also be achieved by setting +.Fa sa_handler +for +.Dv SIGCHLD +to +.Dv SIG_IGN . .It Dv SA_ONSTACK If this bit is set, the system will deliver the signal to the process on a @@ -601,6 +607,10 @@ and .\" and .\" SA_SIGINFO flags are featuring options commonly found in other operating systems. +The flags are approved by +.St -susv2 , +along with the option to avoid zombie creation by ignoring +.Dv SIGCHLD . .Sh SEE ALSO .Xr kill 1 , .Xr kill 2 , diff --git a/lib/libc/sys/wait.2 b/lib/libc/sys/wait.2 index a3ba362..4f6df2d 100644 --- a/lib/libc/sys/wait.2 +++ b/lib/libc/sys/wait.2 @@ -274,6 +274,14 @@ will fail and return immediately if: .It Bq Er ECHILD The calling process has no existing unwaited-for child processes. +.It Bq Er ECHILD +No status from the terminated child process is available +because the calling process has asked the system to discard +such status by ignoring the signal +.Dv SIGCHLD +or setting the flag +.Dv SA_NOCLDWAIT +for that signal. .It Bq Er EFAULT The .Fa status |