2 * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
15 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
16 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
17 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
18 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
19 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
20 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
22 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 /* $Id: defines.h,v 1.183 2014/09/02 19:33:26 djm Exp $ */
33 #if defined(HAVE_DECL_SHUT_RD) && HAVE_DECL_SHUT_RD == 0
36 SHUT_RD
= 0, /* No more receptions. */
37 SHUT_WR
, /* No more transmissions. */
38 SHUT_RDWR
/* No more receptions or transmissions. */
40 # define SHUT_RD SHUT_RD
41 # define SHUT_WR SHUT_WR
42 # define SHUT_RDWR SHUT_RDWR
46 * Cygwin doesn't really have a notion of reserved ports. It is still
47 * is useful on the client side so for compatibility it defines as 1024 via
48 * netinet/in.h inside an enum. We * don't actually want that restriction
49 * so we want to set that to zero, but we can't do it direct in config.h
50 * because it'll cause a conflicting definition the first time we include
55 #define IPPORT_RESERVED 0
59 * Definitions for IP type of service (ip_tos)
61 #include <netinet/in_systm.h>
62 #include <netinet/ip.h>
63 #ifndef IPTOS_LOWDELAY
64 # define IPTOS_LOWDELAY 0x10
65 # define IPTOS_THROUGHPUT 0x08
66 # define IPTOS_RELIABILITY 0x04
67 # define IPTOS_LOWCOST 0x02
68 # define IPTOS_MINCOST IPTOS_LOWCOST
69 #endif /* IPTOS_LOWDELAY */
72 * Definitions for DiffServ Codepoints as per RFC2474
74 #ifndef IPTOS_DSCP_AF11
75 # define IPTOS_DSCP_AF11 0x28
76 # define IPTOS_DSCP_AF12 0x30
77 # define IPTOS_DSCP_AF13 0x38
78 # define IPTOS_DSCP_AF21 0x48
79 # define IPTOS_DSCP_AF22 0x50
80 # define IPTOS_DSCP_AF23 0x58
81 # define IPTOS_DSCP_AF31 0x68
82 # define IPTOS_DSCP_AF32 0x70
83 # define IPTOS_DSCP_AF33 0x78
84 # define IPTOS_DSCP_AF41 0x88
85 # define IPTOS_DSCP_AF42 0x90
86 # define IPTOS_DSCP_AF43 0x98
87 # define IPTOS_DSCP_EF 0xb8
88 #endif /* IPTOS_DSCP_AF11 */
89 #ifndef IPTOS_DSCP_CS0
90 # define IPTOS_DSCP_CS0 0x00
91 # define IPTOS_DSCP_CS1 0x20
92 # define IPTOS_DSCP_CS2 0x40
93 # define IPTOS_DSCP_CS3 0x60
94 # define IPTOS_DSCP_CS4 0x80
95 # define IPTOS_DSCP_CS5 0xa0
96 # define IPTOS_DSCP_CS6 0xc0
97 # define IPTOS_DSCP_CS7 0xe0
98 #endif /* IPTOS_DSCP_CS0 */
100 # define IPTOS_DSCP_EF 0xb8
101 #endif /* IPTOS_DSCP_EF */
104 # ifdef _POSIX_PATH_MAX
105 # define PATH_MAX _POSIX_PATH_MAX
111 # define MAXPATHLEN PATH_MAX
112 # else /* PATH_MAX */
113 # define MAXPATHLEN 64
114 /* realpath uses a fixed buffer of size MAXPATHLEN, so force use of ours */
115 # ifndef BROKEN_REALPATH
116 # define BROKEN_REALPATH 1
117 # endif /* BROKEN_REALPATH */
118 # endif /* PATH_MAX */
119 #endif /* MAXPATHLEN */
121 #ifndef HOST_NAME_MAX
122 # include "netdb.h" /* for MAXHOSTNAMELEN */
123 # if defined(_POSIX_HOST_NAME_MAX)
124 # define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
125 # elif defined(MAXHOSTNAMELEN)
126 # define HOST_NAME_MAX MAXHOSTNAMELEN
128 # define HOST_NAME_MAX 255
130 #endif /* HOST_NAME_MAX */
132 #if defined(HAVE_DECL_MAXSYMLINKS) && HAVE_DECL_MAXSYMLINKS == 0
133 # define MAXSYMLINKS 5
137 # define STDIN_FILENO 0
139 #ifndef STDOUT_FILENO
140 # define STDOUT_FILENO 1
142 #ifndef STDERR_FILENO
143 # define STDERR_FILENO 2
146 #ifndef NGROUPS_MAX /* Disable groupaccess if NGROUP_MAX is not set */
148 #define NGROUPS_MAX NGROUPS
150 #define NGROUPS_MAX 0
154 #if defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK == 0
155 # define O_NONBLOCK 00004 /* Non Blocking Open */
160 #endif /* S_IFSOCK */
163 # define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
167 # define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG))
171 # define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
175 # define S_IXUSR 0000100 /* execute/search permission, */
176 # define S_IXGRP 0000010 /* execute/search permission, */
177 # define S_IXOTH 0000001 /* execute/search permission, */
178 # define _S_IWUSR 0000200 /* write permission, */
179 # define S_IWUSR _S_IWUSR /* write permission, owner */
180 # define S_IWGRP 0000020 /* write permission, group */
181 # define S_IWOTH 0000002 /* write permission, other */
182 # define S_IRUSR 0000400 /* read permission, owner */
183 # define S_IRGRP 0000040 /* read permission, group */
184 # define S_IROTH 0000004 /* read permission, other */
185 # define S_IRWXU 0000700 /* read, write, execute */
186 # define S_IRWXG 0000070 /* read, write, execute */
187 # define S_IRWXO 0000007 /* read, write, execute */
190 #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
191 #define MAP_ANON MAP_ANONYMOUS
195 # define MAP_FAILED ((void *)-1)
199 SCO Open Server 3 has INADDR_LOOPBACK defined in rpc/rpc.h but
200 including rpc/rpc.h breaks Solaris 6
202 #ifndef INADDR_LOOPBACK
203 #define INADDR_LOOPBACK ((u_long)0x7f000001)
208 /* If sys/types.h does not supply intXX_t, supply them ourselves */
209 /* (or die trying) */
212 typedef unsigned int u_int
;
216 typedef signed char int8_t;
217 # if (SIZEOF_SHORT_INT == 2)
218 typedef short int int16_t;
221 # if (SIZEOF_SHORT_INT == 4)
222 typedef short int16_t;
224 typedef long int16_t;
227 # error "16 bit int type not found."
228 # endif /* _UNICOS */
230 # if (SIZEOF_INT == 4)
234 typedef long int32_t;
236 # error "32 bit int type not found."
237 # endif /* _UNICOS */
241 /* If sys/types.h does not supply u_intXX_t, supply them ourselves */
242 #ifndef HAVE_U_INTXX_T
243 # ifdef HAVE_UINTXX_T
244 typedef uint8_t u_int8_t
;
245 typedef uint16_t u_int16_t
;
246 typedef uint32_t u_int32_t
;
247 # define HAVE_U_INTXX_T 1
249 typedef unsigned char u_int8_t
;
250 # if (SIZEOF_SHORT_INT == 2)
251 typedef unsigned short int u_int16_t
;
254 # if (SIZEOF_SHORT_INT == 4)
255 typedef unsigned short u_int16_t
;
257 typedef unsigned long u_int16_t
;
260 # error "16 bit int type not found."
263 # if (SIZEOF_INT == 4)
264 typedef unsigned int u_int32_t
;
267 typedef unsigned long u_int32_t
;
269 # error "32 bit int type not found."
273 #define __BIT_TYPES_DEFINED__
278 # if (SIZEOF_LONG_INT == 8)
279 typedef long int int64_t;
281 # if (SIZEOF_LONG_LONG_INT == 8)
282 typedef long long int int64_t;
286 #ifndef HAVE_U_INT64_T
287 # if (SIZEOF_LONG_INT == 8)
288 typedef unsigned long int u_int64_t
;
290 # if (SIZEOF_LONG_LONG_INT == 8)
291 typedef unsigned long long int u_int64_t
;
296 #ifndef HAVE_UINTXX_T
297 typedef u_int8_t
uint8_t;
298 typedef u_int16_t
uint16_t;
299 typedef u_int32_t
uint32_t;
300 typedef u_int64_t
uint64_t;
303 #ifndef HAVE_INTMAX_T
304 typedef long long intmax_t;
307 #ifndef HAVE_UINTMAX_T
308 typedef unsigned long long uintmax_t;
312 typedef unsigned char u_char
;
314 #endif /* HAVE_U_CHAR */
317 # define ULLONG_MAX ((unsigned long long)-1)
321 #define SIZE_T_MAX ULONG_MAX
322 #endif /* SIZE_T_MAX */
325 typedef unsigned int size_t;
327 # define SIZE_T_MAX UINT_MAX
328 #endif /* HAVE_SIZE_T */
331 #define SIZE_MAX SIZE_T_MAX
336 # define HAVE_SSIZE_T
337 #endif /* HAVE_SSIZE_T */
340 typedef long clock_t;
341 # define HAVE_CLOCK_T
342 #endif /* HAVE_CLOCK_T */
344 #ifndef HAVE_SA_FAMILY_T
345 typedef int sa_family_t
;
346 # define HAVE_SA_FAMILY_T
347 #endif /* HAVE_SA_FAMILY_T */
352 #endif /* HAVE_PID_T */
354 #ifndef HAVE_SIG_ATOMIC_T
355 typedef int sig_atomic_t;
356 # define HAVE_SIG_ATOMIC_T
357 #endif /* HAVE_SIG_ATOMIC_T */
362 #endif /* HAVE_MODE_T */
364 #if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
365 # define ss_family __ss_family
366 #endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */
368 #ifndef HAVE_SYS_UN_H
370 short sun_family
; /* AF_UNIX */
371 char sun_path
[108]; /* path name (gag) */
373 #endif /* HAVE_SYS_UN_H */
375 #ifndef HAVE_IN_ADDR_T
376 typedef u_int32_t in_addr_t
;
378 #ifndef HAVE_IN_PORT_T
379 typedef u_int16_t in_port_t
;
382 #if defined(BROKEN_SYS_TERMIO_H) && !defined(_STRUCT_WINSIZE)
383 #define _STRUCT_WINSIZE
385 unsigned short ws_row
; /* rows, in characters */
386 unsigned short ws_col
; /* columns, in character */
387 unsigned short ws_xpixel
; /* horizontal size, pixels */
388 unsigned short ws_ypixel
; /* vertical size, pixels */
392 /* bits needed for select that may not be in the system headers */
394 typedef unsigned long int fd_mask
;
397 #if defined(HAVE_DECL_NFDBITS) && HAVE_DECL_NFDBITS == 0
398 # define NFDBITS (8 * sizeof(unsigned long))
401 #if defined(HAVE_DECL_HOWMANY) && HAVE_DECL_HOWMANY == 0
402 # define howmany(x,y) (((x)+((y)-1))/(y))
408 # define _PATH_BSHELL "/bin/sh"
412 # ifdef _PATH_STDPATH
413 # undef _PATH_STDPATH
415 # define _PATH_STDPATH USER_PATH
418 #ifndef _PATH_STDPATH
419 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
422 #ifndef SUPERUSER_PATH
423 # define SUPERUSER_PATH _PATH_STDPATH
426 #ifndef _PATH_DEVNULL
427 # define _PATH_DEVNULL "/dev/null"
430 /* user may have set a different path */
431 #if defined(_PATH_MAILDIR) && defined(MAIL_DIRECTORY)
432 # undef _PATH_MAILDIR
433 #endif /* defined(_PATH_MAILDIR) && defined(MAIL_DIRECTORY) */
435 #ifdef MAIL_DIRECTORY
436 # define _PATH_MAILDIR MAIL_DIRECTORY
439 #ifndef _PATH_NOLOGIN
440 # define _PATH_NOLOGIN "/etc/nologin"
443 /* Define this to be the path of the xauth program. */
445 #define _PATH_XAUTH XAUTH_PATH
446 #endif /* XAUTH_PATH */
448 /* derived from XF4/xc/lib/dps/Xlibnet.h */
451 # define X_UNIX_PATH "/var/spool/sockets/X11/%u"
453 # define X_UNIX_PATH "/tmp/.X11-unix/X%u"
455 #endif /* X_UNIX_PATH */
456 #define _PATH_UNIX_X X_UNIX_PATH
459 # define _PATH_TTY "/dev/tty"
464 #if defined(HAVE_LOGIN_GETCAPBOOL) && defined(HAVE_LOGIN_CAP_H)
465 # define HAVE_LOGIN_CAP
469 # define MAX(a,b) (((a)>(b))?(a):(b))
470 # define MIN(a,b) (((a)<(b))?(a):(b))
474 # define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
478 #define timersub(a, b, result) \
480 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
481 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
482 if ((result)->tv_usec < 0) { \
483 --(result)->tv_sec; \
484 (result)->tv_usec += 1000000; \
489 #ifndef TIMEVAL_TO_TIMESPEC
490 #define TIMEVAL_TO_TIMESPEC(tv, ts) { \
491 (ts)->tv_sec = (tv)->tv_sec; \
492 (ts)->tv_nsec = (tv)->tv_usec * 1000; \
496 #ifndef TIMESPEC_TO_TIMEVAL
497 #define TIMESPEC_TO_TIMEVAL(tv, ts) { \
498 (tv)->tv_sec = (ts)->tv_sec; \
499 (tv)->tv_usec = (ts)->tv_nsec / 1000; \
507 #if !defined(IN6_IS_ADDR_V4MAPPED)
508 # define IN6_IS_ADDR_V4MAPPED(a) \
509 ((((u_int32_t *) (a))[0] == 0) && (((u_int32_t *) (a))[1] == 0) && \
510 (((u_int32_t *) (a))[2] == htonl (0xffff)))
511 #endif /* !defined(IN6_IS_ADDR_V4MAPPED) */
513 #if !defined(__GNUC__) || (__GNUC__ < 2)
514 # define __attribute__(x)
515 #endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
517 #if !defined(HAVE_ATTRIBUTE__SENTINEL__) && !defined(__sentinel__)
518 # define __sentinel__
521 #if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__bounded__)
522 # define __bounded__(x, y, z)
525 #if !defined(HAVE_ATTRIBUTE__NONNULL__) && !defined(__nonnull__)
526 # define __nonnull__(x)
529 #ifndef OSSH_ALIGNBYTES
530 #define OSSH_ALIGNBYTES (sizeof(int) - 1)
533 #define __CMSG_ALIGN(p) (((u_int)(p) + OSSH_ALIGNBYTES) &~ OSSH_ALIGNBYTES)
536 /* Length of the contents of a control message of length len */
538 #define CMSG_LEN(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
541 /* Length of the space taken up by a padded control message of length len */
543 #define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
546 /* given pointer to struct cmsghdr, return pointer to data */
548 #define CMSG_DATA(cmsg) ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
549 #endif /* CMSG_DATA */
552 * RFC 2292 requires to check msg_controllen, in case that the kernel returns
553 * an empty list for some reasons.
555 #ifndef CMSG_FIRSTHDR
556 #define CMSG_FIRSTHDR(mhdr) \
557 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
558 (struct cmsghdr *)(mhdr)->msg_control : \
559 (struct cmsghdr *)NULL)
560 #endif /* CMSG_FIRSTHDR */
562 #if defined(HAVE_DECL_OFFSETOF) && HAVE_DECL_OFFSETOF == 0
563 # define offsetof(type, member) ((size_t) &((type *)0)->member)
566 /* Set up BSD-style BYTE_ORDER definition if it isn't there already */
567 /* XXX: doesn't try to cope with strange byte orders (PDP_ENDIAN) */
569 # ifndef LITTLE_ENDIAN
570 # define LITTLE_ENDIAN 1234
571 # endif /* LITTLE_ENDIAN */
573 # define BIG_ENDIAN 4321
574 # endif /* BIG_ENDIAN */
575 # ifdef WORDS_BIGENDIAN
576 # define BYTE_ORDER BIG_ENDIAN
577 # else /* WORDS_BIGENDIAN */
578 # define BYTE_ORDER LITTLE_ENDIAN
579 # endif /* WORDS_BIGENDIAN */
580 #endif /* BYTE_ORDER */
582 /* Function replacement / compatibility hacks */
584 #if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))
585 # define HAVE_GETADDRINFO
588 #ifndef HAVE_GETOPT_OPTRESET
595 # define getopt(ac, av, o) BSDgetopt(ac, av, o)
596 # define opterr BSDopterr
597 # define optind BSDoptind
598 # define optopt BSDoptopt
599 # define optreset BSDoptreset
600 # define optarg BSDoptarg
603 #if defined(BROKEN_GETADDRINFO) && defined(HAVE_GETADDRINFO)
604 # undef HAVE_GETADDRINFO
606 #if defined(BROKEN_GETADDRINFO) && defined(HAVE_FREEADDRINFO)
607 # undef HAVE_FREEADDRINFO
609 #if defined(BROKEN_GETADDRINFO) && defined(HAVE_GAI_STRERROR)
610 # undef HAVE_GAI_STRERROR
613 #if defined(HAVE_GETADDRINFO)
614 # if defined(HAVE_DECL_AI_NUMERICSERV) && HAVE_DECL_AI_NUMERICSERV == 0
615 # define AI_NUMERICSERV 0
619 #if defined(BROKEN_UPDWTMPX) && defined(HAVE_UPDWTMPX)
620 # undef HAVE_UPDWTMPX
623 #if defined(BROKEN_SHADOW_EXPIRE) && defined(HAS_SHADOW_EXPIRE)
624 # undef HAS_SHADOW_EXPIRE
627 #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) && \
628 defined(SYSLOG_R_SAFE_IN_SIGHAND)
629 # define DO_LOG_SAFE_IN_SIGHAND
632 #if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY)
633 # define memmove(s1, s2, n) bcopy((s2), (s1), (n))
634 #endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */
638 # define getpgrp() getpgrp(0)
642 # define SSH_AUDIT_EVENTS
643 # define CUSTOM_SSH_AUDIT_EVENTS
646 #ifdef USE_LINUX_AUDIT
647 # define SSH_AUDIT_EVENTS
648 # define CUSTOM_SSH_AUDIT_EVENTS
651 #if !defined(HAVE___func__) && defined(HAVE___FUNCTION__)
652 # define __func__ __FUNCTION__
653 #elif !defined(HAVE___func__)
657 #if defined(KRB5) && !defined(HEIMDAL)
658 # define krb5_get_err_text(context,code) error_message(code)
661 #if defined(SKEYCHALLENGE_4ARG)
662 # define _compat_skeychallenge(a,b,c,d) skeychallenge(a,b,c,d)
664 # define _compat_skeychallenge(a,b,c,d) skeychallenge(a,b,c)
667 /* Maximum number of file descriptors available */
669 # define SSH_SYSFDMAX sysconf(_SC_OPEN_MAX)
671 # define SSH_SYSFDMAX 10000
675 /* encode f_fsid into a 64 bit value */
676 #define FSID_TO_ULONG(f) \
677 ((((u_int64_t)(f).val[0] & 0xffffffffUL) << 32) | \
678 ((f).val[1] & 0xffffffffUL))
679 #elif defined(FSID_HAS___VAL)
680 #define FSID_TO_ULONG(f) \
681 ((((u_int64_t)(f).__val[0] & 0xffffffffUL) << 32) | \
682 ((f).__val[1] & 0xffffffffUL))
684 # define FSID_TO_ULONG(f) ((f))
687 #if defined(__Lynx__)
689 * LynxOS defines these in param.h which we do not want to include since
690 * it will also pull in a bunch of kernel definitions.
692 # define ALIGNBYTES (sizeof(int) - 1)
693 # define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES)
694 /* Missing prototypes on LynxOS */
695 int snprintf (char *, size_t, const char *, ...);
696 int mkstemp (char *);
697 char *crypt (const char *, const char *);
700 char *mkdtemp (char *);
701 int rresvport_af (int *, sa_family_t
);
702 int innetgr (const char *, const char *, const char *, const char *);
706 * Define this to use pipes instead of socketpairs for communicating with the
707 * client program. Socketpairs do not seem to work on all systems.
709 * configure.ac sets this for a few OS's which are known to have problems
710 * but you may need to set it yourself
712 /* #define USE_PIPES 1 */
715 ** login recorder definitions
718 /* FIXME: put default paths back in */
721 # define UTMP_FILE _PATH_UTMP
723 # ifdef CONF_UTMP_FILE
724 # define UTMP_FILE CONF_UTMP_FILE
730 # define WTMP_FILE _PATH_WTMP
732 # ifdef CONF_WTMP_FILE
733 # define WTMP_FILE CONF_WTMP_FILE
737 /* pick up the user's location for lastlog if given */
739 # ifdef _PATH_LASTLOG
740 # define LASTLOG_FILE _PATH_LASTLOG
742 # ifdef CONF_LASTLOG_FILE
743 # define LASTLOG_FILE CONF_LASTLOG_FILE
748 #if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
752 /* The login() library function in libutil is first choice */
753 #if defined(HAVE_LOGIN) && !defined(DISABLE_LOGIN)
757 /* Simply select your favourite login types. */
758 /* Can't do if-else because some systems use several... <sigh> */
759 # if !defined(DISABLE_UTMPX)
762 # if defined(UTMP_FILE) && !defined(DISABLE_UTMP)
765 # if defined(WTMPX_FILE) && !defined(DISABLE_WTMPX)
768 # if defined(WTMP_FILE) && !defined(DISABLE_WTMP)
775 # define UT_LINESIZE 8
778 /* I hope that the presence of LASTLOG_FILE is enough to detect this */
779 #if defined(LASTLOG_FILE) && !defined(DISABLE_LASTLOG)
787 # define CUSTOM_SYS_AUTH_PASSWD 1
790 #if defined(HAVE_LIBIAF) && defined(HAVE_SET_ID) && !defined(HAVE_SECUREWARE)
791 # define CUSTOM_SYS_AUTH_PASSWD 1
793 #if defined(HAVE_LIBIAF) && defined(HAVE_SET_ID) && !defined(BROKEN_LIBIAF)
799 # define _PATH_BTMP BTMP_FILE
802 #if defined(USE_BTMP) && defined(_PATH_BTMP)
803 # define CUSTOM_FAILED_LOGIN
806 /** end of login recorder definitions */
808 #ifdef BROKEN_GETGROUPS
809 # define getgroups(a,b) ((a)==0 && (b)==NULL ? NGROUPS_MAX : getgroups((a),(b)))
812 #if defined(HAVE_MMAP) && defined(BROKEN_MMAP)
817 # if defined(_XOPEN_IOV_MAX)
818 # define IOV_MAX _XOPEN_IOV_MAX
819 # elif defined(DEF_IOV_MAX)
820 # define IOV_MAX DEF_IOV_MAX
827 # define EWOULDBLOCK EAGAIN
830 #ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */
831 #define INET6_ADDRSTRLEN 46
835 # define SSH_IOBUFSZ 8192
839 * Platforms that have arc4random_uniform() and not arc4random_stir()
840 * shouldn't need the latter.
842 #if defined(HAVE_ARC4RANDOM) && defined(HAVE_ARC4RANDOM_UNIFORM) && \
843 !defined(HAVE_ARC4RANDOM_STIR)
844 # define arc4random_stir()
848 # ifdef HAVE___VA_COPY
849 # define va_copy(dest, src) __va_copy(dest, src)
851 # define va_copy(dest, src) (dest) = (src)
855 #ifndef __predict_true
856 # if defined(__GNUC__) && \
857 ((__GNUC__ > (2)) || (__GNUC__ == (2) && __GNUC_MINOR__ >= (96)))
858 # define __predict_true(exp) __builtin_expect(((exp) != 0), 1)
859 # define __predict_false(exp) __builtin_expect(((exp) != 0), 0)
861 # define __predict_true(exp) ((exp) != 0)
862 # define __predict_false(exp) ((exp) != 0)
863 # endif /* gcc version */
864 #endif /* __predict_true */
866 #if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) && \
867 defined(GLOB_HAS_GL_MATCHC) && defined(GLOB_HAS_GL_STATV) && \
868 defined(HAVE_DECL_GLOB_NOMATCH) && HAVE_DECL_GLOB_NOMATCH != 0 && \
869 !defined(BROKEN_GLOB)
870 # define USE_SYSTEM_GLOB
873 #endif /* _DEFINES_H */