Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get process creation time

Status
Not open for further replies.

ladmoni

Programmer
Aug 12, 2003
11
IL
Hi,
I am looking for API that will retrieve me a process creation time by its pid.(if there is not API that does it can you tell me where I can find this information in /proc/pid/stat)
Thanks
 
Using this script

"service xinetd restart; date >> /stat; cat /proc/`pidof xinetd`/stat >> /stat"

I got this info:

Fri Nov 21 09:22:37 CST 2003
16181 (xinetd) S 1 16181 16181 0 -1 64 27 0 125 0 1 0 0 0
14 0 0 0 32568451 2076672 211 4294967295 134512640 134659160
3221223792 3221223280 1074435193 0 0 3674112 2143547135
3222306731 0 0 17 0

Fri Nov 21 09:22:50 CST 2003
16209 (xinetd) S 1 16209 16209 0 -1 64 27 0 125 0 0 0 0 0
17 0 0 0 32569758 2076672 211 4294967295 134512640 134659160
3221223792 3221223280 1074435193 0 0 3674112 2143547135
3222306731 0 0 17 0

Fri Nov 21 09:22:59 CST 2003
16237 (xinetd) S 1 16237 16237 0 -1 64 27 0 125 0 0 0 0 0
17 0 0 0 32570748 2076672 211 4294967295 134512640 134659160
3221223792 3221223280 1074435193 0 0 3674112 2143547135
3222306731 0 0 17 0

The 5th number on the 3rd line might be the unix start time. Any other input here?

In case the line breaks break, here are the numbers that changed (other than the pid):
32568451, 32569758, 32570748

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top