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.164 2011/01/17 10:15:31 dtucker 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 #ifndef IPTOS_LOWDELAY
49 # define IPTOS_LOWDELAY 0x10
50 # define IPTOS_THROUGHPUT 0x08
51 # define IPTOS_RELIABILITY 0x04
52 # define IPTOS_LOWCOST 0x02
53 # define IPTOS_MINCOST IPTOS_LOWCOST
54 #endif /* IPTOS_LOWDELAY */
57 * Definitions for DiffServ Codepoints as per RFC2474
59 #ifndef IPTOS_DSCP_AF11
60 # define IPTOS_DSCP_AF11 0x28
61 # define IPTOS_DSCP_AF12 0x30
62 # define IPTOS_DSCP_AF13 0x38
63 # define IPTOS_DSCP_AF21 0x48
64 # define IPTOS_DSCP_AF22 0x50
65 # define IPTOS_DSCP_AF23 0x58
66 # define IPTOS_DSCP_AF31 0x68
67 # define IPTOS_DSCP_AF32 0x70
68 # define IPTOS_DSCP_AF33 0x78
69 # define IPTOS_DSCP_AF41 0x88
70 # define IPTOS_DSCP_AF42 0x90
71 # define IPTOS_DSCP_AF43 0x98
72 # define IPTOS_DSCP_EF 0xb8
73 #endif /* IPTOS_DSCP_AF11 */
74 #ifndef IPTOS_DSCP_CS0
75 # define IPTOS_DSCP_CS0 0x00
76 # define IPTOS_DSCP_CS1 0x20
77 # define IPTOS_DSCP_CS2 0x40
78 # define IPTOS_DSCP_CS3 0x60
79 # define IPTOS_DSCP_CS4 0x80
80 # define IPTOS_DSCP_CS5 0xa0
81 # define IPTOS_DSCP_CS6 0xc0
82 # define IPTOS_DSCP_CS7 0xe0
83 #endif /* IPTOS_DSCP_CS0 */
85 # define IPTOS_DSCP_EF 0xb8
86 #endif /* IPTOS_DSCP_EF */
90 # define MAXPATHLEN PATH_MAX
92 # define MAXPATHLEN 64
93 /* realpath uses a fixed buffer of size MAXPATHLEN, so force use of ours */
94 # ifndef BROKEN_REALPATH
95 # define BROKEN_REALPATH 1
96 # endif /* BROKEN_REALPATH */
97 # endif /* PATH_MAX */
98 #endif /* MAXPATHLEN */
101 # ifdef _POSIX_PATH_MAX
102 # define PATH_MAX _POSIX_PATH_MAX
106 #if defined(HAVE_DECL_MAXSYMLINKS) && HAVE_DECL_MAXSYMLINKS == 0
107 # define MAXSYMLINKS 5
111 # define STDIN_FILENO 0
113 #ifndef STDOUT_FILENO
114 # define STDOUT_FILENO 1
116 #ifndef STDERR_FILENO
117 # define STDERR_FILENO 2
120 #ifndef NGROUPS_MAX /* Disable groupaccess if NGROUP_MAX is not set */
122 #define NGROUPS_MAX NGROUPS
124 #define NGROUPS_MAX 0
128 #if defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK == 0
129 # define O_NONBLOCK 00004 /* Non Blocking Open */
133 # define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
137 # define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG))
141 # define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
145 # define S_IXUSR 0000100 /* execute/search permission, */
146 # define S_IXGRP 0000010 /* execute/search permission, */
147 # define S_IXOTH 0000001 /* execute/search permission, */
148 # define _S_IWUSR 0000200 /* write permission, */
149 # define S_IWUSR _S_IWUSR /* write permission, owner */
150 # define S_IWGRP 0000020 /* write permission, group */
151 # define S_IWOTH 0000002 /* write permission, other */
152 # define S_IRUSR 0000400 /* read permission, owner */
153 # define S_IRGRP 0000040 /* read permission, group */
154 # define S_IROTH 0000004 /* read permission, other */
155 # define S_IRWXU 0000700 /* read, write, execute */
156 # define S_IRWXG 0000070 /* read, write, execute */
157 # define S_IRWXO 0000007 /* read, write, execute */
160 #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
161 #define MAP_ANON MAP_ANONYMOUS
165 # define MAP_FAILED ((void *)-1)
168 /* *-*-nto-qnx doesn't define this constant in the system headers */
169 #ifdef MISSING_NFDBITS
170 # define NFDBITS (8 * sizeof(unsigned long))
174 SCO Open Server 3 has INADDR_LOOPBACK defined in rpc/rpc.h but
175 including rpc/rpc.h breaks Solaris 6
177 #ifndef INADDR_LOOPBACK
178 #define INADDR_LOOPBACK ((u_long)0x7f000001)
183 /* If sys/types.h does not supply intXX_t, supply them ourselves */
184 /* (or die trying) */
187 typedef unsigned int u_int;
191 # if (SIZEOF_CHAR == 1)
194 # error "8 bit int type not found."
196 # if (SIZEOF_SHORT_INT == 2)
197 typedef short int int16_t;
200 # if (SIZEOF_SHORT_INT == 4)
201 typedef short int16_t;
203 typedef long int16_t;
206 # error "16 bit int type not found."
207 # endif /* _UNICOS */
209 # if (SIZEOF_INT == 4)
213 typedef long int32_t;
215 # error "32 bit int type not found."
216 # endif /* _UNICOS */
220 /* If sys/types.h does not supply u_intXX_t, supply them ourselves */
221 #ifndef HAVE_U_INTXX_T
222 # ifdef HAVE_UINTXX_T
223 typedef uint8_t u_int8_t;
224 typedef uint16_t u_int16_t;
225 typedef uint32_t u_int32_t;
226 # define HAVE_U_INTXX_T 1
228 # if (SIZEOF_CHAR == 1)
229 typedef unsigned char u_int8_t;
231 # error "8 bit int type not found."
233 # if (SIZEOF_SHORT_INT == 2)
234 typedef unsigned short int u_int16_t;
237 # if (SIZEOF_SHORT_INT == 4)
238 typedef unsigned short u_int16_t;
240 typedef unsigned long u_int16_t;
243 # error "16 bit int type not found."
246 # if (SIZEOF_INT == 4)
247 typedef unsigned int u_int32_t;
250 typedef unsigned long u_int32_t;
252 # error "32 bit int type not found."
256 #define __BIT_TYPES_DEFINED__
261 # if (SIZEOF_LONG_INT == 8)
262 typedef long int int64_t;
264 # if (SIZEOF_LONG_LONG_INT == 8)
265 typedef long long int int64_t;
269 #ifndef HAVE_U_INT64_T
270 # if (SIZEOF_LONG_INT == 8)
271 typedef unsigned long int u_int64_t;
273 # if (SIZEOF_LONG_LONG_INT == 8)
274 typedef unsigned long long int u_int64_t;
280 typedef unsigned char u_char;
282 #endif /* HAVE_U_CHAR */
285 #define SIZE_T_MAX ULONG_MAX
286 #endif /* SIZE_T_MAX */
289 typedef unsigned int size_t;
291 # define SIZE_T_MAX UINT_MAX
292 #endif /* HAVE_SIZE_T */
295 #define SIZE_MAX SIZE_T_MAX
300 # define HAVE_SSIZE_T
301 #endif /* HAVE_SSIZE_T */
304 typedef long clock_t;
305 # define HAVE_CLOCK_T
306 #endif /* HAVE_CLOCK_T */
308 #ifndef HAVE_SA_FAMILY_T
309 typedef int sa_family_t;
310 # define HAVE_SA_FAMILY_T
311 #endif /* HAVE_SA_FAMILY_T */
316 #endif /* HAVE_PID_T */
318 #ifndef HAVE_SIG_ATOMIC_T
319 typedef int sig_atomic_t;
320 # define HAVE_SIG_ATOMIC_T
321 #endif /* HAVE_SIG_ATOMIC_T */
326 #endif /* HAVE_MODE_T */
328 #if !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE___SS_FAMILY_IN_SS)
329 # define ss_family __ss_family
330 #endif /* !defined(HAVE_SS_FAMILY_IN_SS) && defined(HAVE_SA_FAMILY_IN_SS) */
332 #ifndef HAVE_SYS_UN_H
334 short sun_family; /* AF_UNIX */
335 char sun_path[108]; /* path name (gag) */
337 #endif /* HAVE_SYS_UN_H */
339 #ifndef HAVE_IN_ADDR_T
340 typedef u_int32_t in_addr_t;
342 #ifndef HAVE_IN_PORT_T
343 typedef u_int16_t in_port_t;
346 #if defined(BROKEN_SYS_TERMIO_H) && !defined(_STRUCT_WINSIZE)
347 #define _STRUCT_WINSIZE
349 unsigned short ws_row; /* rows, in characters */
350 unsigned short ws_col; /* columns, in character */
351 unsigned short ws_xpixel; /* horizontal size, pixels */
352 unsigned short ws_ypixel; /* vertical size, pixels */
356 /* *-*-nto-qnx does not define this type in the system headers */
357 #ifdef MISSING_FD_MASK
358 typedef unsigned long int fd_mask;
364 # define _PATH_BSHELL "/bin/sh"
368 # ifdef _PATH_STDPATH
369 # undef _PATH_STDPATH
371 # define _PATH_STDPATH USER_PATH
374 #ifndef _PATH_STDPATH
375 # define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
378 #ifndef SUPERUSER_PATH
379 # define SUPERUSER_PATH _PATH_STDPATH
382 #ifndef _PATH_DEVNULL
383 # define _PATH_DEVNULL "/dev/null"
386 #ifndef MAIL_DIRECTORY
387 # define MAIL_DIRECTORY "/var/spool/mail"
391 # define MAILDIR MAIL_DIRECTORY
394 #if !defined(_PATH_MAILDIR) && defined(MAILDIR)
395 # define _PATH_MAILDIR MAILDIR
396 #endif /* !defined(_PATH_MAILDIR) && defined(MAILDIR) */
398 #ifndef _PATH_NOLOGIN
399 # define _PATH_NOLOGIN "/etc/nologin"
402 /* Define this to be the path of the xauth program. */
404 #define _PATH_XAUTH XAUTH_PATH
405 #endif /* XAUTH_PATH */
407 /* derived from XF4/xc/lib/dps/Xlibnet.h */
410 # define X_UNIX_PATH "/var/spool/sockets/X11/%u"
412 # define X_UNIX_PATH "/tmp/.X11-unix/X%u"
414 #endif /* X_UNIX_PATH */
415 #define _PATH_UNIX_X X_UNIX_PATH
418 # define _PATH_TTY "/dev/tty"
423 #if defined(HAVE_LOGIN_GETCAPBOOL) && defined(HAVE_LOGIN_CAP_H)
424 # define HAVE_LOGIN_CAP
428 # define MAX(a,b) (((a)>(b))?(a):(b))
429 # define MIN(a,b) (((a)<(b))?(a):(b))
433 # define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
437 #define timersub(a, b, result) \
439 (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
440 (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
441 if ((result)->tv_usec < 0) { \
442 --(result)->tv_sec; \
443 (result)->tv_usec += 1000000; \
448 #ifndef TIMEVAL_TO_TIMESPEC
449 #define TIMEVAL_TO_TIMESPEC(tv, ts) { \
450 (ts)->tv_sec = (tv)->tv_sec; \
451 (ts)->tv_nsec = (tv)->tv_usec * 1000; \
455 #ifndef TIMESPEC_TO_TIMEVAL
456 #define TIMESPEC_TO_TIMEVAL(tv, ts) { \
457 (tv)->tv_sec = (ts)->tv_sec; \
458 (tv)->tv_usec = (ts)->tv_nsec / 1000; \
466 #if !defined(IN6_IS_ADDR_V4MAPPED)
467 # define IN6_IS_ADDR_V4MAPPED(a) \
468 ((((u_int32_t *) (a))[0] == 0) && (((u_int32_t *) (a))[1] == 0) && \
469 (((u_int32_t *) (a))[2] == htonl (0xffff)))
470 #endif /* !defined(IN6_IS_ADDR_V4MAPPED) */
472 #if !defined(__GNUC__) || (__GNUC__ < 2)
473 # define __attribute__(x)
474 #endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
476 #if !defined(HAVE_ATTRIBUTE__SENTINEL__) && !defined(__sentinel__)
477 # define __sentinel__
480 #if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__bounded__)
481 # define __bounded__(x, y, z)
484 #if !defined(HAVE_ATTRIBUTE__NONNULL__) && !defined(__nonnull__)
485 # define __nonnull__(x)
488 /* *-*-nto-qnx doesn't define this macro in the system headers */
489 #ifdef MISSING_HOWMANY
490 # define howmany(x,y) (((x)+((y)-1))/(y))
493 #ifndef OSSH_ALIGNBYTES
494 #define OSSH_ALIGNBYTES (sizeof(int) - 1)
497 #define __CMSG_ALIGN(p) (((u_int)(p) + OSSH_ALIGNBYTES) &~ OSSH_ALIGNBYTES)
500 /* Length of the contents of a control message of length len */
502 #define CMSG_LEN(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
505 /* Length of the space taken up by a padded control message of length len */
507 #define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
510 /* given pointer to struct cmsghdr, return pointer to data */
512 #define CMSG_DATA(cmsg) ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
513 #endif /* CMSG_DATA */
516 * RFC 2292 requires to check msg_controllen, in case that the kernel returns
517 * an empty list for some reasons.
519 #ifndef CMSG_FIRSTHDR
520 #define CMSG_FIRSTHDR(mhdr) \
521 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
522 (struct cmsghdr *)(mhdr)->msg_control : \
523 (struct cmsghdr *)NULL)
524 #endif /* CMSG_FIRSTHDR */
526 #if defined(HAVE_DECL_OFFSETOF) && HAVE_DECL_OFFSETOF == 0
527 # define offsetof(type, member) ((size_t) &((type *)0)->member)
530 /* Set up BSD-style BYTE_ORDER definition if it isn't there already */
531 /* XXX: doesn't try to cope with strange byte orders (PDP_ENDIAN) */
533 # ifndef LITTLE_ENDIAN
534 # define LITTLE_ENDIAN 1234
535 # endif /* LITTLE_ENDIAN */
537 # define BIG_ENDIAN 4321
538 # endif /* BIG_ENDIAN */
539 # ifdef WORDS_BIGENDIAN
540 # define BYTE_ORDER BIG_ENDIAN
541 # else /* WORDS_BIGENDIAN */
542 # define BYTE_ORDER LITTLE_ENDIAN
543 # endif /* WORDS_BIGENDIAN */
544 #endif /* BYTE_ORDER */
546 /* Function replacement / compatibility hacks */
548 #if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))
549 # define HAVE_GETADDRINFO
552 #ifndef HAVE_GETOPT_OPTRESET
559 # define getopt(ac, av, o) BSDgetopt(ac, av, o)
560 # define opterr BSDopterr
561 # define optind BSDoptind
562 # define optopt BSDoptopt
563 # define optreset BSDoptreset
564 # define optarg BSDoptarg
567 #if defined(BROKEN_GETADDRINFO) && defined(HAVE_GETADDRINFO)
568 # undef HAVE_GETADDRINFO
570 #if defined(BROKEN_GETADDRINFO) && defined(HAVE_FREEADDRINFO)
571 # undef HAVE_FREEADDRINFO
573 #if defined(BROKEN_GETADDRINFO) && defined(HAVE_GAI_STRERROR)
574 # undef HAVE_GAI_STRERROR
577 #if defined(BROKEN_UPDWTMPX) && defined(HAVE_UPDWTMPX)
578 # undef HAVE_UPDWTMPX
581 #if defined(BROKEN_SHADOW_EXPIRE) && defined(HAS_SHADOW_EXPIRE)
582 # undef HAS_SHADOW_EXPIRE
585 #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) && \
586 defined(SYSLOG_R_SAFE_IN_SIGHAND)
587 # define DO_LOG_SAFE_IN_SIGHAND
590 #if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY)
591 # define memmove(s1, s2, n) bcopy((s2), (s1), (n))
592 #endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */
594 #if defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX)
596 #endif /* defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX) */
600 # define getpgrp() getpgrp(0)
604 # define SSH_AUDIT_EVENTS
605 # define CUSTOM_SSH_AUDIT_EVENTS
608 #ifdef USE_LINUX_AUDIT
609 # define SSH_AUDIT_EVENTS
610 # define CUSTOM_SSH_AUDIT_EVENTS
613 #if !defined(HAVE___func__) && defined(HAVE___FUNCTION__)
614 # define __func__ __FUNCTION__
615 #elif !defined(HAVE___func__)
619 #if defined(KRB5) && !defined(HEIMDAL)
620 # define krb5_get_err_text(context,code) error_message(code)
623 #if defined(SKEYCHALLENGE_4ARG)
624 # define _compat_skeychallenge(a,b,c,d) skeychallenge(a,b,c,d)
626 # define _compat_skeychallenge(a,b,c,d) skeychallenge(a,b,c)
629 /* Maximum number of file descriptors available */
631 # define SSH_SYSFDMAX sysconf(_SC_OPEN_MAX)
633 # define SSH_SYSFDMAX 10000
637 /* encode f_fsid into a 64 bit value */
638 #define FSID_TO_ULONG(f) \
639 ((((u_int64_t)(f).val[0] & 0xffffffffUL) << 32) | \
640 ((f).val[1] & 0xffffffffUL))
641 #elif defined(FSID_HAS___VAL)
642 #define FSID_TO_ULONG(f) \
643 ((((u_int64_t)(f).__val[0] & 0xffffffffUL) << 32) | \
644 ((f).__val[1] & 0xffffffffUL))
646 # define FSID_TO_ULONG(f) ((f))
649 #if defined(__Lynx__)
651 * LynxOS defines these in param.h which we do not want to include since
652 * it will also pull in a bunch of kernel definitions.
654 # define ALIGNBYTES (sizeof(int) - 1)
655 # define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES)
656 /* Missing prototypes on LynxOS */
657 int snprintf (char *, size_t, const char *, ...);
658 int mkstemp (char *);
659 char *crypt (const char *, const char *);
662 char *mkdtemp (char *);
663 int rresvport_af (int *, sa_family_t);
664 int innetgr (const char *, const char *, const char *, const char *);
668 * Define this to use pipes instead of socketpairs for communicating with the
669 * client program. Socketpairs do not seem to work on all systems.
671 * configure.ac sets this for a few OS's which are known to have problems
672 * but you may need to set it yourself
674 /* #define USE_PIPES 1 */
677 ** login recorder definitions
680 /* FIXME: put default paths back in */
683 # define UTMP_FILE _PATH_UTMP
685 # ifdef CONF_UTMP_FILE
686 # define UTMP_FILE CONF_UTMP_FILE
692 # define WTMP_FILE _PATH_WTMP
694 # ifdef CONF_WTMP_FILE
695 # define WTMP_FILE CONF_WTMP_FILE
699 /* pick up the user's location for lastlog if given */
701 # ifdef _PATH_LASTLOG
702 # define LASTLOG_FILE _PATH_LASTLOG
704 # ifdef CONF_LASTLOG_FILE
705 # define LASTLOG_FILE CONF_LASTLOG_FILE
710 #if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
714 /* The login() library function in libutil is first choice */
715 #if defined(HAVE_LOGIN) && !defined(DISABLE_LOGIN)
719 /* Simply select your favourite login types. */
720 /* Can't do if-else because some systems use several... <sigh> */
721 # if !defined(DISABLE_UTMPX)
724 # if defined(UTMP_FILE) && !defined(DISABLE_UTMP)
727 # if defined(WTMPX_FILE) && !defined(DISABLE_WTMPX)
730 # if defined(WTMP_FILE) && !defined(DISABLE_WTMP)
737 # define UT_LINESIZE 8
740 /* I hope that the presence of LASTLOG_FILE is enough to detect this */
741 #if defined(LASTLOG_FILE) && !defined(DISABLE_LASTLOG)
749 # define CUSTOM_SYS_AUTH_PASSWD 1
752 #if defined(HAVE_LIBIAF) && defined(HAVE_SET_ID) && !defined(HAVE_SECUREWARE)
753 # define CUSTOM_SYS_AUTH_PASSWD 1
755 #if defined(HAVE_LIBIAF) && defined(HAVE_SET_ID) && !defined(BROKEN_LIBIAF)
761 # define _PATH_BTMP BTMP_FILE
764 #if defined(USE_BTMP) && defined(_PATH_BTMP)
765 # define CUSTOM_FAILED_LOGIN
768 /** end of login recorder definitions */
770 #ifdef BROKEN_GETGROUPS
771 # define getgroups(a,b) ((a)==0 && (b)==NULL ? NGROUPS_MAX : getgroups((a),(b)))
774 #if defined(HAVE_MMAP) && defined(BROKEN_MMAP)
779 # if defined(_XOPEN_IOV_MAX)
780 # define IOV_MAX _XOPEN_IOV_MAX
781 # elif defined(DEF_IOV_MAX)
782 # define IOV_MAX DEF_IOV_MAX
789 # define EWOULDBLOCK EAGAIN
792 #ifndef INET6_ADDRSTRLEN /* for non IPv6 machines */
793 #define INET6_ADDRSTRLEN 46
797 # define SSH_IOBUFSZ 8192
808 #endif /* _DEFINES_H */