... FILE *utmp = fopen(UTMP_FILE, "r"); if (utmp == NULL) { /* Can't open utmp, use current time as boottime */ boottime = time(NULL); } else { while (fread((char *) &buf, sizeof(buf), 1, utmp) == 1) { if (buf.ut_type == BOOT_TIME) { boottime = buf.ut_time; break; } } } ...
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)