Print this page
remove support for non-ANSI compilation
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/head/utmpx.h
+++ new/usr/src/head/utmpx.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
↓ open down ↓ |
12 lines elided |
↑ open up ↑ |
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
21 21 */
22 22 /*
23 + * Copyright 2014 Garrett D'Amore <garrett@damore.org>
24 + *
23 25 * Copyright 1997 Sun Microsystems, Inc. All rights reserved.
24 26 * Use is subject to license terms.
25 27 */
26 28
27 29 /* Copyright (c) 1983,1984,1985,1986,1987,1988,1989 AT&T */
28 30 /* All Rights Reserved */
29 31
30 32 /*
31 33 * Portions of this source code were derived from Berkeley 4.3 BSD
32 34 * under license from the Regents of the University of California.
33 35 */
34 36
35 37 #ifndef _UTMPX_H
36 38 #define _UTMPX_H
37 39
38 -#pragma ident "%Z%%M% %I% %E% SMI"
39 -
40 40 #include <sys/feature_tests.h>
41 41 #include <sys/types.h>
42 42 #include <sys/time.h>
43 43 #include <utmp.h>
44 44
45 45 #ifdef __cplusplus
46 46 extern "C" {
47 47 #endif
48 48
49 49 #define _UTMPX_FILE "/var/adm/utmpx"
50 50 #define _WTMPX_FILE "/var/adm/wtmpx"
51 51 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
52 52 #define UTMPX_FILE _UTMPX_FILE
53 53 #define WTMPX_FILE _WTMPX_FILE
54 54 #endif
55 55
56 56 #define ut_name ut_user
57 57 #define ut_xtime ut_tv.tv_sec
58 58
59 59 /*
60 60 * This data structure describes the utmpx entries returned by
61 61 * the getutxent(3c) family of APIs. It does not (necessarily)
62 62 * correspond to the contents of the utmpx or wtmpx files.
63 63 *
64 64 * Applications should only interact with this subsystem via
65 65 * the getutxent(3c) family of APIs.
66 66 */
67 67 struct utmpx {
68 68 char ut_user[32]; /* user login name */
69 69 char ut_id[4]; /* inittab id */
70 70 char ut_line[32]; /* device name (console, lnxx) */
71 71 pid_t ut_pid; /* process id */
72 72 short ut_type; /* type of entry */
73 73 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
74 74 struct exit_status ut_exit; /* process termination/exit status */
75 75 #else
76 76 struct ut_exit_status ut_exit; /* process termination/exit status */
77 77 #endif
78 78 struct timeval ut_tv; /* time entry was made */
79 79 int ut_session; /* session ID, used for windowing */
80 80 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
81 81 int pad[5]; /* reserved for future use */
82 82 #else
83 83 int __pad[5]; /* reserved for future use */
84 84 #endif
85 85 short ut_syslen; /* significant length of ut_host */
86 86 /* including terminating null */
87 87 char ut_host[257]; /* remote host name */
88 88 };
89 89
90 90 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
91 91
92 92 #include <sys/types32.h>
93 93 #include <inttypes.h>
94 94
95 95 /*
96 96 * This data structure describes the utmp *file* contents using
97 97 * fixed-width data types. It should only be used by the implementation.
98 98 *
99 99 * Applications should use the getutxent(3c) family of routines to interact
100 100 * with this database.
101 101 */
102 102
103 103 struct futmpx {
104 104 char ut_user[32]; /* user login name */
105 105 char ut_id[4]; /* inittab id */
106 106 char ut_line[32]; /* device name (console, lnxx) */
107 107 pid32_t ut_pid; /* process id */
108 108 int16_t ut_type; /* type of entry */
109 109 struct {
110 110 int16_t e_termination; /* process termination status */
111 111 int16_t e_exit; /* process exit status */
112 112 } ut_exit; /* exit status of a process */
113 113 struct timeval32 ut_tv; /* time entry was made */
114 114 int32_t ut_session; /* session ID, user for windowing */
115 115 int32_t pad[5]; /* reserved for future use */
116 116 int16_t ut_syslen; /* significant length of ut_host */
117 117 char ut_host[257]; /* remote host name */
118 118 };
119 119
↓ open down ↓ |
70 lines elided |
↑ open up ↑ |
120 120 #define MOD_WIN 10
121 121
122 122 /* Define and macro for determing if a normal user wrote the entry */
123 123 /* and marking the utmpx entry as a normal user */
124 124 #define NONROOT_USRX 2
125 125 #define nonuserx(utx) ((utx).ut_exit.e_exit == NONROOT_USRX ? 1 : 0)
126 126 #define setuserx(utx) ((utx).ut_exit.e_exit = NONROOT_USRX)
127 127
128 128 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
129 129
130 -#if defined(__STDC__)
131 -
132 130 extern void endutxent(void);
133 131 extern struct utmpx *getutxent(void);
134 132 extern struct utmpx *getutxid(const struct utmpx *);
135 133 extern struct utmpx *getutxline(const struct utmpx *);
136 134 extern struct utmpx *pututxline(const struct utmpx *);
137 135 extern void setutxent(void);
138 136
139 137 #if !defined(_XPG4_2) || defined(__EXTENSIONS__)
140 138 extern int utmpxname(const char *);
141 139 extern struct utmpx *makeutx(const struct utmpx *);
142 140 extern struct utmpx *modutx(const struct utmpx *);
143 141 extern void getutmp(const struct utmpx *, struct utmp *);
144 142 extern void getutmpx(const struct utmp *, struct utmpx *);
145 143 extern void updwtmp(const char *, struct utmp *);
146 144 extern void updwtmpx(const char *, struct utmpx *);
147 145 #endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
148 146
149 -#else /* __STDC__ */
150 -
151 -extern void endutxent();
152 -extern struct utmpx *getutxent();
153 -extern struct utmpx *getutxid();
154 -extern struct utmpx *getutxline();
155 -extern struct utmpx *pututxline();
156 -extern void setutxent();
157 -
158 -#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
159 -extern int utmpxname();
160 -extern struct utmpx *makeutx();
161 -extern struct utmpx *modutx();
162 -extern void getutmp();
163 -extern void getutmpx();
164 -extern void updwtmp();
165 -extern void updwtmpx();
166 -#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
167 -
168 -#endif /* __STDC__ */
169 -
170 147 #ifdef __cplusplus
171 148 }
172 149 #endif
173 150
174 151 #endif /* _UTMPX_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX