]>
Commit | Line | Data |
---|---|---|
3d9156a7 A |
1 | --- utmpx.h.orig 2004-08-05 14:37:28.000000000 -0700 |
2 | +++ utmpx.h 2004-08-05 15:42:48.000000000 -0700 | |
3 | @@ -38,28 +38,26 @@ | |
4 | #ifndef _UTMPX_H_ | |
5 | #define _UTMPX_H_ | |
6 | ||
7 | -#include <sys/cdefs.h> | |
8 | -#include <sys/featuretest.h> | |
9 | -#include <sys/socket.h> | |
10 | +#include <_types.h> | |
11 | #include <sys/time.h> | |
12 | ||
13 | +#ifndef _PID_T | |
14 | +#define _PID_T | |
15 | +typedef __darwin_pid_t pid_t; | |
16 | +#endif | |
17 | + | |
18 | #define _PATH_UTMPX "/var/run/utmpx" | |
19 | -#define _PATH_WTMPX "/var/log/wtmpx" | |
20 | -#define _PATH_LASTLOGX "/var/log/lastlogx" | |
21 | #define _PATH_UTMP_UPDATE "/usr/libexec/utmp_update" | |
22 | ||
23 | +#ifndef _POSIX_C_SOURCE | |
24 | +#define UTMPX_FILE _PATH_UTMPX | |
25 | +#endif /* _POSIX_C_SOURCE */ | |
26 | + | |
27 | #define _UTX_USERSIZE 32 | |
28 | #define _UTX_LINESIZE 32 | |
29 | #define _UTX_IDSIZE 4 | |
30 | #define _UTX_HOSTSIZE 256 | |
31 | ||
32 | -#if defined(_NETBSD_SOURCE) | |
33 | -#define UTX_USERSIZE _UTX_USERSIZE | |
34 | -#define UTX_LINESIZE _UTX_LINESIZE | |
35 | -#define UTX_IDSIZE _UTX_IDSIZE | |
36 | -#define UTX_HOSTSIZE _UTX_HOSTSIZE | |
37 | -#endif | |
38 | - | |
39 | #define EMPTY 0 | |
40 | #define RUN_LVL 1 | |
41 | #define BOOT_TIME 2 | |
42 | @@ -69,75 +67,35 @@ | |
43 | #define LOGIN_PROCESS 6 | |
44 | #define USER_PROCESS 7 | |
45 | #define DEAD_PROCESS 8 | |
46 | - | |
47 | -#if defined(_NETBSD_SOURCE) | |
48 | #define ACCOUNTING 9 | |
49 | #define SIGNATURE 10 | |
50 | -#endif | |
51 | ||
52 | /* | |
53 | * The following structure describes the fields of the utmpx entries | |
54 | - * stored in _PATH_UTMPX or _PATH_WTMPX. This is not the format the | |
55 | + * stored in _PATH_UTMPX. This is not the format the | |
56 | * entries are stored in the files, and application should only access | |
57 | * entries using routines described in getutxent(3). | |
58 | */ | |
59 | ||
60 | -#define ut_user ut_name | |
61 | -#define ut_xtime ut_tv.tv_sec | |
62 | - | |
63 | struct utmpx { | |
64 | - char ut_name[_UTX_USERSIZE]; /* login name */ | |
65 | - char ut_id[_UTX_IDSIZE]; /* inittab id */ | |
66 | + char ut_user[_UTX_USERSIZE]; /* login name */ | |
67 | + char ut_id[_UTX_IDSIZE]; /* id */ | |
68 | char ut_line[_UTX_LINESIZE]; /* tty name */ | |
69 | - char ut_host[_UTX_HOSTSIZE]; /* host name */ | |
70 | - uint16_t ut_session; /* session id used for windowing */ | |
71 | - uint16_t ut_type; /* type of this entry */ | |
72 | pid_t ut_pid; /* process id creating the entry */ | |
73 | - struct { | |
74 | - uint16_t e_termination; /* process termination signal */ | |
75 | - uint16_t e_exit; /* process exit status */ | |
76 | - } ut_exit; | |
77 | - struct sockaddr_storage ut_ss; /* address where entry was made from */ | |
78 | + short ut_type; /* type of this entry */ | |
79 | struct timeval ut_tv; /* time entry was created */ | |
80 | - uint32_t ut_pad[10]; /* reserved for future use */ | |
81 | -}; | |
82 | - | |
83 | -#if defined(_NETBSD_SOURCE) | |
84 | -struct lastlogx { | |
85 | - struct timeval ll_tv; /* time entry was created */ | |
86 | - char ll_line[_UTX_LINESIZE]; /* tty name */ | |
87 | - char ll_host[_UTX_HOSTSIZE]; /* host name */ | |
88 | - struct sockaddr_storage ll_ss; /* address where entry was made from */ | |
89 | + char ut_host[_UTX_HOSTSIZE]; /* host name */ | |
90 | + __uint32_t ut_pad[16]; /* reserved for future use */ | |
91 | }; | |
92 | -#endif /* !_XOPEN_SOURCE */ | |
93 | ||
94 | __BEGIN_DECLS | |
95 | ||
96 | -void setutxent __P((void)); | |
97 | -void endutxent __P((void)); | |
98 | -struct utmpx *getutxent __P((void)); | |
99 | -struct utmpx *getutxid __P((const struct utmpx *)); | |
100 | -struct utmpx *getutxline __P((const struct utmpx *)); | |
101 | -struct utmpx *pututxline __P((const struct utmpx *)); | |
102 | - | |
103 | -#if defined(_NETBSD_SOURCE) | |
104 | -int updwtmpx __P((const char *, const struct utmpx *)); | |
105 | -int lastlogxname __P((const char *)); | |
106 | -#ifdef __LIBC12_SOURCE__ | |
107 | -struct lastlogx *getlastlogx __P((uid_t, struct lastlogx *)); | |
108 | -struct lastlogx *__getlastlogx13 __P((const char *, uid_t, struct lastlogx *)); | |
109 | -#else | |
110 | -struct lastlogx *getlastlogx __P((const char *, uid_t, struct lastlogx *)) | |
111 | - __RENAME(__getlastlogx13); | |
112 | -#endif | |
113 | -int updlastlogx __P((const char *, uid_t, struct lastlogx *)); | |
114 | -struct utmp; | |
115 | -void getutmp __P((const struct utmpx *, struct utmp *)); | |
116 | -void getutmpx __P((const struct utmp *, struct utmpx *)); | |
117 | - | |
118 | -int utmpxname __P((const char *)); | |
119 | - | |
120 | -#endif /* _NETBSD_SOURCE */ | |
121 | +void setutxent(void); | |
122 | +void endutxent(void); | |
123 | +struct utmpx *getutxent(void); | |
124 | +struct utmpx *getutxid(const struct utmpx *); | |
125 | +struct utmpx *getutxline(const struct utmpx *); | |
126 | +struct utmpx *pututxline(const struct utmpx *); | |
127 | ||
128 | __END_DECLS | |
129 |