1/* Copyright (C) 1997-2022 Free Software Foundation, Inc.
2 This file is part of the GNU C Library.
3
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.
8
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.
13
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 <https://www.gnu.org/licenses/>. */
17
18#ifndef _UTMPX_H
19#define _UTMPX_H 1
20
21#include <features.h>
22#include <sys/time.h>
23
24/* Required according to Unix98. */
25#ifndef __pid_t_defined
26typedef __pid_t pid_t;
27# define __pid_t_defined
28#endif
29
30/* Get system dependent values and data structures. */
31#include <bits/utmpx.h>
32
33#ifdef __USE_GNU
34/* Compatibility names for the strings of the canonical file names. */
35# define UTMPX_FILE _PATH_UTMPX
36# define UTMPX_FILENAME _PATH_UTMPX
37# define WTMPX_FILE _PATH_WTMPX
38# define WTMPX_FILENAME _PATH_WTMPX
39#endif
40
41/* For the getutmp{,x} functions we need the `struct utmp'. */
42#ifdef __USE_GNU
43struct utmp;
44#endif
45
46
47__BEGIN_DECLS
48
49/* Open user accounting database.
50
51 This function is a possible cancellation point and therefore not
52 marked with __THROW. */
53extern void setutxent (void);
54
55/* Close user accounting database.
56
57 This function is a possible cancellation point and therefore not
58 marked with __THROW. */
59extern void endutxent (void);
60
61/* Get the next entry from the user accounting database.
62
63 This function is a possible cancellation point and therefore not
64 marked with __THROW. */
65extern struct utmpx *getutxent (void);
66
67/* Get the user accounting database entry corresponding to ID.
68
69 This function is a possible cancellation point and therefore not
70 marked with __THROW. */
71extern struct utmpx *getutxid (const struct utmpx *__id);
72
73/* Get the user accounting database entry corresponding to LINE.
74
75 This function is a possible cancellation point and therefore not
76 marked with __THROW. */
77extern struct utmpx *getutxline (const struct utmpx *__line);
78
79/* Write the entry UTMPX into the user accounting database.
80
81 This function is a possible cancellation point and therefore not
82 marked with __THROW. */
83extern struct utmpx *pututxline (const struct utmpx *__utmpx);
84
85
86#ifdef __USE_GNU
87/* Change name of the utmpx file to be examined.
88
89 This function is not part of POSIX and therefore no official
90 cancellation point. But due to similarity with an POSIX interface
91 or due to the implementation it is a cancellation point and
92 therefore not marked with __THROW. */
93extern int utmpxname (const char *__file);
94
95/* Append entry UTMP to the wtmpx-like file WTMPX_FILE.
96
97 This function is not part of POSIX and therefore no official
98 cancellation point. But due to similarity with an POSIX interface
99 or due to the implementation it is a cancellation point and
100 therefore not marked with __THROW. */
101extern void updwtmpx (const char *__wtmpx_file,
102 const struct utmpx *__utmpx);
103
104
105/* Copy the information in UTMPX to UTMP.
106
107 This function is not part of POSIX and therefore no official
108 cancellation point. But due to similarity with an POSIX interface
109 or due to the implementation it is a cancellation point and
110 therefore not marked with __THROW. */
111extern void getutmp (const struct utmpx *__utmpx,
112 struct utmp *__utmp);
113
114/* Copy the information in UTMP to UTMPX.
115
116 This function is not part of POSIX and therefore no official
117 cancellation point. But due to similarity with an POSIX interface
118 or due to the implementation it is a cancellation point and
119 therefore not marked with __THROW. */
120extern void getutmpx (const struct utmp *__utmp, struct utmpx *__utmpx);
121#endif
122
123__END_DECLS
124
125#endif /* utmpx.h */
126