* How can I get process start time on OSF1?
@ 2000-02-23 5:00 Brian Buckley
2000-02-25 5:00 ` Andrew Duane USG
0 siblings, 1 reply; 4+ messages in thread
From: Brian Buckley @ 2000-02-23 5:00 UTC (permalink / raw)
Hi there!
I am trying to get a c function call for what should be really simple -
getting the start time of a process (any process, i.e. of which I am not
the owner).
This is no problem in SVR4 systems with a procfs (solaris, IRIX, Linux)
- just stat() the corresponding /proc entry for the process. Even AIX
which has no procfs at least has a getprocs() system call. My system
here has a procfs but for some reason which baffles me it updates the
creation time of the /proc entries every minute (does anyone know
why???) - so stat() is useless. I have searched the documentation for
something like AIX's getprocs() to no avail.
Help would be much appreciated.
_______________________________________________________________
Brian Buckley.
Any views expressed here are my own and do not represent those of my
company.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How can I get process start time on OSF1?
2000-02-23 5:00 How can I get process start time on OSF1? Brian Buckley
@ 2000-02-25 5:00 ` Andrew Duane USG
2000-03-02 5:00 ` Brian Buckley
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Duane USG @ 2000-02-25 5:00 UTC (permalink / raw)
In article <38B3B548.C8E70D51@iona.com> Brian Buckley <brian.buckley@iona.com> writes:
>I am trying to get a c function call for what should be really simple -
>getting the start time of a process (any process, i.e. of which I am not
>the owner).
>
>This is no problem in SVR4 systems with a procfs (solaris, IRIX, Linux)
>- just stat() the corresponding /proc entry for the process. Even AIX
>which has no procfs at least has a getprocs() system call. My system
>here has a procfs but for some reason which baffles me it updates the
>creation time of the /proc entries every minute (does anyone know
>why???) - so stat() is useless. I have searched the documentation for
>something like AIX's getprocs() to no avail.
Brian,
The procfs file system in Tru64 Unix sets all three fields (mtime, atime,
and ctime) to the current time. This is the behaviour you're seeing.
You can use table(TBL_UAREA) to get the U area for a process, which
contains a field u_start.
--
Andrew L. Duane (JOT-7) duane@zk3.dec.com
Compaq Computer Corporation (603)-884-1294
110 Spit Brook Road
M/S ZKO3-3/U14
Nashua, NH 03062-2698
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How can I get process start time on OSF1?
2000-02-25 5:00 ` Andrew Duane USG
@ 2000-03-02 5:00 ` Brian Buckley
2000-03-09 5:00 ` Jeff Denham
0 siblings, 1 reply; 4+ messages in thread
From: Brian Buckley @ 2000-03-02 5:00 UTC (permalink / raw)
Hi Andrew,
Thanks for the info. I tried table(TBL_UAREA) in a little test programme and it fails
with EPERM unless I run as root. Is there any way to get process info for any process if I
am running as a regular user?
Brian.
Andrew Duane USG wrote:
> In article <38B3B548.C8E70D51@iona.com> Brian Buckley <brian.buckley@iona.com> writes:
> >I am trying to get a c function call for what should be really simple -
> >getting the start time of a process (any process, i.e. of which I am not
> >the owner).
> >
> >This is no problem in SVR4 systems with a procfs (solaris, IRIX, Linux)
> >- just stat() the corresponding /proc entry for the process. Even AIX
> >which has no procfs at least has a getprocs() system call. My system
> >here has a procfs but for some reason which baffles me it updates the
> >creation time of the /proc entries every minute (does anyone know
> >why???) - so stat() is useless. I have searched the documentation for
> >something like AIX's getprocs() to no avail.
>
> Brian,
>
> The procfs file system in Tru64 Unix sets all three fields (mtime, atime,
> and ctime) to the current time. This is the behaviour you're seeing.
>
> You can use table(TBL_UAREA) to get the U area for a process, which
> contains a field u_start.
>
> --
>
> Andrew L. Duane (JOT-7) duane@zk3.dec.com
> Compaq Computer Corporation (603)-884-1294
> 110 Spit Brook Road
> M/S ZKO3-3/U14
> Nashua, NH 03062-2698
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How can I get process start time on OSF1?
2000-03-02 5:00 ` Brian Buckley
@ 2000-03-09 5:00 ` Jeff Denham
0 siblings, 0 replies; 4+ messages in thread
From: Jeff Denham @ 2000-03-09 5:00 UTC (permalink / raw)
On Thu, 02 Mar 2000 13:28:58 +0000, Brian Buckley
<brian.buckley@iona.com> wrote:
>Hi Andrew,
>
>Thanks for the info. I tried table(TBL_UAREA) in a little test programme and it fails
>with EPERM unless I run as root. Is there any way to get process info for any process if I
>am running as a regular user?
>
>Brian.
Yes, but unfortunately, it's called the ps command.
You've found a bug in the /proc implementation. I think Andrew should
fix it ASAP...
Jeff
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2000-03-09 5:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-02-23 5:00 How can I get process start time on OSF1? Brian Buckley
2000-02-25 5:00 ` Andrew Duane USG
2000-03-02 5:00 ` Brian Buckley
2000-03-09 5:00 ` Jeff Denham
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox