I am writing a simple program to spawn a number of processes on a Solaris system (like last, uptime etc) using open.
I need to know when a child process has terminated so i installed a signal handler for CHILD to a method that uses waitpid with nohang.
The script works ok except that it misses on some dead child processes and i end up having spawned 10 procs and reaped 6 or 7. Anyone know a workaround?
Any suggestion would be greatly appreciated.