2 * sysutmp.h Compatibility stuff for the different UTMP systems.
7 #ifndef SYSUTMP_H_INCLUDED
8 #define SYSUTMP_H_INCLUDED
11 * If we have BOTH utmp.h and utmpx.h, then
12 * we prefer to use utmp.h, but only on systems other than Solaris.
20 #if defined(HAVE_UTMP_H) || defined(HAVE_UTMPX_H)
22 /* UTMP stuff. Uses utmpx on svr4 */
25 # include <sys/fcntl.h>
27 # define UT_NAMESIZE 32
28 # define UT_LINESIZE 32
29 # define UT_HOSTSIZE 257
35 # define UT_NAMESIZE 32
36 # define UT_LINESIZE 32
37 # define UT_HOSTSIZE 64
40 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(bsdi) || defined(__OpenBSD__)
42 # define UTMP_FILE "/var/run/utmp"
44 # define ut_user ut_name
48 * Generate definitions for systems which are too broken to
51 * Hmm... this means that we can probably get rid of a lot of
52 * the static defines above, as the following lines will generate
53 * the proper defines for any system.
56 #define UT_LINESIZE sizeof(((struct utmp *) NULL)->ut_line)
60 #define UT_NAMESIZE sizeof(((struct utmp *) NULL)->ut_user)
64 #define UT_HOSTSIZE sizeof(((struct utmp *) NULL)->ut_host)
67 #else /* HAVE_UTMP_H */
70 * No <utmp.h> file - define stuff ourselves (minimally).
72 #define UT_LINESIZE 16
73 #define UT_NAMESIZE 16
74 #define UT_HOSTSIZE 16
76 #define USER_PROCESS 7
77 #define DEAD_PROCESS 8
79 #define UTMP_FILE "/var/run/utmp"
80 #define ut_name ut_user
85 char ut_line[UT_LINESIZE];
88 char ut_user[UT_NAMESIZE];
89 char ut_host[UT_HOSTSIZE];
93 #endif /* HAVE_UTMP_H */
95 #endif /* SYSUTMP_H_INCLUDED */