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.
14 #if !defined(sun) && !defined(sgi) && !defined(hpux)
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
31 # define ut_name ut_user
38 # define UT_NAMESIZE 32
39 # define UT_LINESIZE 32
40 # define UT_HOSTSIZE 64
43 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(bsdi) || defined(__OpenBSD__) || defined(__APPLE__)
45 # define UTMP_FILE "/var/run/utmp"
47 # define ut_user ut_name
51 * Generate definitions for systems which are too broken to
54 * Hmm... this means that we can probably get rid of a lot of
55 * the static defines above, as the following lines will generate
56 * the proper defines for any system.
59 #define UT_LINESIZE sizeof(((struct utmp *) NULL)->ut_line)
63 #define UT_NAMESIZE sizeof(((struct utmp *) NULL)->ut_user)
67 #define UT_HOSTSIZE sizeof(((struct utmp *) NULL)->ut_host)
70 #else /* HAVE_UTMP_H */
73 * No <utmp.h> file - define stuff ourselves (minimally).
75 #define UT_LINESIZE 16
76 #define UT_NAMESIZE 16
77 #define UT_HOSTSIZE 16
79 #define USER_PROCESS 7
80 #define DEAD_PROCESS 8
82 #define UTMP_FILE "/var/run/utmp"
83 #define ut_name ut_user
88 char ut_line[UT_LINESIZE];
91 char ut_user[UT_NAMESIZE];
92 char ut_host[UT_HOSTSIZE];
96 #endif /* HAVE_UTMP_H */
98 #endif /* SYSUTMP_H_INCLUDED */