- changed status to resolved
Should use sysinfo struct instead of running uptime command
Issue #2
resolved
Currently the uptime is retrieved with the uptime command and the output is parsed with a regex. This is unreliable (uptime format may change) and a clumsy way overall.
The sysinfo struct described on http://man7.org/linux/man-pages/man2/sysinfo.2.html should be used instead. Reading the struct will also have better performance since no additional processes are spawned.
Comments (1)
-
reporter - Log in to comment
Get uptime from sys/sysinfo.h instead of parsing uptime output. Fixes
#2→ <<cset 0c463f24bf88>>