#include <sys/types.h> /* For [u]intxx_t */
#include <sys/socket.h> /* For SHUT_XXXX */
-#include <sys/param.h> /* For MAXPATHLEN */
+#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 */
# 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, */
/* If sys/types.h does not supply intXX_t, supply them ourselves */
/* (or die trying) */
+
#ifndef HAVE_U_INT
typedef unsigned int u_int;
#endif
# if (SIZEOF_SHORT_INT == 2)
typedef short int int16_t;
# else
-# error "16 bit int type not found."
+# ifdef _CRAY
+typedef long int16_t;
+# else
+# error "16 bit int type not found."
+# endif /* _CRAY */
# endif
# if (SIZEOF_INT == 4)
typedef int int32_t;
# else
-# error "32 bit int type not found."
+# ifdef _CRAY
+typedef long int32_t;
+# else
+# error "32 bit int type not found."
+# endif /* _CRAY */
# endif
#endif
# if (SIZEOF_SHORT_INT == 2)
typedef unsigned short int u_int16_t;
# else
-# error "16 bit int type not found."
+# ifdef _CRAY
+typedef unsigned long u_int16_t;
+# else
+# error "16 bit int type not found."
+# endif
# endif
# if (SIZEOF_INT == 4)
typedef unsigned int u_int32_t;
# else
-# error "32 bit int type not found."
+# ifdef _CRAY
+typedef unsigned long u_int32_t;
+# else
+# error "32 bit int type not found."
+# endif
# endif
# endif
#endif
# if (SIZEOF_LONG_LONG_INT == 8)
typedef long long int int64_t;
# define HAVE_INT64_T 1
+# define HAVE_LONG_LONG_INT
# endif
# endif
#endif
#ifndef _PATH_BSHELL
# define _PATH_BSHELL "/bin/sh"
#endif
+#ifndef _PATH_CSHELL
+# define _PATH_CSHELL "/bin/csh"
+#endif
+#ifndef _PATH_SHELLS
+# define _PATH_SHELLS "/etc/shells"
+#endif
#ifdef USER_PATH
# ifdef _PATH_STDPATH
# define MIN(a,b) (((a)<(b))?(a):(b))
#endif
+#ifndef roundup
+# define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
+#endif
+
#ifndef timersub
-#define timersub(a, b, result) \
- do { \
- (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
- (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
- if ((result)->tv_usec < 0) { \
- --(result)->tv_sec; \
- (result)->tv_usec += 1000000; \
- } \
+#define timersub(a, b, result) \
+ do { \
+ (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \
+ (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \
+ if ((result)->tv_usec < 0) { \
+ --(result)->tv_sec; \
+ (result)->tv_usec += 1000000; \
+ } \
} while (0)
#endif