signal(7): should it mention that SIGCHLD is also sent when child is continued?
Currently it says:
Quoted 1 line
SIGCHLD P1990 Ign Child stopped or terminated
It's the definition from POSIX 1990 which is referred here but the modern POSIX says that it's also sent when child continues
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html:
Quoted 1 line
Child process terminated, stopped, or continued.
It's supported on Linux - in sigaction(2) a flag is described that controls this and it correctly says that it's sent on stop and resume:
Quoted 6 lines
SA_NOCLDSTOPIf signum is SIGCHLD, do not receive notification when child processes stop (i.e., when they receive one of SIGSTOP, SIGTSTP, SIGTTIN, or SIGTTOU) or resume (i.e., they receive SIGCONT) (see wait(2)). This flag is meaningful only when establishing a handler for SIGCHLD.
The question about wording in signal(7) has been originally asked by a confused user here
https://unix.stackexchange.com/q/790116/72304. Should it be changed?
Signature · 1 line
Arkadiusz Drabczyk <[email protected]>
Alejandro Colomar
maintainerHi Arkadiusz,
Quoted 15 lines · Arkadiusz Drabczyk
Currently it says:
Quoted 1 line
SIGCHLD P1990 Ign Child stopped or terminated
It's the definition from POSIX 1990 which is referred here but the modern POSIX says that it's also sent when child continues
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html:Quoted 1 line
Child process terminated, stopped, or continued.
It's supported on Linux - in sigaction(2) a flag is described that controls this and it correctly says that it's sent on stop and resume:
Quoted 2 lines
SA_NOCLDSTOP
Quoted 8 lines
Quoted 4 lines
If signum is SIGCHLD, do not receive notification when child processes stop (i.e., when they receive one of SIGSTOP, SIGTSTP, SIGTTIN, or SIGTTOU) or resume (i.e., they receive SIGCONT) (see wait(2)). This flag is meaningful only when establishing a handler for SIGCHLD.
The question about wording in signal(7) has been originally asked by a confused user here
https://unix.stackexchange.com/q/790116/72304. Should it be changed?
Yes, we should change the comment in signal(7) to say that a continued child also generates that signal, and the comment should also mention the POSIX version where this was introduced. Would you mind sending a patch?
Thanks!
Alex
Signature · 1 line
<https://www.alejandro-colomar.es/>
Quoted 4 lines · Alejandro Colomar
Yes, we should change the comment in signal(7) to say that a continued child also generates that signal, and the comment should also mention the POSIX version where this was introduced. Would you mind sending a patch?
No, I've just sent a patch.
Signature · 1 line
Arkadiusz Drabczyk <[email protected]>