Change a couple of Makefile.ins to plain Makefiles
[freeradius.git] / src / include / sysutmp.h
1 /*
2  * sysutmp.h    Compatibility stuff for the different UTMP systems.
3  *
4  * Version:     $Id$
5  */
6
7 #ifndef SYSUTMP_H_INCLUDED
8 #define SYSUTMP_H_INCLUDED
9
10 #ifdef HAVE_UTMP_H
11
12 /* UTMP stuff. Uses utmpx on svr4 */
13 #ifdef __svr4__
14 #  include <utmpx.h>
15 #  include <sys/fcntl.h>
16 #  define utmp utmpx
17 #  define UT_NAMESIZE   32
18 #  define UT_LINESIZE   32
19 #  define UT_HOSTSIZE   257
20 #else
21 #  include <utmp.h>
22 #endif
23 #ifdef __osf__
24 #  define UT_NAMESIZE   32
25 #  define UT_LINESIZE   32
26 #  define UT_HOSTSIZE   64
27 #endif
28 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(bsdi)
29 #  ifndef UTMP_FILE
30 #    define UTMP_FILE "/var/run/utmp"
31 #  endif
32 #  define ut_user ut_name
33 #endif
34
35 #else /* HAVE_UTMP_H */
36
37 /*
38  *      No <utmp.h> file - define stuff ourselves (minimally).
39  */
40 #define UT_LINESIZE            16
41 #define UT_NAMESIZE            16
42 #define UT_HOSTSIZE            16
43
44 #define USER_PROCESS    7
45 #define DEAD_PROCESS    8
46
47 struct utmp {
48         short   ut_type;
49         int     ut_pid;
50         char    ut_line[UT_LINESIZE];
51         char    ut_id[4];
52         long    ut_time;
53         char    ut_user[UT_NAMESIZE];
54         char    ut_host[UT_HOSTSIZE];
55         long    ut_addr;
56 };
57
58 #endif /* HAVE_UTMP_H */
59
60 #endif /* SYSUTMP_H_INCLUDED */