tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wait(2) and SIGCHLD



I agree that this is confusing. While the system definitely differentiates between SIG_DFL and SIG_IGN, the difference would normally not be something I expected to make a difference in something described the way wait(2) is documented.

I haven't really bothered going down into the code and find the answer, but I'm curious what other answers pops up for this one.

  Johnny

On 2020-08-14 13:51, Edgar Fuß wrote:
I'm confused regarding the behaviour of wait(2) wrt. SIGCHLD handling.

The wait(2) manpage says:

	wait() will fail and return immediately if:
	[ECHILD]	The calling process has no existing unwaited-for child
			processes; or 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 SIGCHLD or setting the flag SA_NOCLDWAIT
			for that signal.

However, ignore is the default handler for SIGCHLD.

So does the
	because the calling process has asked the system
	to discard such status by ignoring the signal SIGCHLD
mean that explicitly ignoring SIGCHLD is different from ignoring it per default?


--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index