Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uflorida!novavax!infocenter!mhoffman From: mhoffman@infocenter.UUCP (Mike Hoffman) Newsgroups: comp.unix.questions Subject: Summary - How to tell if a process is active Keywords: process kill ps Message-ID: <2848@infocenter.UUCP> Date: 20 Jun 89 13:18:39 GMT Organization: Gould CSD, Fort Lauderdale, FL Lines: 40 In an earlier message, I wrote: >I have an application in which I need to check to see if a process >is currently active. Thanks to all who answered my request for a better approach. The correct way to tell if a process is active is by using kill(2), and sending a signal of 0. This will perform error checking, but does not actually send a signal to the process. Kill(2) returns 0 if the process exists and is yours, or -1 otherwise. If -1 is returned, errno is set to any of several values, the most relevant of which are EPERM (the process exists but is not yours) and ESRCH (the process does not exist). In one response, Casper H.S. Dik (casper@fwi.uva.nl) points out that "As often is the case with Unix manuals, if you know where to look you get perfect answers." For me, kill wasn't a very obvious place to look for process information! Thanks to the following people for responding to my request (and for providing consistent answers - this turned out to be much simpler than finding the meaning of "grep" :-) casper@fwi.uva.nl uunet!prcrs!paul uunet!atexnet!jackal ram@cuxlm.att.com uunet!mcnc!unc!poirier uunet!noifcrf.gov!kml jeff@quark.wv.tek.com peter@ficc.uu.net uunet!arizona!sham --- Michael J. Hoffman "My opinions are my own and are Manufacturing Engineering not to be employed with those Encore Computer Corporation of my confuser." UUCP: {uunet,codas!novavax,sun,pur-ee}!gould!mhoffman