]> git.ipfire.org Git - thirdparty/glibc.git/blame - sysdeps/gnu/utmpx.h
Update copyright notices with scripts/update-copyrights
[thirdparty/glibc.git] / sysdeps / gnu / utmpx.h
CommitLineData
d4697bc9 1/* Copyright (C) 1997-2014 Free Software Foundation, Inc.
f21acc89 2 This file is part of the GNU C Library.
f21acc89
UD
3
4 The GNU C Library is free software; you can redistribute it and/or
41bdb6e2
AJ
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.
f21acc89
UD
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
41bdb6e2 12 Lesser General Public License for more details.
f21acc89 13
41bdb6e2 14 You should have received a copy of the GNU Lesser General Public
59ba27a6
PE
15 License along with the GNU C Library; if not, see
16 <http://www.gnu.org/licenses/>. */
f21acc89
UD
17
18#ifndef _UTMPX_H
19#define _UTMPX_H 1
20
21#include <features.h>
26262bc2 22#include <sys/time.h>
f21acc89 23
26262bc2 24/* Required according to Unix98. */
7df789e0 25#ifndef __pid_t_defined
26262bc2 26typedef __pid_t pid_t;
7df789e0 27# define __pid_t_defined
26262bc2 28#endif
f21acc89
UD
29
30/* Get system dependent values and data structures. */
31#include <bits/utmpx.h>
32
8619129f
UD
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
26262bc2
UD
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
2c008571 49/* Open user accounting database.
f21acc89 50
2c008571
UD
51 This function is a possible cancellation point and therefore not
52 marked with __THROW. */
53extern void setutxent (void);
f21acc89 54
2c008571 55/* Close user accounting database.
f21acc89 56
2c008571
UD
57 This function is a possible cancellation point and therefore not
58 marked with __THROW. */
59extern void endutxent (void);
f21acc89 60
2c008571 61/* Get the next entry from the user accounting database.
f21acc89 62
2c008571
UD
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. */
a784e502 71extern struct utmpx *getutxid (const struct utmpx *__id);
2c008571
UD
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. */
a784e502 77extern struct utmpx *getutxline (const struct utmpx *__line);
2c008571
UD
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. */
a784e502 83extern struct utmpx *pututxline (const struct utmpx *__utmpx);
26262bc2 84
f21acc89 85
8619129f 86#ifdef __USE_GNU
2c008571
UD
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. */
a784e502 93extern int utmpxname (const char *__file);
2c008571
UD
94
95/* Append entry UTMP to the wtmpx-like file WTMPX_FILE.
8619129f 96
2c008571
UD
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. */
a784e502
UD
101extern void updwtmpx (const char *__wtmpx_file,
102 const struct utmpx *__utmpx);
6eb857c7 103
26262bc2 104
2c008571
UD
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. */
a784e502 111extern void getutmp (const struct utmpx *__utmpx,
2c008571
UD
112 struct utmp *__utmp);
113
114/* Copy the information in UTMP to UTMPX.
6eb857c7 115
2c008571
UD
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. */
a784e502 120extern void getutmpx (const struct utmp *__utmp, struct utmpx *__utmpx);
8619129f
UD
121#endif
122
f21acc89
UD
123__END_DECLS
124
125#endif /* utmpx.h */