Deleted Added
full compact
defines.h (181110) defines.h (181111)
1/*
2 * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 11 unchanged lines hidden (view full) ---

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.
23 */
24
25#ifndef _DEFINES_H
26#define _DEFINES_H
27
1/*
2 * Copyright (c) 1999-2003 Damien Miller. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 11 unchanged lines hidden (view full) ---

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.
23 */
24
25#ifndef _DEFINES_H
26#define _DEFINES_H
27
28/* $Id: defines.h,v 1.138 2006/09/21 13:13:30 dtucker Exp $ */
28/* $Id: defines.h,v 1.151 2008/07/04 13:10:49 djm Exp $ */
29
30
31/* Constants */
32
33#if defined(HAVE_DECL_SHUT_RD) && HAVE_DECL_SHUT_RD == 0
34enum
35{
36 SHUT_RD = 0, /* No more receptions. */

--- 26 unchanged lines hidden (view full) ---

63#endif /* MAXPATHLEN */
64
65#ifndef PATH_MAX
66# ifdef _POSIX_PATH_MAX
67# define PATH_MAX _POSIX_PATH_MAX
68# endif
69#endif
70
29
30
31/* Constants */
32
33#if defined(HAVE_DECL_SHUT_RD) && HAVE_DECL_SHUT_RD == 0
34enum
35{
36 SHUT_RD = 0, /* No more receptions. */

--- 26 unchanged lines hidden (view full) ---

63#endif /* MAXPATHLEN */
64
65#ifndef PATH_MAX
66# ifdef _POSIX_PATH_MAX
67# define PATH_MAX _POSIX_PATH_MAX
68# endif
69#endif
70
71#ifndef MAXSYMLINKS
71#if defined(HAVE_DECL_MAXSYMLINKS) && HAVE_DECL_MAXSYMLINKS == 0
72# define MAXSYMLINKS 5
73#endif
74
75#ifndef STDIN_FILENO
76# define STDIN_FILENO 0
77#endif
78#ifndef STDOUT_FILENO
79# define STDOUT_FILENO 1

--- 236 unchanged lines hidden (view full) ---

316 typedef unsigned long int fd_mask;
317#endif
318
319/* Paths */
320
321#ifndef _PATH_BSHELL
322# define _PATH_BSHELL "/bin/sh"
323#endif
72# define MAXSYMLINKS 5
73#endif
74
75#ifndef STDIN_FILENO
76# define STDIN_FILENO 0
77#endif
78#ifndef STDOUT_FILENO
79# define STDOUT_FILENO 1

--- 236 unchanged lines hidden (view full) ---

316 typedef unsigned long int fd_mask;
317#endif
318
319/* Paths */
320
321#ifndef _PATH_BSHELL
322# define _PATH_BSHELL "/bin/sh"
323#endif
324#ifndef _PATH_CSHELL
325# define _PATH_CSHELL "/bin/csh"
326#endif
327#ifndef _PATH_SHELLS
328# define _PATH_SHELLS "/etc/shells"
329#endif
330
331#ifdef USER_PATH
332# ifdef _PATH_STDPATH
333# undef _PATH_STDPATH
334# endif
335# define _PATH_STDPATH USER_PATH
336#endif
337

--- 94 unchanged lines hidden (view full) ---

432 ((((u_int32_t *) (a))[0] == 0) && (((u_int32_t *) (a))[1] == 0) && \
433 (((u_int32_t *) (a))[2] == htonl (0xffff)))
434#endif /* !defined(IN6_IS_ADDR_V4MAPPED) */
435
436#if !defined(__GNUC__) || (__GNUC__ < 2)
437# define __attribute__(x)
438#endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
439
324
325#ifdef USER_PATH
326# ifdef _PATH_STDPATH
327# undef _PATH_STDPATH
328# endif
329# define _PATH_STDPATH USER_PATH
330#endif
331

--- 94 unchanged lines hidden (view full) ---

426 ((((u_int32_t *) (a))[0] == 0) && (((u_int32_t *) (a))[1] == 0) && \
427 (((u_int32_t *) (a))[2] == htonl (0xffff)))
428#endif /* !defined(IN6_IS_ADDR_V4MAPPED) */
429
430#if !defined(__GNUC__) || (__GNUC__ < 2)
431# define __attribute__(x)
432#endif /* !defined(__GNUC__) || (__GNUC__ < 2) */
433
440#ifndef __dead
441# define __dead __attribute__((noreturn))
442#endif
443
444#if !defined(HAVE_ATTRIBUTE__SENTINEL__) && !defined(__sentinel__)
445# define __sentinel__
446#endif
447
448#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__bounded__)
449# define __bounded__(x, y, z)
450#endif
451
434#if !defined(HAVE_ATTRIBUTE__SENTINEL__) && !defined(__sentinel__)
435# define __sentinel__
436#endif
437
438#if !defined(HAVE_ATTRIBUTE__BOUNDED__) && !defined(__bounded__)
439# define __bounded__(x, y, z)
440#endif
441
442#if !defined(HAVE_ATTRIBUTE__NONNULL__) && !defined(__nonnull__)
443# define __nonnull__(x)
444#endif
445
452/* *-*-nto-qnx doesn't define this macro in the system headers */
453#ifdef MISSING_HOWMANY
454# define howmany(x,y) (((x)+((y)-1))/(y))
455#endif
456
457#ifndef OSSH_ALIGNBYTES
458#define OSSH_ALIGNBYTES (sizeof(int) - 1)
459#endif

--- 22 unchanged lines hidden (view full) ---

482 */
483#ifndef CMSG_FIRSTHDR
484#define CMSG_FIRSTHDR(mhdr) \
485 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
486 (struct cmsghdr *)(mhdr)->msg_control : \
487 (struct cmsghdr *)NULL)
488#endif /* CMSG_FIRSTHDR */
489
446/* *-*-nto-qnx doesn't define this macro in the system headers */
447#ifdef MISSING_HOWMANY
448# define howmany(x,y) (((x)+((y)-1))/(y))
449#endif
450
451#ifndef OSSH_ALIGNBYTES
452#define OSSH_ALIGNBYTES (sizeof(int) - 1)
453#endif

--- 22 unchanged lines hidden (view full) ---

476 */
477#ifndef CMSG_FIRSTHDR
478#define CMSG_FIRSTHDR(mhdr) \
479 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
480 (struct cmsghdr *)(mhdr)->msg_control : \
481 (struct cmsghdr *)NULL)
482#endif /* CMSG_FIRSTHDR */
483
490#ifndef offsetof
484#if defined(HAVE_DECL_OFFSETOF) && HAVE_DECL_OFFSETOF == 0
491# define offsetof(type, member) ((size_t) &((type *)0)->member)
492#endif
493
494/* Set up BSD-style BYTE_ORDER definition if it isn't there already */
495/* XXX: doesn't try to cope with strange byte orders (PDP_ENDIAN) */
496#ifndef BYTE_ORDER
497# ifndef LITTLE_ENDIAN
498# define LITTLE_ENDIAN 1234

--- 38 unchanged lines hidden (view full) ---

537#if defined(BROKEN_GETADDRINFO) && defined(HAVE_GAI_STRERROR)
538# undef HAVE_GAI_STRERROR
539#endif
540
541#if defined(BROKEN_UPDWTMPX) && defined(HAVE_UPDWTMPX)
542# undef HAVE_UPDWTMPX
543#endif
544
485# define offsetof(type, member) ((size_t) &((type *)0)->member)
486#endif
487
488/* Set up BSD-style BYTE_ORDER definition if it isn't there already */
489/* XXX: doesn't try to cope with strange byte orders (PDP_ENDIAN) */
490#ifndef BYTE_ORDER
491# ifndef LITTLE_ENDIAN
492# define LITTLE_ENDIAN 1234

--- 38 unchanged lines hidden (view full) ---

531#if defined(BROKEN_GETADDRINFO) && defined(HAVE_GAI_STRERROR)
532# undef HAVE_GAI_STRERROR
533#endif
534
535#if defined(BROKEN_UPDWTMPX) && defined(HAVE_UPDWTMPX)
536# undef HAVE_UPDWTMPX
537#endif
538
539#if defined(BROKEN_SHADOW_EXPIRE) && defined(HAS_SHADOW_EXPIRE)
540# undef HAS_SHADOW_EXPIRE
541#endif
542
545#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) && \
546 defined(SYSLOG_R_SAFE_IN_SIGHAND)
547# define DO_LOG_SAFE_IN_SIGHAND
548#endif
549
550#if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY)
551# define memmove(s1, s2, n) bcopy((s2), (s1), (n))
552#endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */

--- 7 unchanged lines hidden (view full) ---

560# define getpgrp() getpgrp(0)
561#endif
562
563#ifdef USE_BSM_AUDIT
564# define SSH_AUDIT_EVENTS
565# define CUSTOM_SSH_AUDIT_EVENTS
566#endif
567
543#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) && \
544 defined(SYSLOG_R_SAFE_IN_SIGHAND)
545# define DO_LOG_SAFE_IN_SIGHAND
546#endif
547
548#if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY)
549# define memmove(s1, s2, n) bcopy((s2), (s1), (n))
550#endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */

--- 7 unchanged lines hidden (view full) ---

558# define getpgrp() getpgrp(0)
559#endif
560
561#ifdef USE_BSM_AUDIT
562# define SSH_AUDIT_EVENTS
563# define CUSTOM_SSH_AUDIT_EVENTS
564#endif
565
568/* OPENSSL_free() is Free() in versions before OpenSSL 0.9.6 */
569#if !defined(OPENSSL_VERSION_NUMBER) || (OPENSSL_VERSION_NUMBER < 0x0090600f)
570# define OPENSSL_free(x) Free(x)
571#endif
572
573#if !defined(HAVE___func__) && defined(HAVE___FUNCTION__)
574# define __func__ __FUNCTION__
575#elif !defined(HAVE___func__)
576# define __func__ ""
577#endif
578
579#if defined(KRB5) && !defined(HEIMDAL)
580# define krb5_get_err_text(context,code) error_message(code)

--- 7 unchanged lines hidden (view full) ---

588
589/* Maximum number of file descriptors available */
590#ifdef HAVE_SYSCONF
591# define SSH_SYSFDMAX sysconf(_SC_OPEN_MAX)
592#else
593# define SSH_SYSFDMAX 10000
594#endif
595
566#if !defined(HAVE___func__) && defined(HAVE___FUNCTION__)
567# define __func__ __FUNCTION__
568#elif !defined(HAVE___func__)
569# define __func__ ""
570#endif
571
572#if defined(KRB5) && !defined(HEIMDAL)
573# define krb5_get_err_text(context,code) error_message(code)

--- 7 unchanged lines hidden (view full) ---

581
582/* Maximum number of file descriptors available */
583#ifdef HAVE_SYSCONF
584# define SSH_SYSFDMAX sysconf(_SC_OPEN_MAX)
585#else
586# define SSH_SYSFDMAX 10000
587#endif
588
589#ifdef FSID_HAS_VAL
590/* encode f_fsid into a 64 bit value */
591#define FSID_TO_ULONG(f) \
592 ((((u_int64_t)(f).val[0] & 0xffffffffUL) << 32) | \
593 ((f).val[1] & 0xffffffffUL))
594#else
595# define FSID_TO_ULONG(f) ((f))
596#endif
597
596#if defined(__Lynx__)
597 /*
598 * LynxOS defines these in param.h which we do not want to include since
599 * it will also pull in a bunch of kernel definitions.
600 */
601# define ALIGNBYTES (sizeof(int) - 1)
602# define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES)
603 /* Missing prototypes on LynxOS */

--- 87 unchanged lines hidden (view full) ---

691
692#ifdef HAVE_OSF_SIA
693# ifdef USE_SHADOW
694# undef USE_SHADOW
695# endif
696# define CUSTOM_SYS_AUTH_PASSWD 1
697#endif
698
598#if defined(__Lynx__)
599 /*
600 * LynxOS defines these in param.h which we do not want to include since
601 * it will also pull in a bunch of kernel definitions.
602 */
603# define ALIGNBYTES (sizeof(int) - 1)
604# define ALIGN(p) (((unsigned)p + ALIGNBYTES) & ~ALIGNBYTES)
605 /* Missing prototypes on LynxOS */

--- 87 unchanged lines hidden (view full) ---

693
694#ifdef HAVE_OSF_SIA
695# ifdef USE_SHADOW
696# undef USE_SHADOW
697# endif
698# define CUSTOM_SYS_AUTH_PASSWD 1
699#endif
700
699#ifdef HAVE_LIBIAF
701#if defined(HAVE_LIBIAF) && defined(HAVE_SET_ID)
700# define CUSTOM_SYS_AUTH_PASSWD 1
701#endif
702# define CUSTOM_SYS_AUTH_PASSWD 1
703#endif
704#if defined(HAVE_LIBIAF) && defined(HAVE_SET_ID) && !defined(BROKEN_LIBIAF)
705# define USE_LIBIAF
706#endif
702
703/* HP-UX 11.11 */
704#ifdef BTMP_FILE
705# define _PATH_BTMP BTMP_FILE
706#endif
707
708#if defined(USE_BTMP) && defined(_PATH_BTMP)
709# define CUSTOM_FAILED_LOGIN

--- 14 unchanged lines hidden (view full) ---

724# define IOV_MAX _XOPEN_IOV_MAX
725# elif defined(DEF_IOV_MAX)
726# define IOV_MAX DEF_IOV_MAX
727# else
728# define IOV_MAX 16
729# endif
730#endif
731
707
708/* HP-UX 11.11 */
709#ifdef BTMP_FILE
710# define _PATH_BTMP BTMP_FILE
711#endif
712
713#if defined(USE_BTMP) && defined(_PATH_BTMP)
714# define CUSTOM_FAILED_LOGIN

--- 14 unchanged lines hidden (view full) ---

729# define IOV_MAX _XOPEN_IOV_MAX
730# elif defined(DEF_IOV_MAX)
731# define IOV_MAX DEF_IOV_MAX
732# else
733# define IOV_MAX 16
734# endif
735#endif
736
737#ifndef EWOULDBLOCK
738# define EWOULDBLOCK EAGAIN
739#endif
740
732#endif /* _DEFINES_H */
741#endif /* _DEFINES_H */