projects
/
unix-history
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1872c2e
)
BSD 2 development
author
Bill Joy
<wnj@ucbvax.Berkeley.EDU>
Wed, 9 May 1979 07:14:05 +0000
(23:14 -0800)
committer
Bill Joy
<wnj@ucbvax.Berkeley.EDU>
Wed, 9 May 1979 07:14:05 +0000
(23:14 -0800)
Work on file src/saveboottime.c
Synthesized-from: 2bsd
src/saveboottime.c
[new file with mode: 0644]
patch
|
blob
diff --git a/src/saveboottime.c
b/src/saveboottime.c
new file mode 100644
(file)
index 0000000..
d30cb76
--- /dev/null
+++ b/
src/saveboottime.c
@@ -0,0
+1,19
@@
+/* Copyright (c) 1979 Regents of the University of California */
+#include <utmp.h>
+
+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);
+}