summaryrefslogtreecommitdiff
path: root/libc/misc/utmp/utxent.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-03-25 23:59:45 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2015-03-25 23:59:45 +0100
commit6ff9c31abc14f207265ab214370982ecb3bfe428 (patch)
treeafdaf5624e71c939c39abe8ef3aba5980aa4d911 /libc/misc/utmp/utxent.c
parent2b33716c08cc506e57115e34b5fe11d8d5477398 (diff)
utmp: favour POSIX utmpx over SVID utmp
Note: _PATH_UTMPX == _PATH_UTMP and the utmp struct is identical to the utmpx struct so this only changes the external API entrypoints and NOT the underlying data source. This saves about 500b (~1300b from previously ~1950) while at it. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc/misc/utmp/utxent.c')
-rw-r--r--libc/misc/utmp/utxent.c108
1 files changed, 0 insertions, 108 deletions
diff --git a/libc/misc/utmp/utxent.c b/libc/misc/utmp/utxent.c
deleted file mode 100644
index c32e4da49..000000000
--- a/libc/misc/utmp/utxent.c
+++ /dev/null
@@ -1,108 +0,0 @@
-/* vi: set sw=4 ts=4: */
-/*
- * utexent.c : Support for accessing user accounting database.
- * Copyright (C) 2010 STMicroelectronics Ltd.
- *
- * Author: Salvatore Cro <salvatore.cro@st.com>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- *
- */
-
-#include <features.h>
-#include <string.h>
-#include <utmpx.h>
-#include <utmp.h>
-
-void setutxent(void)
-{
- setutent ();
-}
-
-void endutxent(void)
-{
- endutent ();
-}
-
-struct utmpx *getutxent(void)
-{
- return (struct utmpx *) getutent ();
-}
-
-struct utmpx *getutxid(const struct utmpx *utmp_entry)
-{
- return (struct utmpx *) getutid ((const struct utmp *) utmp_entry);
-}
-
-struct utmpx *getutxline(const struct utmpx *utmp_entry)
-{
- return (struct utmpx *) getutline ((const struct utmp *) utmp_entry);
-}
-
-struct utmpx *pututxline (const struct utmpx *utmp_entry)
-{
- return (struct utmpx *) pututline ((const struct utmp *) utmp_entry);
-}
-
-int utmpxname (const char *new_ut_name)
-{
- return utmpname (new_ut_name);
-}
-
-void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
-{
- updwtmp (wtmpx_file, (const struct utmp *) utmpx);
-}
-
-/* Copy the information in UTMPX to UTMP. */
-void getutmp (const struct utmpx *utmpx, struct utmp *utmp)
-{
-#if _HAVE_UT_TYPE - 0
- utmp->ut_type = utmpx->ut_type;
-#endif
-#if _HAVE_UT_PID - 0
- utmp->ut_pid = utmpx->ut_pid;
-#endif
- memcpy (utmp->ut_line, utmpx->ut_line, sizeof (utmp->ut_line));
- memcpy (utmp->ut_user, utmpx->ut_user, sizeof (utmp->ut_user));
-#if _HAVE_UT_ID - 0
- memcpy (utmp->ut_id, utmpx->ut_id, sizeof (utmp->ut_id));
-#endif
-#if _HAVE_UT_HOST - 0
- memcpy (utmp->ut_host, utmpx->ut_host, sizeof (utmp->ut_host));
-#endif
-#if _HAVE_UT_TV - 0
- utmp->ut_tv.tv_sec = utmpx->ut_tv.tv_sec;
- utmp->ut_tv.tv_usec = utmpx->ut_tv.tv_usec;
-#else
- utmp->ut_time = utmpx->ut_time;
-#endif
-}
-
-/* Copy the information in UTMP to UTMPX. */
-void getutmpx (const struct utmp *utmp, struct utmpx *utmpx)
-{
- memset (utmpx, 0, sizeof (struct utmpx));
-
-#if _HAVE_UT_TYPE - 0
- utmpx->ut_type = utmp->ut_type;
-#endif
-#if _HAVE_UT_PID - 0
- utmpx->ut_pid = utmp->ut_pid;
-#endif
- memcpy (utmpx->ut_line, utmp->ut_line, sizeof (utmp->ut_line));
- memcpy (utmpx->ut_user, utmp->ut_user, sizeof (utmp->ut_user));
-#if _HAVE_UT_ID - 0
- memcpy (utmpx->ut_id, utmp->ut_id, sizeof (utmp->ut_id));
-#endif
-#if _HAVE_UT_HOST - 0
- memcpy (utmpx->ut_host, utmp->ut_host, sizeof (utmp->ut_host));
-#endif
-#if _HAVE_UT_TV - 0
- utmpx->ut_tv.tv_sec = utmp->ut_tv.tv_sec;
- utmpx->ut_tv.tv_usec = utmp->ut_tv.tv_usec;
-#else
- utmpx->ut_time = utmp->ut_time;
-#endif
-}
-