7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /* Copyright (c) 1988 AT&T */
23 /* All Rights Reserved */
24
25
26 /*
27 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
28 * Use is subject to license terms.
29 */
30
31
32 #ifndef _UTMP_H
33 #define _UTMP_H
34
35 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.5.1.7 */
36
37 /*
38 * Note: The getutent(3c) family of interfaces are obsolete.
39 * The getutxent(3c) family provide a superset of this functionality
40 * and should be used in place of getutent(3c).
41 */
42
43 #include <sys/types.h>
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
50 #define UTMP_FILE "/var/adm/utmp"
51 #define WTMP_FILE "/var/adm/wtmp"
52 #endif
53
54 #define ut_name ut_user
55
56 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
134
135 /* Special strings or formats used in the "ut_line" field when */
136 /* accounting for something other than a process. */
137 /* No string for the ut_line field can be more than 11 chars + */
138 /* a NULL in length. */
139
140 #define RUNLVL_MSG "run-level %c"
141 #define BOOT_MSG "system boot"
142 #define OTIME_MSG "old time"
143 #define NTIME_MSG "new time"
144 #define PSRADM_MSG "%03d %s" /* processor on or off */
145 #define DOWN_MSG "system down"
146
147 /* Define and macro for determing if a normal user wrote the entry */
148 /* and marking the utmpx entry as a normal user */
149 #define NONROOT_USR 2
150 #define nonuser(ut) ((ut).ut_exit.e_exit == NONROOT_USR ? 1 : 0)
151 #define setuser(ut) ((ut).ut_exit.e_exit = NONROOT_USR)
152
153
154 #if defined(__STDC__)
155 extern void endutent(void);
156 extern struct utmp *getutent(void);
157 extern struct utmp *getutid(const struct utmp *);
158 extern struct utmp *getutline(const struct utmp *);
159 extern struct utmp *pututline(const struct utmp *);
160 extern void setutent(void);
161 extern int utmpname(const char *);
162 #else
163 extern void endutent();
164 extern struct utmp *getutent();
165 extern struct utmp *getutid();
166 extern struct utmp *getutline();
167 extern struct utmp *pututline();
168 extern void setutent();
169 extern int utmpname();
170 #endif
171
172 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
173
174 #ifdef __cplusplus
175 }
176 #endif
177
178 #endif /* _UTMP_H */
|
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /* Copyright (c) 1988 AT&T */
23 /* All Rights Reserved */
24
25
26 /*
27 * Copyright 2014 Garrett D'Amore <garrett@damore.org>
28 *
29 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
30 * Use is subject to license terms.
31 */
32
33
34 #ifndef _UTMP_H
35 #define _UTMP_H
36
37 /*
38 * Note: The getutent(3c) family of interfaces are obsolete.
39 * The getutxent(3c) family provide a superset of this functionality
40 * and should be used in place of getutent(3c).
41 */
42
43 #include <sys/types.h>
44
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48
49 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
50 #define UTMP_FILE "/var/adm/utmp"
51 #define WTMP_FILE "/var/adm/wtmp"
52 #endif
53
54 #define ut_name ut_user
55
56 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
134
135 /* Special strings or formats used in the "ut_line" field when */
136 /* accounting for something other than a process. */
137 /* No string for the ut_line field can be more than 11 chars + */
138 /* a NULL in length. */
139
140 #define RUNLVL_MSG "run-level %c"
141 #define BOOT_MSG "system boot"
142 #define OTIME_MSG "old time"
143 #define NTIME_MSG "new time"
144 #define PSRADM_MSG "%03d %s" /* processor on or off */
145 #define DOWN_MSG "system down"
146
147 /* Define and macro for determing if a normal user wrote the entry */
148 /* and marking the utmpx entry as a normal user */
149 #define NONROOT_USR 2
150 #define nonuser(ut) ((ut).ut_exit.e_exit == NONROOT_USR ? 1 : 0)
151 #define setuser(ut) ((ut).ut_exit.e_exit = NONROOT_USR)
152
153
154 extern void endutent(void);
155 extern struct utmp *getutent(void);
156 extern struct utmp *getutid(const struct utmp *);
157 extern struct utmp *getutline(const struct utmp *);
158 extern struct utmp *pututline(const struct utmp *);
159 extern void setutent(void);
160 extern int utmpname(const char *);
161
162 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
163
164 #ifdef __cplusplus
165 }
166 #endif
167
168 #endif /* _UTMP_H */
|