Can anyone tell me how to detect the status of a process. Basically, I
just want to know whether it's dead or alive.
Show me the functions in C.
Thanks.
Min
Can anyone tell me how to detect the status of a process. Basically, I
just want to know whether it's dead or alive.
Show me the functions in C.
Thanks.
Min
: Can anyone tell me how to detect the status of a process. Basically, I
: just want to know whether it's dead or alive.
: Show me the functions in C.
What is your definition of dead or alive ?
Maybe kill(2) will be sufficient for your needs ?
Make sure that you appreciate and can differentiate between 'alive and
processing' and 'supposedly alive but in fact zombie/defunct/not processing'.
IAP
#include <errno.h>
#define ISALIVE(PID) ( !( kill((PID), 0) < 0 && errno == ESRCH ) )
On Solaris 2.x (or at least 2.5 and 2.6) you can use poll(2) on a file under
/proc to detect the demise of a process. See proc(4).
/Mikko
--
DynaSoft
1. How do I check whether a process has died by using process ID?
Can anyone tell me how to detect the status of a process. Basically, I
just want to know whether it's dead or alive.
Show me the functions in C.
Thanks.
Min
2. Mod_perl1.15/16 & FreeBSD 2.2x
3. How do I check whether a process has died by using process ID in C?
4. IP aliasing patch -- FTP (not WWW) site?
5. Process Id for the child process that is dying
6. Problem:Zappa Board and NCR53C810 SCSI
7. How to know whether a process is the child of a process ?
8. slip-ping/pong works but not ftp/telnet (tcp)
9. Multistream Process Append Process ID To Beginning Of Log
10. How do I get the process GROUP ID of the signaling process?
11. Still having problems. INIT process DYING.
12. Can a signal be sent to process when another process dies or stops?
13. Capturing the Process ID of a Process started in Background in ksh