Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!vsi1!wyse!mips!prls!philabs!phri!marob!cowan From: cowan@marob.masa.com (John Cowan) Newsgroups: comp.unix.questions Subject: Re: How to tell if a process is active? Keywords: process Message-ID: <1989Jun16.182054.746@marob.masa.com> Date: 16 Jun 89 18:20:54 GMT References: <2727@infocenter.UUCP> <4608@ncrcae.Columbia.NCR.COM> Reply-To: cowan@marob.masa.com (John Cowan) Organization: ESCC New York City Lines: 45 In article <4608@ncrcae.Columbia.NCR.COM> wescott@ncrcae.Columbia.NCR.COM (Mike Wescott) writes: >In article <2727@infocenter.UUCP> mhoffman@infocenter.UUCP (Mike Hoffman) writes: >> >> I have an application in which I need to check to see if a process >> is currently active. > >Try: > >isactive(pid) > if(kill(pid,0)==0 || errno == EPERM) > return(process is active) > else > return(process is not active) > >see kill(2). > >-- > -Mike Wescott > mike.wescott@ncrcae.Columbia.NCR.COM That doesn't work on all flavors of Unix. Xenix supports it, so does SVR2, but definitely not in V7. I don't know about BSD. Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! Fascist inews! -- John Cowan or UUCP mailers: ...!uunet!hombre!{marob,magpie}!cowan Fidonet (last resort): 1:107/711 Aiya elenion ancalima!