🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.ibm.pc.rt
1 messages
1 total messages Started by Flame Bait Thu, 26 Oct 1989 22:42
Finding dead processes
#504
Author: 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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads