Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!ge-dab!sundae10!coleman From: coleman@sundae10.DAB.GE.COM (Richard Coleman) Newsgroups: comp.unix.programmer Subject: possible race condition? Message-ID: <1991May9.144935.20078@ge-dab.GE.COM> Date: 9 May 91 14:49:35 GMT Sender: coleman@sundae10 (Richard Coleman) Reply-To: coleman@sunny.dab.ge.com (Richard Coleman) Organization: GE Aerospace, SCSD Lines: 23 Nntp-Posting-Host: sundae10.dab.ge.com I've been reading the book "Unix Network Programming" by Richard Stevens. On page 80 he is discussing a code fragment having to do with a daemon skeleton for SystemV. if (fork() != 0) exit(0); /* parent process exits */ setpgrp(); /* change process group and lose control tty */ signal(SIGHUP,SIG_IGN); if (fork() != 0) exit(0); /* first child process exits */ /* second child process continues as daemon */ Now my questions is this : when the parent process exits, it sends the signal SIGHUP to all processes in its process group. Is it possible for this signal to reach the first child process before it executes setpgrp() and changes its process group? Am I missing something here? -- Richard Coleman GE Aerospace Simulation & Control Systems Dept. coleman@sunny.dab.ge.com