Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!stanford.edu!msi.umn.edu!umeecs!spencer From: spencer@eecs.umich.edu (Spencer W. Thomas) Newsgroups: comp.unix.programmer Subject: Portable SIGCHLD/SIGCLD use? Message-ID: <1991May16.150910.4122@zip.eecs.umich.edu> Date: 16 May 91 15:09:10 GMT Sender: spencer@zip.eecs.umich.edu (Spencer W. Thomas) Organization: University of Michigan EECS Dept. Lines: 20 I've spent most of my time programming on BSD systems, but I find myself in the position of writing a handler for SIGCHLD/SIGCLD that must be as portable as possible. What is the best way to do this? The possibility that occurs to me is sig_cld_h() { (void)signal( SIGCLD, sig_cld_h ); (void)wait( (void *)0 ); } Clearly, this is not the best, but it should work. I guess there is a race condition that could lose a signal if another child exits after the signal is delivered but before the handler is invoked. Is there anything better one can do without wait3()? Please respond by mail. Thank you. -- =Spencer W. Thomas EECS Dept, U of Michigan, Ann Arbor, MI 48109 spencer@eecs.umich.edu 313-936-2616 (8-6 E[SD]T M-F)