Date: Mon, 11 Aug 2014 08:11:37 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 192573] New: [patch] add ps(1) option to print process start time in seconds since 1970 Message-ID: <bug-192573-8@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192573 Bug ID: 192573 Summary: [patch] add ps(1) option to print process start time in seconds since 1970 Product: Base System Version: 11.0-CURRENT Hardware: Any OS: Any Status: Needs Triage Severity: Affects Only Me Priority: --- Component: bin Assignee: freebsd-bugs@FreeBSD.org Reporter: dave@daveeddy.com Created attachment 145651 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=145651&action=edit code patch for ps(1) This patch adds a field (sstart) to ps(1) to print the time, in seconds since January 1st 1970, when a process started. On Solaris (and the same works on Linux I believe), you can stat(2) /proc/<pid> and inspect the mtime of the directory to determine this information, however on BSD (1) /proc doesn't set the mtime on these directories and (2) /proc is most-likely going to be removed in future releases. Examples: Simple example useful for scripting $ ./ps -p $$ -o sstart= 1407708424 All "started" fields currently available for the current process $ ./ps -p $$ -o start,lstart,sstart STARTED STARTED STARTED 10:07PM Sun Aug 10 22:07:04 2014 1407708424 `sstart` is the most convenient for scripting purposes. -- You are receiving this mail because: You are the assignee for the bug.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-192573-8>