From: Bill Joy Date: Wed, 9 May 1979 07:14:05 +0000 (-0800) Subject: BSD 2 development X-Git-Tag: BSD-2~84 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/ea69094fb7d1f1fdca7b95a89c0c039c1bacbd67 BSD 2 development Work on file src/saveboottime.c Synthesized-from: 2bsd --- diff --git a/src/saveboottime.c b/src/saveboottime.c new file mode 100644 index 0000000000..d30cb76e7c --- /dev/null +++ b/src/saveboottime.c @@ -0,0 +1,19 @@ +/* Copyright (c) 1979 Regents of the University of California */ +#include + +struct utmp reboot; + +main() +{ + + if (getuid()) + exit(1); + close(1); + open("/usr/adm/wtmp", 1); + strcpy(reboot.ut_line, "tty~"); + strcpy(reboot.ut_name, "reboot"); + time(&reboot.ut_time); + lseek(1, (long) 0, 2); + write(1, (char *) &reboot, sizeof reboot); + exit(0); +}