🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.ibm.pc.rt
Article #504

Finding dead processes

#504
From: Flame Bait
Date: Thu, 26 Oct 1989 22:42
24 lines
1603 bytes
I'm trying to write a routine which will check if a process is still alive.
On real UNIX, I can use kill(2) to send a zero signal to the process.  If
the process in question is a zombie or dead, I will get an error.  On AIX, 
however, killing a zombie process does not cause an error.

I have three questions:
    How can I write a routine which will take a pid and return TRUE if the
    process is alive and well, and FALSE if it is dead or zombie?

    Isn't this a bug?  The man pages says that sending a zero signal can
    be used to "check the validity of pid."  I would think that a zombie
    process is not valid.

    Is this part of some standard I do not know about?  Does POSIX or SVID
    require this behavor?

Obviously, I can run ps and look at its output, or read kmem, but I want 
something fast and portable.  Thanks for any help.

Joshua Levy
--------                Quote: "If you haven't ported your program, it's not
Addresses:                      a portable program.  No exceptions."  
joshua@atherton.com          
{decwrl|sun|hpda}!athertn!joshua    work:(408)734-9822    home:(415)968-3718
Technical Details
Message-ID: <14138@joshua.athertn.Atherton.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!apple!voder!pyramid!athertn!joshua

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!usc!apple!voder!pyramid!athertn!joshua
From: joshua@athertn.Atherton.COM (Flame Bait)
Newsgroups: comp.sys.ibm.pc.rt,comp.unix.aix
Subject: Finding dead processes
Message-ID: <14138@joshua.athertn.Atherton.COM>
Date: 26 Oct 89 22:42:59 GMT
Reply-To: joshua@Atherton.COM (Flame Bait)
Organization: A little shaky now (about 7.1)
Lines: 24