2 * sysutmp.h Compatibility stuff for the different UTMP systems.
7 #ifndef SYSUTMP_H_INCLUDED
8 #define SYSUTMP_H_INCLUDED
10 #include <freeradius-devel/ident.h>
11 RCSIDH(sysutmp_h, "$Id$")
14 * If we have BOTH utmp.h and utmpx.h, then
15 * we prefer to use utmp.h, but only on systems other than Solaris.
17 #if !defined(sun) && !defined(sgi) && !defined(hpux)
23 #if defined(HAVE_UTMP_H) || defined(HAVE_UTMPX_H)
25 /* UTMP stuff. Uses utmpx on svr4 */
28 # include <sys/fcntl.h>
30 # define UT_NAMESIZE 32
31 # define UT_LINESIZE 32
32 # define UT_HOSTSIZE 257
34 # define ut_name ut_user
41 # define UT_NAMESIZE 32
42 # define UT_LINESIZE 32
43 # define UT_HOSTSIZE 64
46 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(bsdi) || defined(__OpenBSD__) || defined(__APPLE__)
48 # define UTMP_FILE "/var/run/utmp"
50 # define ut_user ut_name
54 * Generate definitions for systems which are too broken to
57 * Hmm... this means that we can probably get rid of a lot of
58 * the static defines above, as the following lines will generate
59 * the proper defines for any system.
62 #define UT_LINESIZE sizeof(((struct utmp *) NULL)->ut_line)
66 #define UT_NAMESIZE sizeof(((struct utmp *) NULL)->ut_user)
70 #define UT_HOSTSIZE sizeof(((struct utmp *) NULL)->ut_host)
73 #else /* HAVE_UTMP_H */
76 * No <utmp.h> file - define stuff ourselves (minimally).
78 #define UT_LINESIZE 16
79 #define UT_NAMESIZE 16
80 #define UT_HOSTSIZE 16
82 #define USER_PROCESS 7
83 #define DEAD_PROCESS 8
85 #define UTMP_FILE "/var/run/utmp"
86 #define ut_name ut_user
91 char ut_line[UT_LINESIZE];
94 char ut_user[UT_NAMESIZE];
95 char ut_host[UT_HOSTSIZE];
99 #endif /* HAVE_UTMP_H */
101 #endif /* SYSUTMP_H_INCLUDED */