From bf7102a303ec86f2d9bc9fd451db78a6815ca175 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Sun, 14 Jan 2018 23:46:06 -0600 Subject: utmp: Implement the reentrant utmp function from LSB This takes advantage of the (lack of a) musl implementation for simplicity. Signed-off-by: Samuel Holland --- Makefile | 1 + libgcompat/utmp.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 libgcompat/utmp.c diff --git a/Makefile b/Makefile index 7996e6b..5e5a12e 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,7 @@ LIBGCOMPAT_SRC = \ libgcompat/syslog.c \ libgcompat/ucontext.c \ libgcompat/unistd.c \ + libgcompat/utmp.c \ libgcompat/version.c \ libgcompat/wchar.c LIBGCOMPAT_OBJ = ${LIBGCOMPAT_SRC:.c=.o} diff --git a/libgcompat/utmp.c b/libgcompat/utmp.c new file mode 100644 index 0000000..c2bdd91 --- /dev/null +++ b/libgcompat/utmp.c @@ -0,0 +1,14 @@ +#include /* NULL */ +#include /* struct utmp */ + +/** + * Get user accounting database entries. + * + * LSB 5.0: LSB-Core-generic/baselib-getutent-r-3.html + */ +int getutent_r(struct utmp *buffer, struct utmp **result) +{ + /* musl does not implement getutent(). */ + *result = NULL; + return -1; +} -- cgit v1.2.3-70-g09d2