home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / programm / 4653 < prev    next >
Encoding:
Text File  |  1992-09-14  |  846 b   |  24 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!morrow.stanford.edu!pangea.Stanford.EDU!karish
  3. From: karish@pangea.Stanford.EDU (Chuck Karish)
  4. Subject: Re: Checking if a process exists
  5. Message-ID: <1992Sep15.001525.16849@morrow.stanford.edu>
  6. Sender: news@morrow.stanford.edu (News Service)
  7. Organization: Mindcraft, Inc.
  8. References: <1992Sep14.150438.128@inet.d48.lilly.com>
  9. Distribution: world,local
  10. Date: Tue, 15 Sep 1992 00:15:25 GMT
  11. Lines: 11
  12.  
  13. In article <1992Sep14.150438.128@inet.d48.lilly.com>
  14. rz64938@mystic.d50.lilly.com (David W. Crumbacher) writes:
  15.  
  16. >Is there a way in C to check if a certain process is running?
  17.  
  18. kill(pid, 0) returns 0 if the process exists but returns -1
  19. and sets errno to ESRCH if the process does not exist.
  20. --
  21.  
  22.     Chuck Karish          karish@mindcraft.com
  23.     (415) 323-9000 x117   karish@forel.stanford.edu
  24.