How do I get an uptime under Linux using C? (Without Popen and / or / proc)
Thank you
via Top
or uptime
, but I do not know of any syscall, anyone is sure that :)
uptime < / Code> should be rather easy to parse.
Just stumbled into it:
#include & lt; Sys / sysinfo.h & gt; Structure sysinfo information; SysInfo (& info); Printf ("uptime =% ld \ n", info.uptime);
Comments
Post a Comment