aboutsummaryrefslogtreecommitdiff
path: root/lib/do_wtmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/do_wtmp.c')
-rw-r--r--lib/do_wtmp.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/do_wtmp.c b/lib/do_wtmp.c
new file mode 100644
index 0000000..1799895
--- /dev/null
+++ b/lib/do_wtmp.c
@@ -0,0 +1,11 @@
+#include <unistd.h>
+#include <fcntl.h>
+#include <utmp.h>
+
+void do_wtmp(struct utmp *utmp) /*EXTRACT_INCL*/ {
+ int fd;
+ if ((fd=open(_PATH_WTMP, O_WRONLY | O_APPEND)) >= 0) {
+ write(fd, utmp, sizeof(struct utmp));
+ close(fd);
+ }
+}