]>
git.ipfire.org Git - thirdparty/glibc.git/blob - login/utmp.h
1 /* Copyright (C) 1993, 1996 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 Library General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 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 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public
15 License along with the GNU C Library; see the file COPYING.LIB. If
16 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
25 #include <sys/types.h>
28 /* Get system dependent values and data structures. */
32 /* Make FD be the controlling terminal, stdin, stdout, and stderr;
33 then close FD. Returns 0 on success, nonzero on error. */
34 extern int login_tty
__P ((int fd
));
37 /* Write the given entry into utmp and wtmp. */
38 extern void login
__P ((__const
struct utmp
*));
40 /* Write the utmp entry to say the user on UT_LINE has logged out. */
41 extern int logout
__P ((__const
char *ut_line
));
43 /* Append to wtmp an entry for the current time and the given info. */
44 extern void logwtmp
__P ((__const
char *ut_line
, __const
char *ut_name
,
45 __const
char *ut_host
));
47 /* Change name of the utmp file to be examined. */
48 extern int utmpname
__P ((__const
char *__file
));
50 /* Read next entry from a utmp-like file. */
51 extern struct utmp
*getutent
__P ((void));
53 /* Rest the input stream to the beginning of the file. */
54 extern void setutent
__P ((void));
56 /* Close the current open file. */
57 extern void endutent
__P ((void));
59 /* Search forward from the current point in the utmp file until the
60 next entry with a ut_type matching ID->ut_type. */
61 extern struct utmp
*getutid
__P ((__const
struct utmp
*__id
));
63 /* Search forward from the current point in the utmp file until the
64 next entry with a ut_line matching LINE->ut_line. */
65 extern struct utmp
*getutline
__P ((__const
struct utmp
*__line
));
67 /* Write out entry pointed to by UTMP_PTR into the utmp file. */
68 extern struct utmp
*pututline
__P ((__const
struct utmp
*__utmp_ptr
));
71 #ifdef __USE_REENTRANT
72 /* Define the data structure needed for the reentrent version. */
81 /* Reentrent versions of the file for handling utmp files. */
82 extern int getutent_r
__P ((struct utmp
**__utmp
,
83 struct utmp_data
*__utmp_data
));
85 extern void setutent_r
__P ((struct utmp_data
*__utmp_data
));
87 extern void endutent_r
__P ((struct utmp_data
*__utmp_data
));
89 extern int getutid_r
__P ((__const
struct utmp
*__id
, struct utmp
**__utmp
,
90 struct utmp_data
*__utmp_data
));
92 extern int getutline_r
__P ((__const
struct utmp
*__line
, struct utmp
**__utmp
,
93 struct utmp_data
*__utmp_data
));
95 extern int pututline_r
__P ((__const
struct utmp
*__utmp_ptr
,
96 struct utmp_data
*__utmp_data
));
98 #endif /* Use reentrant. */