summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-06-07 12:38:22 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-06-07 12:38:22 +0000
commit2caa705bebc970e59f2b7500b0b0604cae926ab2 (patch)
tree2c81a780648555eb16aec5adf1b2f39ff6682a74 /src
parent5797f4f3721c8e59b6d6eda169c35c841e97ffaf (diff)
downloadutmps-2caa705bebc970e59f2b7500b0b0604cae926ab2.tar.xz
Add utmpxname, change default socket names, ready for 0.0.1.0
Diffstat (limited to 'src')
-rw-r--r--src/include/utmps/utmpx.h1
-rw-r--r--src/utmps/deps-lib/utmps1
-rw-r--r--src/utmps/utmpxname.c24
3 files changed, 26 insertions, 0 deletions
diff --git a/src/include/utmps/utmpx.h b/src/include/utmps/utmpx.h
index cdc6a8c..d0f3457 100644
--- a/src/include/utmps/utmpx.h
+++ b/src/include/utmps/utmpx.h
@@ -61,6 +61,7 @@ extern struct utmpx *getutxid (struct utmpx const *) ;
extern struct utmpx *getutxline (struct utmpx const *) ;
extern struct utmpx *pututxline (struct utmpx const *) ;
+extern int utmpxname (char const *) ;
extern void updwtmpx (char const *, struct utmpx const *) ;
extern void logwtmp (char const *, char const *, char const *) ;
diff --git a/src/utmps/deps-lib/utmps b/src/utmps/deps-lib/utmps
index 430b7fb..c73d439 100644
--- a/src/utmps/deps-lib/utmps
+++ b/src/utmps/deps-lib/utmps
@@ -6,6 +6,7 @@ logwtmp.o
pututxline.o
setutxent.o
updwtmpx.o
+utmpxname.o
utmps_end.o
utmps_getent.o
utmps_getid.o
diff --git a/src/utmps/utmpxname.c b/src/utmps/utmpxname.c
new file mode 100644
index 0000000..650f0a4
--- /dev/null
+++ b/src/utmps/utmpxname.c
@@ -0,0 +1,24 @@
+/* ISC license. */
+
+#include <errno.h>
+#include <utmps/utmpx.h>
+
+ /*
+ utmps does not support changing the utmp file: this file is
+ hardcoded as $wd/utmp, $wd being the working directory of
+ the utmps-utmpd daemon.
+
+ Software that needs to change the utmp file should instead
+ run its own instance of utmps-utmpd to access the alternate
+ file the software wants, and connect to that instance.
+
+ A stub is still provided so software can *build* and work
+ in the cases where it doesn't try accessing a non-default
+ utmp file.
+ */
+
+int utmpxname (char const *file)
+{
+ (void)file ;
+ return (errno = ENOSYS, -1) ;
+}