It is currently Tue, 30 Nov 2021 17:28:36 GMT



 
Author Message
 checking on the status of a non-child pid

I would like to know how to programmatically call
ps, or something equivalent to ps, to check on the
status of a process but is not a child process.

Please answer also directly,
Thanks
--
                                          myriam



 Fri, 01 Jun 2001 03:00:00 GMT   
 checking on the status of a non-child pid

If you just want to know if the process is up, use kill(2)
with signal zero and check the return value.  If zero,
the process is running;  if negative, check errno.



 Fri, 01 Jun 2001 03:00:00 GMT   
 checking on the status of a non-child pid

    >>
    >> I would like to know how to programmatically call
    >> ps, or something equivalent to ps, to check on the
    >> status of a process but is not a child process.
    >
    >If you just want to know if the process is up, use kill(2)
    >with signal zero and check the return value.  If zero,
    >the process is running;  if negative, check errno.

I want to know the status as displayed with ps, that is
whether the process is stopped, sleeping, etc.

--
                                          myriam



 Fri, 01 Jun 2001 03:00:00 GMT   
 checking on the status of a non-child pid
Myriam M Abramson (mabra...@osf1.gmu.edu) wrote:

: I would like to know how to programmatically call
: ps, or something equivalent to ps, to check on the
: status of a process but is not a child process.

If you've got a /proc filesystem, you can usually extract some useful
information.  Especially under Linux.

Fred.
--
+----------------------------------------------------------------------+
| Fred Barnes, CS Student, UKC                http://teddy.xylene.com/ |
| fr...@ukc.ac.uk                            http://stuE253.ukc.ac.uk/ |
+----------------------------------------------------------------------+



 Fri, 01 Jun 2001 03:00:00 GMT   
 checking on the status of a non-child pid
In article <MABRAMSO.98Dec14105...@osf1.gmu.edu>,
mabra...@osf1.gmu.edu (Myriam M Abramson) writes:

RTFAQ.  <URL:http://www.erlenstar.demon.co.uk/unix/>.  Try question 1.8 `How
can I look at process in the system like ps does?' and the platform-specific
examples in the `Examples' section.

--
Aaron Crane   <aaron.cr...@pobox.com>   <URL:http://pobox.com/~aaronc/>
** Spammers -- why not email the FCC Commissioners?
** wkenn...@fcc.gov  pmise...@fcc.gov  mpow...@fcc.gov



 Sat, 02 Jun 2001 03:00:00 GMT   
 checking on the status of a non-child pid

On HP-UX you can use the pstat_getproc() system call to get detailed
information about a running process.



 Mon, 04 Jun 2001 03:00:00 GMT   
 
   [ 6 post ] 

Similar Threads

1. Getting PID of process and check exit status

2. checking the status of a child

3. obtaining child PID in a child subshell

4. Print tracer PID in /proc/<pid>/status

5. pid 25's child link is bad

6. child process' killer's pid

7. kill a child pid?

8. Child process PID

9. child's parent PID is 1 ???


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software