Makefile: Split definitions for SGI4,5,6.
[kai/samba.git] / source / include / includes.h
index c7acbddc2b3d9f80c550fde7f5d30e966dfdf914..4ca1d4c3b0d270a1ce9bd8e0a09923f8262c01cd 100644 (file)
@@ -4,7 +4,7 @@
    Unix SMB/Netbios implementation.
    Version 1.9.
    Machine customisation and include handling
-   Copyright (C) Andrew Tridgell 1994-1995
+   Copyright (C) Andrew Tridgell 1994-1997
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #endif
 
 #include <sys/socket.h>
+#ifdef AXPROC
+#include <termio.h>
+#endif
 #include <sys/ioctl.h>
 #include <stddef.h>
 #ifdef POSIX_H
 #include <pwdadj.h>
 #endif
 
-#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(CONVEX)
+#if defined(SHADOW_PWD) && !defined(NETBSD) && !defined(FreeBSD) && !defined(CONVEX)
 #include <shadow.h>
 #endif
 
@@ -214,12 +217,21 @@ Here come some platform specific sections
 #ifndef NO_ASMSIGNALH
 #include <asm/signal.h>
 #endif
+#ifdef GLIBC2
+#define _LINUX_C_LIB_VERSION_MAJOR     6
+#include <termios.h>
+#include <rpcsvc/ypclnt.h>
+#include <crypt.h>
+#include <netinet/tcp.h>
+#include <netinet/ip.h>
+#endif
 #define SIGNAL_CAST (__sighandler_t)
 #define USE_GETCWD
 #define USE_SETSID
 #define HAVE_BZERO
 #define HAVE_MEMMOVE
 #define USE_SIGPROCMASK
+#define USE_WAITPID
 #if 0
 /* SETFS disabled until we can check on some bug reports */
 #if _LINUX_C_LIB_VERSION_MAJOR >= 5
@@ -227,11 +239,13 @@ Here come some platform specific sections
 #endif
 #endif
 #ifdef SHADOW_PWD
+#if _LINUX_C_LIB_VERSION_MAJOR < 5
 #ifndef crypt
 #define crypt pw_encrypt
 #endif
 #endif
 #endif
+#endif
 
 #ifdef SUNOS4
 #define SIGNAL_CAST (void (*)(int))
@@ -253,10 +267,21 @@ typedef unsigned short mode_t;
 #include <utime.h>
 #define NO_STRERROR
 #endif
+#ifndef REPLACE_GETPASS
 #define REPLACE_GETPASS
+#endif
+#ifndef BSD_TERMIO
 #define BSD_TERMIO
+#endif
+#ifndef USE_SIGPROCMASK
 #define USE_SIGPROCMASK
 #endif
+#ifndef USE_WAITPID
+#define USE_WAITPID
+#endif
+/* SunOS doesn't have POSIX atexit */
+#define atexit on_exit
+#endif
 
 
 #ifdef SUNOS5
@@ -273,8 +298,11 @@ typedef unsigned short mode_t;
 #include <string.h>
 #include <arpa/inet.h>
 #include <rpcsvc/ypclnt.h>
-#include <crypt.h> 
 #include <termios.h>
+#include <sys/stropts.h>
+#ifndef USE_LIBDES
+#include <crypt.h>
+#endif /* USE_LIBDES */
 extern int gettimeofday (struct timeval *, void *);
 extern int gethostname (char *name, int namelen);
 extern int innetgr (const char *, const char *, const char *, const char *);
@@ -288,7 +316,9 @@ extern int innetgr (const char *, const char *, const char *, const char *);
 #define USE_STATVFS
 #define USE_GETCWD
 #define USE_SETSID
+#ifndef REPLACE_GETPASS
 #define REPLACE_GETPASS
+#endif /* REPLACE_GETPASS */
 #define USE_SIGPROCMASK
 #endif
 
@@ -307,9 +337,10 @@ char *getwd(char *);
 #define SIGNAL_CAST (void(*)(int))
 #endif
 #define USE_DIRECT
+#define USE_WAITPID
 #endif
 
-#ifdef SGI
+#ifdef SGI4
 #include <netinet/tcp.h>
 #include <sys/statfs.h>
 #include <string.h>
@@ -321,10 +352,14 @@ char *getwd(char *);
 #define STATFS4
 #define USE_WAITPID
 #define USE_DIRECT
+#define USE_SETSID
 #endif
 
-#ifdef SGI5
+#if defined(SGI5) || defined(SGI6)
+#include <arpa/inet.h>
 #include <netinet/tcp.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
 #include <sys/statvfs.h>
 #include <string.h>
 #include <signal.h>
@@ -337,6 +372,7 @@ char *getwd(char *);
 #define SIGNAL_CAST (void (*)())
 #define USE_STATVFS
 #define USE_WAITPID
+#define USE_SETSID
 #endif
 
 
@@ -407,6 +443,7 @@ char *mktemp(char *); /* No standard include */
 #define SIGNAL_CAST ( void (*) (int) )
 #define STATFS3
 #define USE_F_FSIZE
+#define USE_SETSID
 #include <netinet/tcp.h>
 #ifdef OSF1_ENH_SEC
 #include <pwd.h>
@@ -432,7 +469,9 @@ char *mktemp(char *); /* No standard include */
 #define NO_FSYNC
 #define USE_GETCWD
 #define USE_SETSID
+#ifndef REPLACE_GETPASS
 #define REPLACE_GETPASS
+#endif /* REPLACE_GETPASS */
 #define NO_GETRLIMIT
 #endif /* CLIX */
 
@@ -459,12 +498,22 @@ char *mktemp(char *); /* No standard include */
 
 
 #ifdef FreeBSD
+#include <arpa/inet.h>
 #include <strings.h>
 #include <netinet/tcp.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #define SIGNAL_CAST (void (*)())
+#define USE_SETVBUF
+#define USE_SETSID
+#define USE_GETCWD
+#define USE_WAITPID
 #define USE_DIRECT
+#define HAVE_MEMMOVE
+#define HAVE_BZERO
+#define HAVE_GETTIMEOFDAY
+#define HAVE_PATHCONF
+#define HAVE_GETGRNAM 1
 #endif 
 
 
@@ -479,6 +528,7 @@ char *mktemp(char *); /* No standard include */
 #include <sys/id.h>
 #include <sys/priv.h>
 #include <netinet/tcp.h>
+#include <locale.h>
 #define SYSV
 #define USE_WAITPID
 #define USE_SIGBLOCK
@@ -503,7 +553,9 @@ char *mktemp(char *); /* No standard include */
 #define NEED_AUTH_PARAMETERS
 #endif
 #define SIGNAL_CAST (void (*)(__harg))
+#ifndef HPUX10 /* This is only needed for HPUX 9.x */
 #define SELECT_CAST (int *)
+#endif /* HPUX10 */
 #define SYSV
 #define USE_WAITPID
 #define WAIT3_CAST2 (int *)
@@ -511,8 +563,10 @@ char *mktemp(char *); /* No standard include */
 #define USE_SETSID
 #define USE_SETRES
 #define DEFAULT_PRINTING PRINT_HPUX
-#define SIGCLD_IGNORE
-#endif
+/* Ken Weiss <krweiss@ucdavis.edu> tells us that SIGCLD_IGNORE is
+   not good for HPUX */
+/* #define SIGCLD_IGNORE */
+#endif /* HPUX */
 
 
 #ifdef SEQUENT
@@ -625,40 +679,38 @@ char *mktemp(char *); /* No standard include */
 #include <sys/statfs.h>
 #include <sys/stropts.h>
 #include <limits.h>
+#include <locale.h>
 #ifdef EVEREST
 #include <unistd.h> 
-#endif
+#endif /* EVEREST */
 #ifdef NETGROUP
 #include <rpcsvc/ypclnt.h>
-#endif
+#endif /* NETGROUP */
 #ifdef SecureWare
 #include <sys/security.h>
 #include <sys/audit.h>
 #include <prot.h>
 #define crypt bigcrypt
-#endif
-#ifndef EVEREST
- #define ftruncate(f,l) syscall(0x0a28,f,l)
-#endif 
+#endif /* SecureWare */
 #define SIGNAL_CAST (void (*)(int))
 #define USE_WAITPID
 #define USE_GETCWD
 #define USE_SETSID
 #ifdef SCO3_2_2
-#define NO_EID
-#else
+#define setuid(u) setreuid(u,-1)
+#define seteuid(u) setreuid(-1,u)
+#else /* SCO3_2_2 */
 #ifndef EVEREST
+#define ftruncate(f,l) syscall(0x0a28,f,l)
 #define USE_IFREQ
-#endif
-#endif
+#define NO_INITGROUPS
+#endif /* EVEREST */
+#endif /* SCO3_2_2 */
 #define STATFS4
 #define NO_FSYNC
-#ifndef EVEREST
-#define NO_INITGROUPS
-#endif
 #define HAVE_PATHCONF
 #define NO_GETRLIMIT
-#endif
+#endif /* SCO */
 
 
 
@@ -899,13 +951,51 @@ typedef int mode_t;
 #include <sys/bsdioctl.h>
 #endif
 
+#ifdef AMIGA
+#include <arpa/inet.h>
+#include <dirent.h>
+#include <string.h>
+#include <netinet/tcp.h>
+#include <sys/acct.h>
+#include <sys/fcntl.h>
+#include <sys/filio.h>
+#include <sys/sockio.h>
+#include <netinet/in_systm.h>
+#include <netinet/ip.h>
+#include <sys/termios.h>
+#include <limits.h>
+#include <sys/timeb.h>
+
+#define SIGNAL_CAST (void (*)(int))
+#define USE_GETCWD
+#define HAVE_BZERO
+#define HAVE_MEMMOVE
+#define USE_SIGPROCMASK
+#define USE_WAITPID
+#define USE_DIRECT
+#define USE_F_FSIZE
+#define HAVE_FCNTL_LOCK 0
+#define HAVE_GETTIMEOFDAY
+#define HAVE_PATHCONF
+
+#define HAVE_NO_PROC
+#define NO_FORK_DEBUG
+#define HAVE_FORK 0
+#define HAVE_VFORK 1
+#endif
+
+/* For UnixWare 2.x's ia_uinfo routines. (tangent@cyberport.com) */
+#ifdef IA_UINFO
+#include <iaf.h>
+#include <ia.h>
+#endif
 
 
 /*******************************************************************
 end of the platform specific sections
 ********************************************************************/
 
-#if defined(USE_MMAP) || FAST_SHARE_MODES
+#if defined(USE_MMAP) || defined(FAST_SHARE_MODES)
 #include <sys/mman.h>
 #endif
 
@@ -984,6 +1074,10 @@ struct spwd { /* fake shadow password structure */
 #include <dce/sec_login.h>
 #endif
 
+#ifdef KRB5_AUTH
+#include <krb5.h>
+#endif
+
 #ifdef NO_UTIMBUF
 struct utimbuf {
   time_t actime;
@@ -1027,6 +1121,10 @@ extern char *sys_errlist[];
 #define S_ISDIR(x) ((S_IFDIR & x)!=0)
 #endif
 
+#if !defined(S_ISLNK) && defined(S_IFLNK)
+#define S_ISLNK(x) ((S_IFLNK & x)!=0)
+#endif
+
 #ifdef UFC_CRYPT
 #define crypt ufc_crypt
 #endif
@@ -1078,6 +1176,10 @@ it works and getting lots of bug reports */
 #define SIGCLD SIGCHLD
 #endif 
 
+#ifndef MAP_FILE
+#define MAP_FILE 0
+#endif
+
 #ifndef HAVE_FCNTL_LOCK
 #define HAVE_FCNTL_LOCK 1
 #endif
@@ -1094,6 +1196,10 @@ it works and getting lots of bug reports */
 #define QSORT_CAST (int (*)())
 #endif
 
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK 0x7f000001
+#endif /* INADDR_LOOPBACK */
+
 /* this is a rough check to see if this machine has a lstat() call.
    it is not guaranteed to work */
 #if !(defined(S_ISLNK) || defined(S_IFLNK))