home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / programm / 4458 < prev    next >
Encoding:
Internet Message Format  |  1992-08-26  |  1.3 KB

  1. Xref: sparky comp.unix.programmer:4458 comp.unix.wizards:3701
  2. Path: sparky!uunet!cs.utexas.edu!ut-emx!ibmchs!auschs!awdprime.austin.ibm.com!ravikm
  3. From: ravikm@austin.ibm.com (Ravi K Mandava)
  4. Newsgroups: comp.unix.programmer,comp.unix.wizards
  5. Subject: Re: detecting process death from unrelated process
  6. Message-ID: <1992Aug26.194612.25105@awdprime.austin.ibm.com>
  7. Date: 26 Aug 92 19:46:12 GMT
  8. References: <1992Aug25.225021.22386@atlastele.com>
  9. Sender: news@awdprime.austin.ibm.com (USENET News)
  10. Reply-To: piobe!ravikm@ibmpa.awdpa.ibm.com
  11. Organization: IBM Austin
  12. Lines: 14
  13. Originator: ravikm@piobe.austin.ibm.com
  14.  
  15.  
  16. In article <1992Aug25.225021.22386@atlastele.com>, gerald@atlastele.com (Gerald Aden) writes:
  17. > Is there a way for process A to detect that process B has exited where
  18. > process A has the pid of process B but is not the parent of process B?
  19.  
  20.     To find out if a process is alive or not, use kill(pid_t procid, int
  21.     signal) call with 0 signal.  If the call returns -1 and errno is set
  22.     to ESRCH, then the process is not alive.  Else, it is alive.
  23.  
  24. Hope this helps,
  25. -- 
  26. *******************************************************************************
  27. Ravi K Mandava        email:    piobe!ravikm@ibmpa.awdpa.ibm.com
  28. *******************************************************************************
  29.