Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: Finding if a process is active Message-ID: <13095@smoke.BRL.MIL> Date: 13 Jun 90 04:19:26 GMT References: <1629@s3.ireq.hydro.qc.ca> Distribution: comp.unix.questions Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 16 In article <1629@s3.ireq.hydro.qc.ca> godin@ireq.hydro.qc.ca (Andre Godin 8926) writes: > I have a process (written in C) running under SunOS 4.0.3 that >have to find out if a process exist, knowing only his name. Processes don't have names, only numbers (PIDs). The image that was exec()ed came from a file that had a name, but the process could easily alter the only record of the name assigned to its argv[0], which is normally set to the "simple part" of the file name by the shell used to exec() the process. (But that is just a convention, not necessarily followed by all exec()ers.) > Is there a system call (or something else) that can tell me if >a certain process is active? kill(pid,0) will tell you whether or not process #pid is active, assuming you have appropriate permissions.