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 * Definitions for IP type of service (ip_tos)
48 #include <netinet/in_systm.h>
49 #include <netinet/ip.h>
50 #ifndef IPTOS_LOWDELAY
51 # define IPTOS_LOWDELAY 0x10
52 # define IPTOS_THROUGHPUT 0x08
53 # define IPTOS_RELIABILITY 0x04
54 # define IPTOS_LOWCOST 0x02
55 # define IPTOS_MINCOST IPTOS_LOWCOST
56 #endif /* IPTOS_LOWDELAY */
59 * Definitions for DiffServ Codepoints as per RFC2474
61 #ifndef IPTOS_DSCP_AF11
62 # define IPTOS_DSCP_AF11 0x28
63 # define IPTOS_DSCP_AF12 0x30
64 # define IPTOS_DSCP_AF13 0x38
65 # define IPTOS_DSCP_AF21 0x48
66 # define IPTOS_DSCP_AF22 0x50
67 # define IPTOS_DSCP_AF23 0x58
68 # define IPTOS_DSCP_AF31 0x68
69 # define IPTOS_DSCP_AF32 0x70
70 # define IPTOS_DSCP_AF33 0x78
71 # define IPTOS_DSCP_AF41 0x88
72 # define IPTOS_DSCP_AF42 0x90
73 # define IPTOS_DSCP_AF43 0x98
74 # define IPTOS_DSCP_EF 0xb8
75 #endif /* IPTOS_DSCP_AF11 */
76 #ifndef IPTOS_DSCP_CS0
77 # define IPTOS_DSCP_CS0 0x00
78 # define IPTOS_DSCP_CS1 0x20
79 # define IPTOS_DSCP_CS2 0x40
80 # define IPTOS_DSCP_CS3 0x60
81 # define IPTOS_DSCP_CS4 0x80
82 # define IPTOS_DSCP_CS5 0xa0
83 # define IPTOS_DSCP_CS6 0xc0
84 # define IPTOS_DSCP_CS7 0xe0
85 #endif /* IPTOS_DSCP_CS0 */
87 # define IPTOS_DSCP_EF 0xb8
88 #endif /* IPTOS_DSCP_EF */
91 # ifdef _POSIX_PATH_MAX
92 # define PATH_MAX _POSIX_PATH_MAX
98 # define MAXPATHLEN PATH_MAX
100 # define MAXPATHLEN 64
101 /* realpath uses a fixed buffer of size MAXPATHLEN, so force use of ours */
102 # ifndef BROKEN_REALPATH
103 # define BROKEN_REALPATH 1
104 # endif /* BROKEN_REALPATH */
105 # endif /* PATH_MAX */
106 #endif /* MAXPATHLEN */
108 #ifndef HOST_NAME_MAX
109 # include "netdb.h" /* for MAXHOSTNAMELEN */
110 # if defined(_POSIX_HOST_NAME_MAX)
111 # define HOST_NAME_MAX _POSIX_HOST_NAME_MAX
112 # elif defined(MAXHOSTNAMELEN)
113 # define HOST_NAME_MAX MAXHOSTNAMELEN
115 # define HOST_NAME_MAX 255
117 #endif /* HOST_NAME_MAX */
119 #if defined(HAVE_DECL_MAXSYMLINKS) && HAVE_DECL_MAXSYMLINKS == 0
120 # define MAXSYMLINKS 5
124 # define STDIN_FILENO 0
126 #ifndef STDOUT_FILENO
127 # define STDOUT_FILENO 1
129 #ifndef STDERR_FILENO
130 # define STDERR_FILENO 2
133 #ifndef NGROUPS_MAX /* Disable groupaccess if NGROUP_MAX is not set */
135 #define NGROUPS_MAX NGROUPS
137 #define NGROUPS_MAX 0
141 #if defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK == 0
142 # define O_NONBLOCK 00004 /* Non Blocking Open */
147 #endif /* S_IFSOCK */
150 # define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
154 # define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG))
158 # define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
162 # define S_IXUSR 0000100 /* execute/search permission, */
163 # define S_IXGRP 0000010 /* execute/search permission, */
164 # define S_IXOTH 0000001 /* execute/search permission, */
165 # define _S_IWUSR 0000200 /* write permission, */
166 # define S_IWUSR _S_IWUSR /* write permission, owner */
167 # define S_IWGRP 0000020 /* write permission, group */
168 # define S_IWOTH 0000002 /* write permission, other */
169 # define S_IRUSR 0000400 /* read permission, owner */
170 # define S_IRGRP 0000040 /* read permission, group */
171 # define S_IROTH 0000004 /* read permission, other */
172 # define S_IRWXU 0000700 /* read, write, execute */
173 # define S_IRWXG 0000070 /* read, write, execute */
174 # define S_IRWXO 0000007 /* read, write, execute */
177 #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
178 #define MAP_ANON MAP_ANONYMOUS
182 # define MAP_FAILED ((void *)-1)
186 SCO Open Server 3 has INADDR_LOOPBACK defined in rpc/rpc.h but
187 including rpc/rpc.h breaks Solaris 6
189 #ifndef INADDR_LOOPBACK
190 #define INADDR_LOOPBACK ((u_long)0x7f000001)
195 /* If sys/types.h does not supply intXX_t, supply them ourselves */
196 /* (or die trying) */
199 typedef unsigned int u_int;
203 typedef signed char int8_t;
204 # if (SIZEOF_SHORT_INT == 2)
205 typedef short int int16_t;
208 # if (SIZEOF_SHORT_INT == 4)
209 typedef short int16_t;
211 typedef long int16_t;
214 # error "16 bit int type not found."
215 # endif /* _UNICOS */
217 # if (SIZEOF_INT == 4)
221 typedef long int32_t;
223 # error "32 bit int type not found."
224 # endif /* _UNICOS */
228 /* If sys/types.h does not supply u_intXX_t, supply them ourselves */
229 #ifndef HAVE_U_INTXX_T
230 # ifdef HAVE_UINTXX_T
231 typedef uint8_t u_int8_t;
232 typedef uint16_t u_int16_t;
233 typedef uint32_t u_int32_t;
234 # define HAVE_U_INTXX_T 1
236 typedef unsigned char u_int8_t;
237 # if (SIZEOF_SHORT_INT == 2)
238 typedef unsigned short int u_int16_t;
241 # if (SIZEOF_SHORT_INT == 4)
242 typedef unsigned short u_int16_t;
244 typedef unsigned long u_int16_t;
247 # error "16 bit int type not found."
250 # if (SIZEOF_INT == 4)
251 typedef unsigned int u_int32_t;
254 typedef unsigned long u_int32_t;
256 # error "32 bit int type not found."
260 #define __BIT_TYPES_DEFINED__
265 # if (SIZEOF_LONG_INT == 8)
266 typedef long int int64_t;
268 # if (SIZEOF_LONG_LONG_INT == 8)
269 typedef long long int int64_t;
273 #ifndef HAVE_U_INT64_T
274 # if (SIZEOF_LONG_INT == 8)
275 typedef unsigned long int u_int64_t;
277 # if (SIZEOF_LONG_LONG_INT == 8)
278 typedef unsigned long long int u_int64_t;
283 #ifndef HAVE_UINTXX_T
284 typedef u_int8_t uint8_t;
285 typedef u_int16_t uint16_t;
286 typedef u_int32_t uint32_t;
287 typedef u_int64_t uint64_t;
290 #ifndef HAVE_INTMAX_T
291 typedef long long intmax_t;
294 #ifndef HAVE_UINTMAX_T
295 typedef unsigned long long uintmax_t;
299 typedef unsigned char u_char;
301 #endif /* HAVE_U_CHAR */
304 # define ULLONG_MAX ((unsigned long long)-1)
308 #define SIZE_T_MAX ULONG_MAX
309 #endif /* SIZE_T_MAX */
312 typedef unsigned int size_t;
314 # define SIZE_T_MAX UINT_MAX
315 #endif /* HAVE_SIZE_T */
318 #define SIZE_MAX SIZE_T_MAX
323 # define HAVE_SSIZE_T
324 #endif /* HAVE_SSIZE_T */
327 typedef long clock_t;
328 # define HAVE_CLOCK_T
329 #endif /* HAVE_CLOCK_T */
331 #ifndef HAVE_SA_FAMILY_T
332 typedef int sa_family_t;
333 # define HAVE_SA_FAMILY_T
334 #endif /* HAVE_SA_FAMILY_T */
339 #endif /* HAVE_PID_T */
341 #ifndef HAVE_SIG_ATOMIC_T
342 typedef int sig_atomic_t;
343 # define HAVE_SIG_ATOMIC_T
344 #endif /* HAVE_SIG_ATOMIC_T */
349 #endif /* HAVE_MODE_T */
351 #if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
352 # define ss_family __ss_family
353 #endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */
355 #ifndef HAVE_SYS_UN_H
357 short sun_family; /* AF_UNIX */
358 char sun_path[108]; /* path name (gag) */
360 #endif /* HAVE_SYS_UN_H */
362 #ifndef HAVE_IN_ADDR_T
363 typedef u_int32_t in_addr_t;
365 #ifndef HAVE_IN_PORT_T
366 typedef u_int16_t in_port_t;
369 #if defined(BROKEN_SYS_TERMIO_H) && !defined(_STRUCT_WINSIZE)
370 #define _STRUCT_WINSIZE
372 unsigned short ws_row; /* rows, in characters */
373 unsigned short ws_col; /* columns, in character */
374 unsigned short ws_xpixel; /* horizontal size, pixels */
375 unsigned short ws_ypixel; /* vertical size, pixels */
379 /* bits needed for select that may not be in the system headers */
381 typedef unsigned long int fd_mask;
384 #if defined(HAVE_DECL_NFDBITS) && HAVE_DECL_NFDBITS == 0
385 # define NFDBITS (8 * sizeof(unsigned long))
388 #if defined(HAVE_DECL_HOWMANY) && HAVE_DECL_HOWMANY == 0
389 # define howmany(x,y) (((x)+((y)-1))/(y))
395 # define _PATH_BSHELL "/bin/sh"
399 # ifdef _PATH_STDPATH
400 # undef _PATH_STDPATH
402 # define _PATH_STDPATH USER_PATH
405 #ifndef _PATH_STDPATH
406 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
409 #ifndef SUPERUSER_PATH
410 # define SUPERUSER_PATH _PATH_STDPATH
413 #ifndef _PATH_DEVNULL
414 # define _PATH_DEVNULL "/dev/null"
417 /* user may have set a different path */
418 #if defined(_PATH_MAILDIR) && defined(MAIL_DIRECTORY)
419 # undef _PATH_MAILDIR
420 #endif /* defined(_PATH_MAILDIR) && defined(MAIL_DIRECTORY) */
422 #ifdef MAIL_DIRECTORY
423 # define _PATH_MAILDIR MAIL_DIRECTORY
426 #ifndef _PATH_NOLOGIN
427 # define _PATH_NOLOGIN "/etc/nologin"
430 /* Define this to be the path of the xauth program. */
432 #define _PATH_XAUTH XAUTH_PATH
433 #endif /* XAUTH_PATH */
435 /* derived from XF4/xc/lib/dps/Xlibnet.h */
438 # define X_UNIX_PATH "/var/spool/sockets/X11/%u"
440 # define X_UNIX_PATH "/tmp/.X11-unix/X%u"
442 #endif /* X_UNIX_PATH */
443 #define _PATH_UNIX_X X_UNIX_PATH
446 # define _PATH_TTY "/dev/tty"
451 #if defined(HAVE_LOGIN_GETCAPBOOL) && defined(HAVE_LOGIN_CAP_H)
452 # define HAVE_LOGIN_CAP
456 # define MAX(a,b) (((a)>(b))?(a):(b))
457 # define MIN(a,b) (((a)<(b))?(a):(b))
461 # define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
465 #define timersub(a, b, result) \
467 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
468 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
469 if ((result)->tv_usec < 0) { \
470 --(result)->tv_sec; \
471 (result)->tv_usec += 1000000; \
476 #ifndef TIMEVAL_TO_TIMESPEC
477 #define TIMEVAL_TO_TIMESPEC(tv, ts) { \
478 (ts)->tv_sec = (tv)->tv_sec; \
479 (ts)->tv_nsec = (tv)->tv_usec * 1000; \
483 #ifndef TIMESPEC_TO_TIMEVAL
484 #define TIMESPEC_TO_TIMEVAL(tv, ts) { \
485 (tv)->tv_sec = (ts)->tv_sec; \
486 (tv)->tv_usec = (ts)->tv_nsec / 1000; \
494 #if !defined(IN6_IS_ADDR_V4MAPPED)
495 # define IN6_IS_ADDR_V4MAPPED(a) \
496 ((((u_int32_t *) (a))[0] == 0) && (((u_int32_t *) (a))[1] == 0) && \
497 (((u_int32_t *) (a))[2] == htonl (0xffff)))
498 #endif /* !defined(IN6_IS_ADDR_V4MAPPED) */
500 #if !defined(__GNUC__) || (__GNUC__ < 2)
501 # define __attribute__(x)
502 #endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
504 #if !defined(HAVE_ATTRIBUTE__SENTINEL__) && !defined(__sentinel__)
505 # define __sentinel__
508 #if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__bounded__)
509 # define __bounded__(x, y, z)
512 #if !defined(HAVE_ATTRIBUTE__NONNULL__) && !defined(__nonnull__)
513 # define __nonnull__(x)
516 #ifndef OSSH_ALIGNBYTES
517 #define OSSH_ALIGNBYTES (sizeof(int) - 1)
520 #define __CMSG_ALIGN(p) (((u_int)(p) + OSSH_ALIGNBYTES) &~ OSSH_ALIGNBYTES)
523 /* Length of the contents of a control message of length len */
525 #define CMSG_LEN(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
528 /* Length of the space taken up by a padded control message of length len */
530 #define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
533 /* given pointer to struct cmsghdr, return pointer to data */
535 #define CMSG_DATA(cmsg) ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
536 #endif /* CMSG_DATA */
539 * RFC 2292 requires to check msg_controllen, in case that the kernel returns
540 * an empty list for some reasons.
542 #ifndef CMSG_FIRSTHDR
543 #define CMSG_FIRSTHDR(mhdr) \
544 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
545 (struct cmsghdr *)(mhdr)->msg_control : \
546 (struct cmsghdr *)NULL)
547 #endif /* CMSG_FIRSTHDR */
549 #if defined(HAVE_DECL_OFFSETOF) && HAVE_DECL_OFFSETOF == 0
550 # define offsetof(type, member) ((size_t) &((type *)0)->member)
553 /* Set up BSD-style BYTE_ORDER definition if it isn't there already */
554 /* XXX: doesn't try to cope with strange byte orders (PDP_ENDIAN) */
556 # ifndef LITTLE_ENDIAN
557 # define LITTLE_ENDIAN 1234
558 # endif /* LITTLE_ENDIAN */
560 # define BIG_ENDIAN 4321
561 # endif /* BIG_ENDIAN */
562 # ifdef WORDS_BIGENDIAN
563 # define BYTE_ORDER BIG_ENDIAN
564 # else /* WORDS_BIGENDIAN */
565 # define BYTE_ORDER LITTLE_ENDIAN
566 # endif /* WORDS_BIGENDIAN */
567 #endif /* BYTE_ORDER */
569 /* Function replacement / compatibility hacks */
571 #if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))
572 # define HAVE_GETADDRINFO
575 #ifndef HAVE_GETOPT_OPTRESET
582 # define getopt(ac, av, o) BSDgetopt(ac, av, o)
583 # define opterr BSDopterr
584 # define optind BSDoptind
585 # define optopt BSDoptopt
586 # define optreset BSDoptreset
587 # define optarg BSDoptarg
590 #if defined(BROKEN_GETADDRINFO) && defined(HAVE_GETADDRINFO)
591 # undef HAVE_GETADDRINFO
593 #if defined(BROKEN_GETADDRINFO) && defined(HAVE_FREEADDRINFO)
594 # undef HAVE_FREEADDRINFO
596 #if defined(BROKEN_GETADDRINFO) && defined(HAVE_GAI_STRERROR)
597 # undef HAVE_GAI_STRERROR
600 #if defined(HAVE_GETADDRINFO)
601 # if defined(HAVE_DECL_AI_NUMERICSERV) && HAVE_DECL_AI_NUMERICSERV == 0
602 # define AI_NUMERICSERV 0
606 #if defined(BROKEN_UPDWTMPX) && defined(HAVE_UPDWTMPX)
607 # undef HAVE_UPDWTMPX
610 #if defined(BROKEN_SHADOW_EXPIRE) && defined(HAS_SHADOW_EXPIRE)
611 # undef HAS_SHADOW_EXPIRE
614 #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) && \
615 defined(SYSLOG_R_SAFE_IN_SIGHAND)
616 # define DO_LOG_SAFE_IN_SIGHAND
619 #if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY)
620 # define memmove(s1, s2, n) bcopy((s2), (s1), (n))
621 #endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */
625 # define getpgrp() getpgrp(0)
629 # define SSH_AUDIT_EVENTS
630 # define CUSTOM_SSH_AUDIT_EVENTS
633 #ifdef USE_LINUX_AUDIT
634 # define SSH_AUDIT_EVENTS
635 # define CUSTOM_SSH_AUDIT_EVENTS
638 #if !defined(HAVE___func__) && defined(HAVE___FUNCTION__)
639 # define __func__ __FUNCTION__
640 #elif !defined(HAVE___func__)
644 #if defined(KRB5) && !defined(HEIMDAL)
645 # define krb5_get_err_text(context,code) error_message(code)
648 #if defined(SKEYCHALLENGE_4ARG)
649 # define _compat_skeychallenge(a,b,c,d) skeychallenge(a,b,c,d)
651 # define _compat_skeychallenge(a,b,c,d) skeychallenge(a,b,c)
654 /* Maximum number of file descriptors available */
656 # define SSH_SYSFDMAX sysconf(_SC_OPEN_MAX)
658 # define SSH_SYSFDMAX 10000
662 /* encode f_fsid into a 64 bit value */
663 #define FSID_TO_ULONG(f) \
664 ((((u_int64_t)(f).val[0] & 0xffffffffUL) << 32) | \
665 ((f).val[1] & 0xffffffffUL))
666 #elif defined(FSID_HAS___VAL)
667 #define FSID_TO_ULONG(f) \
668 ((((u_int64_t)(f).__val[0] & 0xffffffffUL) << 32) | \
669 ((f).__val[1] & 0xffffffffUL))
671 # define FSID_TO_ULONG(f) ((f))
674 #if defined(__Lynx__)
676 * LynxOS defines these in param.h which we do not want to include since
677 * it will also pull in a bunch of kernel definitions.
679 # define ALIGNBYTES (sizeof(int) - 1)
680 # define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES)
681 /* Missing prototypes on LynxOS */
682 int snprintf (char *, size_t, const char *, ...);
683 int mkstemp (char *);
684 char *crypt (const char *, const char *);
687 char *mkdtemp (char *);
688 int rresvport_af (int *, sa_family_t);
689 int innetgr (const char *, const char *, const char *, const char *);
693 * Define this to use pipes instead of socketpairs for communicating with the
694 * client program. Socketpairs do not seem to work on all systems.
696 * configure.ac sets this for a few OS's which are known to have problems
697 * but you may need to set it yourself
699 /* #define USE_PIPES 1 */
702 ** login recorder definitions
705 /* FIXME: put default paths back in */
708 # define UTMP_FILE _PATH_UTMP
710 # ifdef CONF_UTMP_FILE
711 # define UTMP_FILE CONF_UTMP_FILE
717 # define WTMP_FILE _PATH_WTMP
719 # ifdef CONF_WTMP_FILE
720 # define WTMP_FILE CONF_WTMP_FILE
724 /* pick up the user's location for lastlog if given */
726 # ifdef _PATH_LASTLOG
727 # define LASTLOG_FILE _PATH_LASTLOG
729 # ifdef CONF_LASTLOG_FILE
730 # define LASTLOG_FILE CONF_LASTLOG_FILE
735 #if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
739 /* The login() library function in libutil is first choice */
740 #if defined(HAVE_LOGIN) && !defined(DISABLE_LOGIN)
744 /* Simply select your favourite login types. */
745 /* Can't do if-else because some systems use several... <sigh> */
746 # if !defined(DISABLE_UTMPX)
749 # if defined(UTMP_FILE) && !defined(DISABLE_UTMP)
752 # if defined(WTMPX_FILE) && !defined(DISABLE_WTMPX)
755 # if defined(WTMP_FILE) && !defined(DISABLE_WTMP)
762 # define UT_LINESIZE 8
765 /* I hope that the presence of LASTLOG_FILE is enough to detect this */
766 #if defined(LASTLOG_FILE) && !defined(DISABLE_LASTLOG)
774 # define CUSTOM_SYS_AUTH_PASSWD 1
777 #if defined(HAVE_LIBIAF) && defined(HAVE_SET_ID) && !defined(HAVE_SECUREWARE)
778 # define CUSTOM_SYS_AUTH_PASSWD 1
780 #if defined(HAVE_LIBIAF) && defined(HAVE_SET_ID) && !defined(BROKEN_LIBIAF)
786 # define _PATH_BTMP BTMP_FILE
789 #if defined(USE_BTMP) && defined(_PATH_BTMP)
790 # define CUSTOM_FAILED_LOGIN
793 /** end of login recorder definitions */
795 #ifdef BROKEN_GETGROUPS
796 # define getgroups(a,b) ((a)==0 && (b)==NULL ? NGROUPS_MAX : getgroups((a),(b)))
799 #if defined(HAVE_MMAP) && defined(BROKEN_MMAP)
804 # if defined(_XOPEN_IOV_MAX)
805 # define IOV_MAX _XOPEN_IOV_MAX
806 # elif defined(DEF_IOV_MAX)
807 # define IOV_MAX DEF_IOV_MAX
814 # define EWOULDBLOCK EAGAIN
817 #ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */
818 #define INET6_ADDRSTRLEN 46
822 # define SSH_IOBUFSZ 8192
826 * Platforms that have arc4random_uniform() and not arc4random_stir()
827 * shouldn't need the latter.
829 #if defined(HAVE_ARC4RANDOM) && defined(HAVE_ARC4RANDOM_UNIFORM) && \
830 !defined(HAVE_ARC4RANDOM_STIR)
831 # define arc4random_stir()
835 # ifdef HAVE___VA_COPY
836 # define va_copy(dest, src) __va_copy(dest, src)
838 # define va_copy(dest, src) (dest) = (src)
842 #ifndef __predict_true
843 # if defined(__GNUC__) && \
844 ((__GNUC__ > (2)) || (__GNUC__ == (2) && __GNUC_MINOR__ >= (96)))
845 # define __predict_true(exp) __builtin_expect(((exp) != 0), 1)
846 # define __predict_false(exp) __builtin_expect(((exp) != 0), 0)
848 # define __predict_true(exp) ((exp) != 0)
849 # define __predict_false(exp) ((exp) != 0)
850 # endif /* gcc version */
851 #endif /* __predict_true */
853 #if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) && \
854 defined(GLOB_HAS_GL_MATCHC) && defined(GLOB_HAS_GL_STATV) && \
855 defined(HAVE_DECL_GLOB_NOMATCH) && HAVE_DECL_GLOB_NOMATCH != 0 && \
856 !defined(BROKEN_GLOB)
857 # define USE_SYSTEM_GLOB
860 #endif /* _DEFINES_H */