2.9
[glibc/nacl-glibc.git] / sysdeps / gnu / utmpx.h
blob8622916a946ea1f198633e90b4a536686517a81d
1 /* Copyright (C) 1997, 1998, 1999, 2003 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, write to the Free
16 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 02111-1307 USA. */
19 #ifndef _UTMPX_H
20 #define _UTMPX_H 1
22 #include <features.h>
23 #include <sys/time.h>
25 /* Required according to Unix98. */
26 #ifndef __pid_t_defined
27 typedef __pid_t pid_t;
28 # define __pid_t_defined
29 #endif
31 /* Get system dependent values and data structures. */
32 #include <bits/utmpx.h>
34 #ifdef __USE_GNU
35 /* Compatibility names for the strings of the canonical file names. */
36 # define UTMPX_FILE _PATH_UTMPX
37 # define UTMPX_FILENAME _PATH_UTMPX
38 # define WTMPX_FILE _PATH_WTMPX
39 # define WTMPX_FILENAME _PATH_WTMPX
40 #endif
42 /* For the getutmp{,x} functions we need the `struct utmp'. */
43 #ifdef __USE_GNU
44 struct utmp;
45 #endif
48 __BEGIN_DECLS
50 /* Open user accounting database.
52 This function is a possible cancellation point and therefore not
53 marked with __THROW. */
54 extern void setutxent (void);
56 /* Close user accounting database.
58 This function is a possible cancellation point and therefore not
59 marked with __THROW. */
60 extern void endutxent (void);
62 /* Get the next entry from the user accounting database.
64 This function is a possible cancellation point and therefore not
65 marked with __THROW. */
66 extern struct utmpx *getutxent (void);
68 /* Get the user accounting database entry corresponding to ID.
70 This function is a possible cancellation point and therefore not
71 marked with __THROW. */
72 extern struct utmpx *getutxid (__const struct utmpx *__id);
74 /* Get the user accounting database entry corresponding to LINE.
76 This function is a possible cancellation point and therefore not
77 marked with __THROW. */
78 extern struct utmpx *getutxline (__const struct utmpx *__line);
80 /* Write the entry UTMPX into the user accounting database.
82 This function is a possible cancellation point and therefore not
83 marked with __THROW. */
84 extern struct utmpx *pututxline (__const struct utmpx *__utmpx);
87 #ifdef __USE_GNU
88 /* Change name of the utmpx file to be examined.
90 This function is not part of POSIX and therefore no official
91 cancellation point. But due to similarity with an POSIX interface
92 or due to the implementation it is a cancellation point and
93 therefore not marked with __THROW. */
94 extern int utmpxname (__const char *__file);
96 /* Append entry UTMP to the wtmpx-like file WTMPX_FILE.
98 This function is not part of POSIX and therefore no official
99 cancellation point. But due to similarity with an POSIX interface
100 or due to the implementation it is a cancellation point and
101 therefore not marked with __THROW. */
102 extern void updwtmpx (__const char *__wtmpx_file,
103 __const struct utmpx *__utmpx);
106 /* Copy the information in UTMPX to UTMP.
108 This function is not part of POSIX and therefore no official
109 cancellation point. But due to similarity with an POSIX interface
110 or due to the implementation it is a cancellation point and
111 therefore not marked with __THROW. */
112 extern void getutmp (__const struct utmpx *__utmpx,
113 struct utmp *__utmp);
115 /* Copy the information in UTMP to UTMPX.
117 This function is not part of POSIX and therefore no official
118 cancellation point. But due to similarity with an POSIX interface
119 or due to the implementation it is a cancellation point and
120 therefore not marked with __THROW. */
121 extern void getutmpx (__const struct utmp *__utmp,
122 struct utmpx *__utmpx);
123 #endif
125 __END_DECLS
127 #endif /* utmpx.h */