/* $Id$ */
-/* Some platforms need this for the _r() functions */
-#if !defined(_REENTRANT) && !defined(SNI)
-# define _REENTRANT 1
-#endif
-
/* Necessary headers */
#include <sys/types.h> /* For [u]intxx_t */
#include <termios.h> /* Struct winsize */
#include <fcntl.h> /* For O_NONBLOCK */
+/* *-*-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 */
#ifndef SHUT_RDWR
#endif
#ifndef NGROUPS_MAX /* Disable groupaccess if NGROUP_MAX is not set */
+#ifdef NGROUPS
+#define NGROUPS_MAX NGROUPS
+#else
#define NGROUPS_MAX 0
#endif
+#endif
#ifndef O_NONBLOCK /* Non Blocking Open */
# define O_NONBLOCK 00004
#endif
-#ifndef S_ISREG
+#ifndef S_ISDIR
# define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
+#endif /* S_ISDIR */
+
+#ifndef S_ISREG
# define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG))
#endif /* S_ISREG */
+#ifndef S_ISLNK
+# define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
+#endif /* S_ISLNK */
+
#ifndef S_IXUSR
# define S_IXUSR 0000100 /* execute/search permission, */
# define S_IXGRP 0000010 /* execute/search permission, */
# define S_IRWXO 0000007 /* read, write, execute */
#endif /* S_IXUSR */
+/* *-*-nto-qnx doesn't define this constant in the system headers */
+#ifdef MISSING_NFDBITS
+# define NFDBITS (8 * sizeof(unsigned long))
+#endif
+
/* Types */
/* If sys/types.h does not supply intXX_t, supply them ourselves */
/* (or die trying) */
-#ifdef SIZEOF_LONG_LONG_INT
-# define HAVE_LONG_LONG_INT
-#endif
#ifndef HAVE_U_INT
typedef unsigned int u_int;
# endif
# endif
# endif
+#define __BIT_TYPES_DEFINED__
#endif
/* 64-bit types */
# endif
# endif
#endif
+#if !defined(HAVE_LONG_LONG_INT) && (SIZEOF_LONG_LONG_INT == 8)
+# define HAVE_LONG_LONG_INT 1
+#endif
#ifndef HAVE_SOCKLEN_T
typedef unsigned int socklen_t;
};
#endif
+/* *-*-nto-qnx does not define this type in the system headers */
+#ifdef MISSING_FD_MASK
+ typedef unsigned long int fd_mask;
+#endif
+
/* Paths */
#ifndef _PATH_BSHELL
#endif
/* Define this to be the path of the xauth program. */
-#ifndef XAUTH_PATH
-#define XAUTH_PATH "/usr/X11R6/bin/xauth"
+#ifdef XAUTH_PATH
+#define _PATH_XAUTH XAUTH_PATH
#endif /* XAUTH_PATH */
#ifndef _PATH_TTY
(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
#endif /* SUN_LEN */
+/* *-*-nto-qnx doesn't define this macro in the system headers */
+#ifdef MISSING_HOWMANY
+# define howmany(x,y) (((x)+((y)-1))/(y))
+#endif
+
/* Function replacement / compatibility hacks */
/* In older versions of libpam, pam_strerror takes a single argument */
#endif /* !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY) */
#if !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT)
-# define atexit(a) on_exit(a)
+# define atexit(a, NULL) on_exit(a, NULL)
#else
# if defined(HAVE_XATEXIT)
# define atexit(a) xatexit(a)
# endif /* defined(HAVE_XATEXIT) */
#endif /* !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT) */
-#if defined(HAVE_VHANGUP) && !defined(BROKEN_VHANGUP)
+#if defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX)
# define USE_VHANGUP
-#endif /* defined(HAVE_VHANGUP) && !defined(BROKEN_VHANGUP) */
+#endif /* defined(HAVE_VHANGUP) && !defined(HAVE_DEV_PTMX) */
#ifndef GETPGRP_VOID
# define getpgrp() getpgrp(0)