1 #include <sys/types.h> /* For u_intXX_t */
2 #include <sys/socket.h> /* For SHUT_XXXX */
5 # include <paths.h> /* For _PATH_XXX */
9 # include <utmp.h> /* For _PATH_XXX */
12 #if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
13 # include <utmpx.h> /* For _PATH_XXX */
16 #ifdef HAVE_SYS_TIME_H
17 # include <sys/time.h> /* For timersub */
20 #ifdef HAVE_MAILLOCK_H
27 SHUT_RD = 0, /* No more receptions. */
28 SHUT_WR, /* No more transmissions. */
29 SHUT_RDWR /* No more receptions or transmissions. */
31 # define SHUT_RD SHUT_RD
32 # define SHUT_WR SHUT_WR
33 # define SHUT_RDWR SHUT_RDWR
36 /* If sys/types.h does not supply intXX_t, supply them ourselves */
39 # if (SIZEOF_SHORT_INT == 2)
40 # define int16_t short int
42 # error "16 bit int type not found."
44 # if (SIZEOF_INT == 4)
47 # error "32 bit int type not found."
49 # if (SIZEOF_LONG_INT == 8)
50 # define int64_t long int
52 # if (SIZEOF_LONG_LONG_INT == 8)
53 # define int64_t long long int
55 # error "64 bit int type not found."
60 /* If sys/types.h does not supply u_intXX_t, supply them ourselves */
61 #ifndef HAVE_U_INTXX_T
63 # define u_int16_t uint16_t
64 # define u_int32_t uint32_t
65 # define u_int64_t uint64_t
67 # if (SIZEOF_SHORT_INT == 2)
68 # define u_int16_t unsigned short int
70 # error "16 bit int type not found."
72 # if (SIZEOF_INT == 4)
73 # define u_int32_t unsigned int
75 # error "32 bit int type not found."
77 # if (SIZEOF_LONG_INT == 8)
78 # define u_int64_t unsigned long int
80 # if (SIZEOF_LONG_LONG_INT == 8)
81 # define u_int64_t unsigned long long int
83 # error "64 bit int type not found."
89 /* If quad_t is not supplied, then supply it now. We can rely on int64_t */
90 /* being defined by the above */
92 # define quad_t int64_t
95 /* If _PATH_LASTLOG is not defined by system headers, set it to the */
96 /* lastlog file detected by autoconf */
98 # ifdef LASTLOG_LOCATION
99 # define _PATH_LASTLOG LASTLOG_LOCATION
105 # define _PATH_UTMP UTMP_FILE
107 # define _PATH_UTMP "/var/adm/utmp"
113 # define _PATH_WTMP WTMP_FILE
115 # define _PATH_WTMP "/var/adm/wtmp"
119 #if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
122 # define _PATH_UTMPX UTMPX_FILE
124 # define _PATH_UTMPX "/var/adm/utmpx"
129 # define _PATH_WTMPX WTMPX_FILE
131 # define _PATH_WTMPX "/var/adm/wtmp"
137 # define _PATH_BSHELL "/bin/sh"
141 # ifdef _PATH_STDPATH
142 # undef _PATH_STDPATH
144 # define _PATH_STDPATH USER_PATH
147 #ifndef _PATH_STDPATH
148 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
151 #ifndef _PATH_DEVNULL
152 # define _PATH_DEVNULL "/dev/null"
156 # define MAILDIR MAIL_DIRECTORY
159 #if !defined(_PATH_MAILDIR) && defined(MAILDIR)
160 # define _PATH_MAILDIR MAILDIR
161 #endif /* !defined(_PATH_MAILDIR) && defined(MAILDIR) */
164 # define MAX(a,b) (((a)>(b))?(a):(b))
165 # define MIN(a,b) (((a)<(b))?(a):(b))
169 #define timersub(a, b, result) \
171 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
172 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
173 if ((result)->tv_usec < 0) { \
174 --(result)->tv_sec; \
175 (result)->tv_usec += 1000000; \
180 /* In older versions of libpam, pam_strerror takes a single argument */
182 # define PAM_STRERROR(a,b) pam_strerror((b))
184 # define PAM_STRERROR(a,b) pam_strerror((a),(b))
191 #if !defined(__GNUC__) || (__GNUC__ < 2)
192 # define __attribute__(x)
193 #endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
195 #if !defined(HAVE_SETEUID) && defined(HAVE_SETREUID)
196 # define seteuid(a) setreuid(-1,a)
197 #endif /* !defined(HAVE_SETEUID) && defined(HAVE_SETREUID) */
200 # define innetgr(a,b,c,d) (0)
201 #endif /* HAVE_INNETGR */
205 # define _PATH_RSH RSH_PATH
206 # endif /* RSH_PATH */
207 #endif /* _PATH_RSH */