How can I retrieve uptime under linux using C? (without using popen and/or /proc)
Thanks
Via top or via uptime, but I don't know about any syscall, someone will for sure :)
top
uptime
uptime should be rather easy to parse.
Just stumbled into this:
#include struct sysinfo info; sysinfo(&info); printf("Uptime = %ld\n", info.uptime);