]> andersk Git - openssh.git/blobdiff - defines.h
- (djm) Bug #539: Specify creation mode with O_CREAT for lastlog. Report
[openssh.git] / defines.h
index cb2c9458e4c53a4f33c0c6b8d4b44c4d2644fbb0..e8d33b2478e11e3c46cf790722891d0de5c019e3 100644 (file)
--- a/defines.h
+++ b/defines.h
@@ -3,61 +3,6 @@
 
 /* $Id$ */
 
-/* Necessary headers */
-
-#include <sys/types.h> /* For [u]intxx_t */
-#include <sys/socket.h> /* For SHUT_XXXX */
-#include <sys/param.h> /* For MAXPATHLEN and roundup() */
-#include <netinet/in_systm.h> /* For typedefs */
-#include <netinet/in.h> /* For IPv6 macros */
-#include <netinet/ip.h> /* For IPTOS macros */
-#ifdef HAVE_RPC_TYPES_H
-# include <rpc/types.h> /* For INADDR_LOOPBACK */
-#endif
-#ifdef HAVE_SYS_UN_H
-# include <sys/un.h> /* For sockaddr_un */
-#endif
-#ifdef HAVE_SYS_BITYPES_H
-# include <sys/bitypes.h> /* For u_intXX_t */
-#endif
-#ifdef HAVE_PATHS_H
-# include <paths.h> /* For _PATH_XXX */
-#endif
-#ifdef HAVE_LIMITS_H
-# include <limits.h> /* For PATH_MAX */
-#endif
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h> /* For timersub */
-#endif
-#ifdef HAVE_MAILLOCK_H
-# include <maillock.h> /* For _PATH_MAILDIR */
-#endif
-#ifdef HAVE_SYS_CDEFS_H
-# include <sys/cdefs.h> /* For __P() */
-#endif
-#ifdef HAVE_SYS_SYSMACROS_H
-# include <sys/sysmacros.h> /* For MIN, MAX, etc */
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h> /* For S_* constants and macros */
-#endif
-#ifdef HAVE_NEXT
-#  include <libc.h>
-#endif
-
-#include <unistd.h> /* For STDIN_FILENO, etc */
-#include <termios.h> /* Struct winsize */
-#include <fcntl.h> /* For O_NONBLOCK */
-#include <openssl/opensslv.h> /* For OPENSSL_VERSION_NUMBER */
-
-/* *-*-nto-qnx needs these headers for strcasecmp and LASTLOG_FILE respectively */
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
-#ifdef HAVE_LOGIN_H
-# include <login.h>
-#endif
-
 
 /* Constants */
 
@@ -139,6 +84,14 @@ enum
 # define S_IRWXO                       0000007 /* read, write, execute */
 #endif /* S_IXUSR */
 
+#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
+#define MAP_ANON MAP_ANONYMOUS
+#endif
+
+#ifndef MAP_FAILED
+# define MAP_FAILED ((void *)-1)
+#endif
+
 /* *-*-nto-qnx doesn't define this constant in the system headers */
 #ifdef MISSING_NFDBITS
 # define       NFDBITS (8 * sizeof(unsigned long))
@@ -149,7 +102,7 @@ SCO Open Server 3 has INADDR_LOOPBACK defined in rpc/rpc.h but
 including rpc/rpc.h breaks Solaris 6
 */
 #ifndef INADDR_LOOPBACK
-#define INADDR_LOOPBACK ((ulong)0x7f000001)
+#define INADDR_LOOPBACK ((u_long)0x7f000001)
 #endif
 
 /* Types */
@@ -171,7 +124,7 @@ typedef char int8_t;
 # if (SIZEOF_SHORT_INT == 2)
 typedef short int int16_t;
 # else
-#  ifdef _CRAY
+#  ifdef _UNICOS
 #   if (SIZEOF_SHORT_INT == 4)
 typedef short int16_t;
 #   else
@@ -179,16 +132,16 @@ typedef long  int16_t;
 #   endif
 #  else
 #   error "16 bit int type not found."
-#  endif /* _CRAY */
+#  endif /* _UNICOS */
 # endif
 # if (SIZEOF_INT == 4)
 typedef int int32_t;
 # else
-#  ifdef _CRAY
+#  ifdef _UNICOS
 typedef long  int32_t;
 #  else
 #   error "32 bit int type not found."
-#  endif /* _CRAY */
+#  endif /* _UNICOS */
 # endif
 #endif
 
@@ -208,7 +161,7 @@ typedef unsigned char u_int8_t;
 #  if (SIZEOF_SHORT_INT == 2)
 typedef unsigned short int u_int16_t;
 #  else
-#   ifdef _CRAY
+#   ifdef _UNICOS
 #    if (SIZEOF_SHORT_INT == 4)
 typedef unsigned short u_int16_t;
 #    else
@@ -221,7 +174,7 @@ typedef unsigned long  u_int16_t;
 #  if (SIZEOF_INT == 4)
 typedef unsigned int u_int32_t;
 #  else
-#   ifdef _CRAY
+#   ifdef _UNICOS
 typedef unsigned long  u_int32_t;
 #   else
 #    error "32 bit int type not found."
@@ -263,6 +216,10 @@ typedef unsigned char u_char;
 # define HAVE_U_CHAR
 #endif /* HAVE_U_CHAR */
 
+#ifndef SIZE_T_MAX
+#define SIZE_T_MAX ULONG_MAX
+#endif /* SIZE_T_MAX */
+
 #ifndef HAVE_SIZE_T
 typedef unsigned int size_t;
 # define HAVE_SIZE_T
@@ -363,14 +320,6 @@ struct winsize {
 # define _PATH_MAILDIR MAILDIR
 #endif /* !defined(_PATH_MAILDIR) && defined(MAILDIR) */
 
-#ifndef _PATH_RSH
-# ifdef RSH_PATH
-#  define _PATH_RSH RSH_PATH
-# else /* RSH_PATH */
-#  define _PATH_RSH "/usr/bin/rsh"
-# endif /* RSH_PATH */
-#endif /* _PATH_RSH */
-
 #ifndef _PATH_NOLOGIN
 # define _PATH_NOLOGIN "/etc/nologin"
 #endif
@@ -421,6 +370,20 @@ struct winsize {
    } while (0)
 #endif
 
+#ifndef TIMEVAL_TO_TIMESPEC
+#define        TIMEVAL_TO_TIMESPEC(tv, ts) {                                   \
+       (ts)->tv_sec = (tv)->tv_sec;                                    \
+       (ts)->tv_nsec = (tv)->tv_usec * 1000;                           \
+}
+#endif
+
+#ifndef TIMESPEC_TO_TIMEVAL
+#define        TIMESPEC_TO_TIMEVAL(tv, ts) {                                   \
+       (tv)->tv_sec = (ts)->tv_sec;                                    \
+       (tv)->tv_usec = (ts)->tv_nsec / 1000;                           \
+}
+#endif
+
 #ifndef __P
 # define __P(x) x
 #endif
@@ -440,18 +403,11 @@ struct winsize {
 # define howmany(x,y)  (((x)+((y)-1))/(y))
 #endif
 
-#ifdef __hpux
-#define MAP_ANON MAP_ANONYMOUS
-#endif
-
-#ifndef ALIGNBYTES
-#define ALIGNBYTES     (sizeof(int) - 1)
-#endif
-#ifndef ALIGN
-#define ALIGN(p)       (((u_int)(p) + ALIGNBYTES) &~ ALIGNBYTES)
+#ifndef OSSH_ALIGNBYTES
+#define OSSH_ALIGNBYTES        (sizeof(int) - 1)
 #endif
 #ifndef __CMSG_ALIGN
-#define        __CMSG_ALIGN(len)       ALIGN(len)
+#define        __CMSG_ALIGN(p) (((u_int)(p) + OSSH_ALIGNBYTES) &~ OSSH_ALIGNBYTES)
 #endif
 
 /* Length of the contents of a control message of length len */
@@ -466,6 +422,25 @@ struct winsize {
 
 /* Function replacement / compatibility hacks */
 
+#if !defined(HAVE_GETADDRINFO) && (defined(HAVE_OGETADDRINFO) || defined(HAVE_NGETADDRINFO))
+# define HAVE_GETADDRINFO
+#endif
+
+#ifndef HAVE_GETOPT_OPTRESET
+# undef getopt
+# undef opterr
+# undef optind
+# undef optopt
+# undef optreset
+# undef optarg
+# define getopt(ac, av, o)  BSDgetopt(ac, av, o)
+# define opterr             BSDopterr
+# define optind             BSDoptind
+# define optopt             BSDoptopt
+# define optreset           BSDoptreset
+# define optarg             BSDoptarg
+#endif
+
 /* In older versions of libpam, pam_strerror takes a single argument */
 #ifdef HAVE_OLD_PAM
 # define PAM_STRERROR(a,b) pam_strerror((b))
@@ -506,10 +481,10 @@ struct winsize {
 # define OPENSSL_free(x) Free(x)
 #endif
 
-#if defined(HAVE___func__)
-#  define __FUNCTION__ __func__
-#elif !defined(HAVE___FUNCTION__)
-#  define __FUNCTION__ ""
+#if !defined(HAVE___func__) && defined(HAVE___FUNCTION__)
+#  define __func__ __FUNCTION__
+#elif !defined(HAVE___func__)
+#  define __func__ ""
 #endif
 
 /*
@@ -525,27 +500,6 @@ struct winsize {
  ** login recorder definitions
  **/
 
-/* preprocess */
-
-#ifdef HAVE_UTMP_H
-#  ifdef HAVE_TIME_IN_UTMP
-#    include <time.h>
-#  endif
-#  include <utmp.h>
-#endif
-#ifdef HAVE_UTMPX_H
-#  ifdef HAVE_TV_IN_UTMPX
-#    include <sys/time.h>
-#  endif
-#  include <utmpx.h>
-#endif
-#ifdef HAVE_LASTLOG_H
-#  include <lastlog.h>
-#endif
-#ifdef HAVE_PATHS_H
-#  include <paths.h>
-#endif
-
 /* FIXME: put default paths back in */
 #ifndef UTMP_FILE
 #  ifdef _PATH_UTMP
@@ -604,11 +558,6 @@ struct winsize {
 #  define USE_LASTLOG
 #endif
 
-/* which type of time to use? (api.c) */
-#ifdef HAVE_SYS_TIME_H
-#  define USE_TIMEVAL
-#endif
-
 /** end of login recorder definitions */
 
 #endif /* _DEFINES_H */
This page took 0.087824 seconds and 4 git commands to generate.