ITEM: J3247L
How to determine if process is still running.
Question:
Is there is a function that can used to determine if a process is still
running. Customer wants a function that can be executed by a non-root
user by which it can be determined whether or not a process, which may
or not be a child of the calling non-root user is still extant.
Response:
The method to use to do the above is to issue:
kill(pid, 0)
If the return code is 0, process exists and belongs to user.
If the return code is -1 and errno = EPERM, process exists and
belongs to someone else.
If the return code is -1 and errno = ESRCH, process is no longer extant.
Support Line: How to determine if process is still running. ITEM: J3247L
Dated: May 1994 Category: N/A
This HTML file was generated 99/06/24~13:30:43
Comments or suggestions?
Contact us