(__pthread_trylock): Define inline. (__pthread_lock): Add extra parameter to declarat...
[glibc.git] / login / utmp.h
blob21436a33a6380e35b8ccf424b878b88e04075b42
1 /* Copyright (C) 1993, 1996, 1997, 1998 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 not,
16 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. */
19 #ifndef _UTMP_H
20 #define _UTMP_H 1
22 #include <features.h>
24 #include <sys/types.h>
27 __BEGIN_DECLS
29 /* Get system dependent values and data structures. */
30 #include <bits/utmp.h>
32 /* Compatibility names for the strings of the canonical file names. */
33 #define UTMP_FILE _PATH_UTMP
34 #define UTMP_FILENAME _PATH_UTMP
35 #define WTMP_FILE _PATH_WTMP
36 #define WTMP_FILENAME _PATH_WTMP
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 __P ((int __fd));
45 /* Write the given entry into utmp and wtmp. */
46 extern void login __P ((__const struct utmp *__entry));
48 /* Write the utmp entry to say the user on UT_LINE has logged out. */
49 extern int logout __P ((__const char *__ut_line));
51 /* Append to wtmp an entry for the current time and the given info. */
52 extern void logwtmp __P ((__const char *__ut_line, __const char *__ut_name,
53 __const char *__ut_host));
55 /* Append entry UTMP to the wtmp-like file WTMP_FILE. */
56 extern void updwtmp __P ((__const char *__wtmp_file,
57 __const struct utmp *__utmp));
59 /* Change name of the utmp file to be examined. */
60 extern int utmpname __P ((__const char *__file));
62 /* Read next entry from a utmp-like file. */
63 extern struct utmp *getutent __P ((void));
65 /* Reset the input stream to the beginning of the file. */
66 extern void setutent __P ((void));
68 /* Close the current open file. */
69 extern void endutent __P ((void));
71 /* Search forward from the current point in the utmp file until the
72 next entry with a ut_type matching ID->ut_type. */
73 extern struct utmp *getutid __P ((__const struct utmp *__id));
75 /* Search forward from the current point in the utmp file until the
76 next entry with a ut_line matching LINE->ut_line. */
77 extern struct utmp *getutline __P ((__const struct utmp *__line));
79 /* Write out entry pointed to by UTMP_PTR into the utmp file. */
80 extern struct utmp *pututline __P ((__const struct utmp *__utmp_ptr));
83 #ifdef __USE_MISC
84 /* Reentrant versions of the file for handling utmp files. */
85 extern int getutent_r __P ((struct utmp *__buffer, struct utmp **__result));
87 extern int getutid_r __P ((__const struct utmp *__id, struct utmp *__buffer,
88 struct utmp **__result));
90 extern int getutline_r __P ((__const struct utmp *__line,
91 struct utmp *__buffer, struct utmp **__result));
93 #endif /* Use misc. */
95 __END_DECLS
97 #endif /* utmp.h */