exit(), SIGCHLD, waitpid() should provide the necessary machinery.
The pthread API is a bit deficient, however (but that's a library issue).
olaf
-- ___ Olaf.Titz@inka.de or @{stud,informatik}.uni-karlsruhe.de ____ __ o <URL:http://www.inka.de/~bigred/> <IRC:praetorius> __/<_ >> Just as long as the wheels keep on turning round _)>(_)______________ I will live for the groove 'til the sun goes down << ____