Should use sysinfo struct instead of running uptime command

Issue #2 resolved
Mikko Ahlroth repo owner created an issue

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)

  1. Log in to comment