1 --- utmpx.h.orig 2004-08-05 14:37:28.000000000 -0700
2 +++ utmpx.h 2004-08-05 15:42:48.000000000 -0700
7 -#include <sys/cdefs.h>
8 -#include <sys/featuretest.h>
9 -#include <sys/socket.h>
15 +typedef __darwin_pid_t pid_t;
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"
23 +#ifndef _POSIX_C_SOURCE
24 +#define UTMPX_FILE _PATH_UTMPX
25 +#endif /* _POSIX_C_SOURCE */
27 #define _UTX_USERSIZE 32
28 #define _UTX_LINESIZE 32
30 #define _UTX_HOSTSIZE 256
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
43 #define LOGIN_PROCESS 6
44 #define USER_PROCESS 7
45 #define DEAD_PROCESS 8
47 -#if defined(_NETBSD_SOURCE)
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).
60 -#define ut_user ut_name
61 -#define ut_xtime ut_tv.tv_sec
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 */
74 - uint16_t e_termination; /* process termination signal */
75 - uint16_t e_exit; /* process exit status */
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 */
83 -#if defined(_NETBSD_SOURCE)
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 */
92 -#endif /* !_XOPEN_SOURCE */
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 *));
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 *));
110 -struct lastlogx *getlastlogx __P((const char *, uid_t, struct lastlogx *))
111 - __RENAME(__getlastlogx13);
113 -int updlastlogx __P((const char *, uid_t, struct lastlogx *));
115 -void getutmp __P((const struct utmpx *, struct utmp *));
116 -void getutmpx __P((const struct utmp *, struct utmpx *));
118 -int utmpxname __P((const char *));
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 *);