portability enhancements: NeXT and SCO
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 28 Jul 1993 12:38:15 +0000 (04:38 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Wed, 28 Jul 1993 12:38:15 +0000 (04:38 -0800)
SCCS-vsn: usr.sbin/sendmail/src/READ_ME 8.11
SCCS-vsn: usr.sbin/sendmail/src/conf.c 8.13
SCCS-vsn: usr.sbin/sendmail/src/conf.h 8.18

usr/src/usr.sbin/sendmail/src/READ_ME
usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/conf.h

index 475c6e0..9f3cb68 100644 (file)
@@ -4,7 +4,7 @@
 #
 # %sccs.include.redist.sh%
 #
 #
 # %sccs.include.redist.sh%
 #
-#      @(#)READ_ME     8.10 (Berkeley) %G%
+#      @(#)READ_ME     8.11 (Berkeley) %G%
 #
 
 This directory contains the source files for sendmail.
 #
 
 This directory contains the source files for sendmail.
@@ -40,7 +40,8 @@ Makefile:
 
 SOLARIS                Define this if you are running Solaris 2.0 or higher.
 __NeXT__       Define this if you are on a NeXT box.  (This one may
 
 SOLARIS                Define this if you are running Solaris 2.0 or higher.
 __NeXT__       Define this if you are on a NeXT box.  (This one may
-               be pre-defined for you.)
+               be pre-defined for you.)  There are other hacks you
+               have to make -- see below.
 _AIX3          Define this if you are IBM AIX 3.x.
 RISCOS         Define this if you are running RISC/os from MIPS.
 
 _AIX3          Define this if you are IBM AIX 3.x.
 RISCOS         Define this if you are running RISC/os from MIPS.
 
@@ -63,9 +64,6 @@ HASFLOCK      Set this if you prefer to use the flock(2) system call
                don't have an alternative.
 HASUNAME       Set if you have the "uname" system call.  Implied by
                SYSTEM5.
                don't have an alternative.
 HASUNAME       Set if you have the "uname" system call.  Implied by
                SYSTEM5.
-HASSETENV      Define this if your system library has the "setenv"
-               call.  If not defined, sendmail defines this in terms
-               of the putenv(3) routine.
 HASUNSETENV    Define this if your system library has the "unsetenv"
                subroutine.
 HASSTATFS      Define this if you have the statfs(2) system call.  It's
 HASUNSETENV    Define this if your system library has the "unsetenv"
                subroutine.
 HASSTATFS      Define this if you have the statfs(2) system call.  It's
@@ -192,7 +190,7 @@ If you are compiling on NeXT, you will have to create an empty file
 "unistd.h" and create a file "dirent.h" containing:
 
        #include <sys/dir.h>
 "unistd.h" and create a file "dirent.h" containing:
 
        #include <sys/dir.h>
-       #define direct  dirent
+       #define dirent  direct
 
 If you use both -DNDBM and -DNEWDB, you must delete the module ndbm.o
 from libdb.a and delete the file "ndbm.h" from the files that get
 
 If you use both -DNDBM and -DNEWDB, you must delete the module ndbm.o
 from libdb.a and delete the file "ndbm.h" from the files that get
@@ -264,4 +262,4 @@ version.c   The version number and information about this
 
 Eric Allman
 
 
 Eric Allman
 
-(Version 8.10, last update %G% 09:21:53)
+(Version 8.11, last update %G% 21:38:10)
index 259625c..c52e20e 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)conf.c     8.12 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c     8.13 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -491,7 +491,7 @@ setsignal(sig, handler)
        int sig;
        setsig_t handler;
 {
        int sig;
        setsig_t handler;
 {
-#ifdef SYS5SIGNALS
+#if defined(SYS5SIGNALS) || defined(BSD4_3)
        return signal(sig, handler);
 #else
        struct sigaction n, o;
        return signal(sig, handler);
 #else
        struct sigaction n, o;
@@ -903,41 +903,6 @@ reapchild()
 # endif
 }
 \f/*
 # endif
 }
 \f/*
-**  SETENV -- set environment variable
-**
-**     Putenv is more modern, but this is a simpler interface
-**
-**     Parameters:
-**             name -- the name of the envariable.
-**             value -- the value of that envariable.
-**             overwrite -- if set, overwrite existing value
-**                     (this is assumed to be set).
-**
-**     Returns:
-**             none.
-**
-**     Side Effects:
-**             The environment is updated.
-*/
-
-#ifndef HASSETENV
-
-setenv(name, value, overwrite)
-       char *name;
-       char *value;
-       int overwrite;
-{
-       register char *p;
-
-       p = xalloc(strlen(name) + strlen(value) + 2);
-       strcpy(p, name);
-       strcat(p, "=");
-       strcat(p, value);
-       putenv(p);
-}
-
-#endif
-\f/*
 **  UNSETENV -- remove a variable from the environment
 **
 **     Not needed on newer systems.
 **  UNSETENV -- remove a variable from the environment
 **
 **     Not needed on newer systems.
@@ -1132,7 +1097,7 @@ setsid __P ((void))
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)getopt.c   4.3 (Berkeley) 3/9/86";
 
 #if defined(LIBC_SCCS) && !defined(lint)
 static char sccsid[] = "@(#)getopt.c   4.3 (Berkeley) 3/9/86";
-#endif LIBC_SCCS and not lint
+#endif /* LIBC_SCCS and not lint */
 
 #include <stdio.h>
 
 
 #include <stdio.h>
 
@@ -1296,7 +1261,7 @@ enoughspace(msize)
 #  else
        struct statfs fs;
 #   define FSBLOCKSIZE fs.f_bsize
 #  else
        struct statfs fs;
 #   define FSBLOCKSIZE fs.f_bsize
-#   if defined(_SCO_UNIX_)
+#   if defined(_SCO_unix_)
 #    define f_bavail f_bfree
 #   endif
 #  endif
 #    define f_bavail f_bfree
 #   endif
 #  endif
index b59a685..52dadd2 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)conf.h      8.17 (Berkeley) %G%
+ *     @(#)conf.h      8.18 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 #  define _PATH_UNIX   "/kernel/unix"
 #  ifndef _PATH_SENDMAILCF
 #   define _PATH_SENDMAILCF    "/etc/mail/sendmail.cf"
 #  define _PATH_UNIX   "/kernel/unix"
 #  ifndef _PATH_SENDMAILCF
 #   define _PATH_SENDMAILCF    "/etc/mail/sendmail.cf"
+#  endif
+#  ifndef _PATH_SENDMAILFC
+#   define _PATH_SENDMAILFC    "/etc/mail/sendmail.fc"
+#  endif
+#  ifndef _PATH_SENDMAILPID
 #   define _PATH_SENDMAILPID   "/etc/mail/sendmail.pid"
 #  endif
 
 #   define _PATH_SENDMAILPID   "/etc/mail/sendmail.pid"
 #  endif
 
 #ifdef ultrix
 # define HASSTATFS     1       /* has the statfs(2) syscall */
 # define HASSETREUID   1       /* has setreuid(2) call */
 #ifdef ultrix
 # define HASSTATFS     1       /* has the statfs(2) syscall */
 # define HASSETREUID   1       /* has setreuid(2) call */
-# define HASSETENV     1       /* has setenv(3) call */
 # define HASUNSETENV   1       /* has unsetenv(3) call */
 # define HASINITGROUPS 1       /* has initgroups(3) call */
 /* # define HASFLOCK   1       /* has flock(2) call */
 # define HASUNSETENV   1       /* has unsetenv(3) call */
 # define HASINITGROUPS 1       /* has initgroups(3) call */
 /* # define HASFLOCK   1       /* has flock(2) call */
 */
 
 #ifdef __osf__
 */
 
 #ifdef __osf__
-# define HASSETENV     1       /* has setenv(3) call */
 # define HASUNSETENV   1       /* has unsetenv(3) call */
 # define HASSETREUID   1       /* has setreuid(2) call */
 # define HASINITGROUPS 1       /* has initgroups(3) call */
 /* # define HASFLOCK   1       /* has flock(2) call */
 # define LA_TYPE       LA_INT
 # define HASUNSETENV   1       /* has unsetenv(3) call */
 # define HASSETREUID   1       /* has setreuid(2) call */
 # define HASINITGROUPS 1       /* has initgroups(3) call */
 /* # define HASFLOCK   1       /* has flock(2) call */
 # define LA_TYPE       LA_INT
-# define LA_AVENRUN    "avenrun"
 #endif
 
 /*
 #endif
 
 /*
 # define sleep         sleepX
 # define LA_TYPE       LA_ZERO
 typedef int            pid_t;
 # define sleep         sleepX
 # define LA_TYPE       LA_ZERO
 typedef int            pid_t;
+# ifndef _PATH_SENDMAILCF
+#  define _PATH_SENDMAILCF     "/etc/sendmail/sendmail.cf"
+# endif
+# ifndef _PATH_SENDMAILFC
+#  define _PATH_SENDMAILFC     "/etc/sendmail/sendmail.fc"
+# endif
+# ifndef _PATH_SENDMAILPID
+#  define _PATH_SENDMAILPID    "/etc/sendmail/sendmail.pid"
+# endif
 #endif
 
 /*
 #endif
 
 /*
@@ -199,8 +210,12 @@ typedef int                pid_t;
 */
 
 #ifdef BSD4_4
 */
 
 #ifdef BSD4_4
+# define HASUNSETENV   1       /* has unsetenv(3) call */
 # include <sys/cdefs.h>
 # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
 # include <sys/cdefs.h>
 # define ERRLIST_PREDEFINED    /* don't declare sys_errlist */
+# ifndef LA_TYPE
+#  define LA_TYPE      LA_SUBR
+# endif
 #endif
 
 /*
 #endif
 
 /*
@@ -259,7 +274,6 @@ typedef int         pid_t;
 */
 
 #ifdef RISCOS
 */
 
 #ifdef RISCOS
-# define HASSETENV     1       /* has setenv(3) call */
 # define HASUNSETENV   1       /* has unsetenv(3) call */
 /* # define HASFLOCK   1       /* has flock(2) call */
 # define LA_TYPE       LA_INT
 # define HASUNSETENV   1       /* has unsetenv(3) call */
 /* # define HASFLOCK   1       /* has flock(2) call */
 # define LA_TYPE       LA_INT
@@ -277,15 +291,10 @@ typedef int               pid_t;
 
 /* general BSD defines */
 #ifdef BSD
 
 /* general BSD defines */
 #ifdef BSD
-# define HASSETENV     1       /* has setenv(3) call */
-# define HASUNSETENV   1       /* has unsetenv(3) call */
 # define HASGETDTABLESIZE 1    /* has getdtablesize(2) call */
 # define HASSETREUID   1       /* has setreuid(2) call */
 # define HASINITGROUPS 1       /* has initgroups(2) call */
 # define HASFLOCK      1       /* has flock(2) call */
 # define HASGETDTABLESIZE 1    /* has getdtablesize(2) call */
 # define HASSETREUID   1       /* has setreuid(2) call */
 # define HASINITGROUPS 1       /* has initgroups(2) call */
 # define HASFLOCK      1       /* has flock(2) call */
-# ifndef LA_TYPE
-#  define LA_TYPE      LA_SUBR
-# endif
 #endif
 
 /* general System V defines */
 #endif
 
 /* general System V defines */
@@ -437,7 +446,9 @@ struct utsname
 
 #ifdef HASFLOCK
 # include <sys/file.h>
 
 #ifdef HASFLOCK
 # include <sys/file.h>
-#else
+#endif
+
+#ifndef LOCK_SH
 # define LOCK_SH       0x01    /* shared lock */
 # define LOCK_EX       0x02    /* exclusive lock */
 # define LOCK_NB       0x04    /* non-blocking lock */
 # define LOCK_SH       0x01    /* shared lock */
 # define LOCK_EX       0x02    /* exclusive lock */
 # define LOCK_NB       0x04    /* non-blocking lock */