Files
fastfetch/src/detection/uptime/uptime_linux.c
T

11 lines
183 B
C
Raw Normal View History

2022-10-13 10:39:11 +08:00
#include "uptime.h"
2022-12-28 17:18:08 +08:00
#include <sys/sysinfo.h>
uint64_t ffDetectUptime()
2022-10-13 10:39:11 +08:00
{
2022-12-28 17:18:08 +08:00
struct sysinfo info;
if(sysinfo(&info) != 0)
2022-10-13 10:39:11 +08:00
return 0;
2022-12-28 17:18:08 +08:00
return (uint32_t) info.uptime;
2022-10-13 10:39:11 +08:00
}