Ohad Horesh
Ohad Horesh

Reputation: 4390

Getting the current process creation time in Linux

How do I get the current process creation time using c/c++ on Linux? When I'm opening the file /proc//stat
The output is just a bunch of numbers. How do I know which one of them is the creation time?

Upvotes: 2

Views: 2486

Answers (2)

filmor
filmor

Reputation: 32298

I suggest you look into man 5 proc. On my system, the 22nd entry is the start time.

Upvotes: 0

Matt Joiner
Matt Joiner

Reputation: 118720

The manpage lists the order and meaning of the values of /proc/[pid]/stat. This answer more information.

Upvotes: 1

Related Questions