2 * sysutmp.h Compatibility stuff for the different UTMP systems.
7 #ifndef SYSUTMP_H_INCLUDED
8 #define SYSUTMP_H_INCLUDED
12 /* UTMP stuff. Uses utmpx on svr4 */
15 # include <sys/fcntl.h>
17 # define UT_NAMESIZE 32
18 # define UT_LINESIZE 32
19 # define UT_HOSTSIZE 257
25 # define UT_NAMESIZE 32
26 # define UT_LINESIZE 32
27 # define UT_HOSTSIZE 64
30 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(bsdi) || defined(__OpenBSD__)
32 # define UTMP_FILE "/var/run/utmp"
34 # define ut_user ut_name
38 * Generate definitions for systems which are too broken to
41 * Hmm... this means that we can probably get rid of a lot of
42 * the static defines above, as the following lines will generate
43 * the proper defines for any system.
46 #define UT_LINESIZE sizeof(((struct utmp *) NULL)->ut_line)
50 #define UT_NAMESIZE sizeof(((struct utmp *) NULL)->ut_user)
54 #define UT_HOSTSIZE sizeof(((struct utmp *) NULL)->ut_host)
57 #else /* HAVE_UTMP_H */
60 * No <utmp.h> file - define stuff ourselves (minimally).
62 #define UT_LINESIZE 16
63 #define UT_NAMESIZE 16
64 #define UT_HOSTSIZE 16
66 #define USER_PROCESS 7
67 #define DEAD_PROCESS 8
69 #define UTMP_FILE "/var/run/utmp"
70 #define ut_name ut_user
75 char ut_line[UT_LINESIZE];
78 char ut_user[UT_NAMESIZE];
79 char ut_host[UT_HOSTSIZE];
83 #endif /* HAVE_UTMP_H */
85 #endif /* SYSUTMP_H_INCLUDED */