Rommel Dongre <firstname.lastname@example.org> wrote:
i just want to know if SPAWN_NOZOMBIE and P_NOWAIT are equivalent?
No, it is equivalent to P_NOWAITO. In other words, P_WAIT clears
SPAWN_NOZOMBIE because it needs to be able to wait for the exit,
P_NOWAITO sets SPAWN_NOZOMBIE because you can’t wait for the status,
and with P_NOWAIT you are expected to waitpid() yourself at a later
point and so SPAWN_NOZOMBIE is also cleared (this is all assuming
you are coming through the spawnv[p]e() interface - refer to the
diagram in the online docs for spawn()).
But this seems to be diverging from your original question …
i want to use the Posix-compliant variant “spawn()” and set the
‘mode’ to P_NOWAIT.
The POSIX-compliant functions (ie spawnp) do not have a ‘mode’.
what is the mapping of spwanl( mode = P_NOWAIT) to spawn() ?
This is the default operation for spawn(), i.e to not wait; any other
libc variant that does offer a P_WAIT mode is explicitly doing a
waitpid() for you. I assume that you want to spawn without waiting
and without having to reap the child at a future point but using spawn()
directly - set SPAWN_NOZOMBIE in inherit.flags.