On Wed, Nov 19, 2008 at 9:16 AM, Jonathan Steel <[EMAIL PROTECTED]> wrote: > In the SIGCHLD signal handler of parent process, I need to get the pid of > the child when the child dies. To do this I'm using sigaction with the > SA_SIGINFO flag. But the siginfo_t->si_pid member does not seem to be set. > > I found the following post from Otto that seems to say that what I'm trying > to do may not work on OpenBSD. > > http://www.archivum.info/fa.openbsd.tech/2008-02/msg00124.html > > Ive tried the following code on linux and everything works great, but on > OpenBSD it doesn't work. I've tried it on 3.8 and 4.2, and I'm currently > downloading 4.4 to see if it works on there.
Nope, this hasn't changed in 4.4 or -current. ... > Does anybody know how I'm to accomplish this, or why it doesn't work? It doesn't work because no one has has taught the kernel to generate one SIGCHLD per zombie child, with siginfo value extracted from the zombie's information. I.e., this is a known defect. It'll get fixed when it gets to the top of someone's priority heap. (If someone else is interested in taking a stab at this, I could review and perhaps shepherd it, but I don't have the time right now to do it myself.) Philip Guenther

