in reply to In Solaris accept() is not restarted [on Solaris] ...

If the child doesn't exit, not only does it hang around, it goes into the accept loop. And it might accept some connections and fork off its own children.

It usually a good idea to close the server socket at the beginning of the child code.

Finally, you should use waitpid in a while loop in the REAPER subroutine. Multiple child processes can exit by the time the signal handler gets run and a single wait will only get one of them. This will leave zombies.

  • Comment on Re: In Solaris accept() is not restarted [on Solaris] ...