Joerg Wunsch j@uriah.heep.sax.de writes:
The Posix way is to use sigaction(), and set the SA_NOCLDWAIT flag bit. This variant is supported under FreeBSD (don't know for the other BSDs). It has the added bonus that unavailability of the automatic zombie reaping feature can be detected at compile-time (the macro is not defined then).
The fact that the macro exists doesn't mean it works. Most Linux kernels don't support SA_NOCLDWAIT, even though the symbol may be defined in the headers. I don't have the Posix standard, but at least according to the single Unix spec using SIG_IGN is just as standard as SA_NOCLDWAIT, and a quick grep of the FreeBSD sources seems to indicate that it should work. Did I miss something?