home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.programmer
- Path: sparky!uunet!morrow.stanford.edu!pangea.Stanford.EDU!karish
- From: karish@pangea.Stanford.EDU (Chuck Karish)
- Subject: Re: Checking if a process exists
- Message-ID: <1992Sep15.001525.16849@morrow.stanford.edu>
- Sender: news@morrow.stanford.edu (News Service)
- Organization: Mindcraft, Inc.
- References: <1992Sep14.150438.128@inet.d48.lilly.com>
- Distribution: world,local
- Date: Tue, 15 Sep 1992 00:15:25 GMT
- Lines: 11
-
- In article <1992Sep14.150438.128@inet.d48.lilly.com>
- rz64938@mystic.d50.lilly.com (David W. Crumbacher) writes:
-
- >Is there a way in C to check if a certain process is running?
-
- kill(pid, 0) returns 0 if the process exists but returns -1
- and sets errno to ESRCH if the process does not exist.
- --
-
- Chuck Karish karish@mindcraft.com
- (415) 323-9000 x117 karish@forel.stanford.edu
-