#procpid — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #procpid, aggregated by home.social.
-
TIL on Linux you cannot rely on the timestamps of files in
/proc/<pid>to give you information about a process start time: those might be reset on suspend of if a process gets aSIGSTOP.
Instead, one should look at the 22nd field of/proc/pid/stat:starttime.
But it gives you the process start time in system clock ticks, not seconds. So you must divide it bysysconf(_SC_CLK_TCK)to get seconds.
But wait, it gives you the start time in ticks since boot. So you must useclock_gettime(CLOCK_BOOTTIME, ...)to get a usable comparison to the current time.Anyway, now progressrm should be more accurate at guessing the file arguments progression (and remaining time) of rm commands.