1 /* Copyright (C) 1993, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
4 The GNU C Library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
9 The GNU C Library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Lesser General Public License for more details.
14 You should have received a copy of the GNU Lesser General Public
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
23 #include <sys/types.h>
28 /* Get system dependent values and data structures. */
29 #include <bits/utmp.h>
31 /* Compatibility names for the strings of the canonical file names. */
32 #define UTMP_FILE _PATH_UTMP
33 #define UTMP_FILENAME _PATH_UTMP
34 #define WTMP_FILE _PATH_WTMP
35 #define WTMP_FILENAME _PATH_WTMP
39 #ifdef __UCLIBC_HAS_LIBUTIL__
40 /* Make FD be the controlling terminal, stdin, stdout, and stderr;
41 then close FD. Returns 0 on success, nonzero on error. */
42 extern int login_tty (int __fd
) __THROW
;
43 libutil_hidden_proto(login_tty
)
45 /* Write the given entry into utmp and wtmp. */
46 extern void login (const struct utmp
*__entry
) __THROW
;
48 /* Write the utmp entry to say the user on UT_LINE has logged out. */
49 extern int logout (const char *__ut_line
) __THROW
;
51 /* Append to wtmp an entry for the current time and the given info. */
52 extern void logwtmp (const char *__ut_line
, const char *__ut_name
,
53 const char *__ut_host
) __THROW
;
56 /* Append entry UTMP to the wtmp-like file WTMP_FILE. */
57 extern void updwtmp (const char *__wtmp_file
, const struct utmp
*__utmp
)
60 /* Change name of the utmp file to be examined. */
61 extern int utmpname (const char *__file
) __THROW
;
63 /* Read next entry from a utmp-like file. */
64 extern struct utmp
*getutent (void) __THROW
;
66 /* Reset the input stream to the beginning of the file. */
67 extern void setutent (void) __THROW
;
69 /* Close the current open file. */
70 extern void endutent (void) __THROW
;
72 /* Search forward from the current point in the utmp file until the
73 next entry with a ut_type matching ID->ut_type. */
74 extern struct utmp
*getutid (const struct utmp
*__id
) __THROW
;
76 /* Search forward from the current point in the utmp file until the
77 next entry with a ut_line matching LINE->ut_line. */
78 extern struct utmp
*getutline (const struct utmp
*__line
) __THROW
;
80 /* Write out entry pointed to by UTMP_PTR into the utmp file. */
81 extern struct utmp
*pututline (const struct utmp
*__utmp_ptr
) __THROW
;
84 #if 0 /* def __USE_MISC */
85 /* Reentrant versions of the file for handling utmp files. */
86 extern int getutent_r (struct utmp
*__buffer
, struct utmp
**__result
) __THROW
;
88 extern int getutid_r (const struct utmp
*__id
, struct utmp
*__buffer
,
89 struct utmp
**__result
) __THROW
;
91 extern int getutline_r (const struct utmp
*__line
,
92 struct utmp
*__buffer
, struct utmp
**__result
) __THROW
;
94 #endif /* Use misc. */