2 * utexent.c : Support for accessing user accounting database.
3 * Copyright (C) 2010 STMicroelectronics Ltd.
5 * Author: Salvatore Cro <salvatore.cro@st.com>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
16 #if 0 /* moved to utent.c */
27 struct utmpx *getutxent(void)
29 return (struct utmpx *) getutent ();
32 struct utmpx *getutxid(const struct utmpx *utmp_entry)
34 return (struct utmpx *) getutid ((const struct utmp *) utmp_entry);
37 struct utmpx *getutxline(const struct utmpx *utmp_entry)
39 return (struct utmpx *) getutline ((const struct utmp *) utmp_entry);
42 struct utmpx *pututxline (const struct utmpx *utmp_entry)
44 return (struct utmpx *) pututline ((const struct utmp *) utmp_entry);
47 int utmpxname (const char *new_ut_name)
49 return utmpname (new_ut_name);
52 /* moved to wtent.c */
53 void updwtmpx (const char *wtmpx_file, const struct utmpx *utmpx)
55 updwtmp (wtmpx_file, (const struct utmp *) utmpx);
59 /* Copy the information in UTMPX to UTMP. */
60 void getutmp (const struct utmpx *utmpx, struct utmp *utmp)
63 utmp->ut_type = utmpx->ut_type;
66 utmp->ut_pid = utmpx->ut_pid;
68 memcpy (utmp->ut_line, utmpx->ut_line, sizeof (utmp->ut_line));
69 memcpy (utmp->ut_user, utmpx->ut_user, sizeof (utmp->ut_user));
71 memcpy (utmp->ut_id, utmpx->ut_id, sizeof (utmp->ut_id));
74 memcpy (utmp->ut_host, utmpx->ut_host, sizeof (utmp->ut_host));
77 utmp->ut_tv.tv_sec = utmpx->ut_tv.tv_sec;
78 utmp->ut_tv.tv_usec = utmpx->ut_tv.tv_usec;
80 utmp->ut_time = utmpx->ut_time;
84 /* Copy the information in UTMP to UTMPX. */
85 void getutmpx (const struct utmp *utmp, struct utmpx *utmpx)
87 memset (utmpx, 0, sizeof (struct utmpx));
90 utmpx->ut_type = utmp->ut_type;
93 utmpx->ut_pid = utmp->ut_pid;
95 memcpy (utmpx->ut_line, utmp->ut_line, sizeof (utmp->ut_line));
96 memcpy (utmpx->ut_user, utmp->ut_user, sizeof (utmp->ut_user));
98 memcpy (utmpx->ut_id, utmp->ut_id, sizeof (utmp->ut_id));
100 #if _HAVE_UT_HOST - 0
101 memcpy (utmpx->ut_host, utmp->ut_host, sizeof (utmp->ut_host));
104 utmpx->ut_tv.tv_sec = utmp->ut_tv.tv_sec;
105 utmpx->ut_tv.tv_usec = utmp->ut_tv.tv_usec;
107 utmpx->ut_time = utmp->ut_time;