From: Eric Allman Date: Wed, 28 Jul 1993 12:38:15 +0000 (-0800) Subject: portability enhancements: NeXT and SCO X-Git-Tag: BSD-4_4_Lite1-Snapshot-Development~2095 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/0f786d575c34adeb572caa250d75fd855623a16b?hp=337a003010015c0bb24b35a57cc5a9213592ff7c portability enhancements: NeXT and SCO 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 --- diff --git a/usr/src/usr.sbin/sendmail/src/READ_ME b/usr/src/usr.sbin/sendmail/src/READ_ME index 475c6e0be8..9f3cb68d69 100644 --- a/usr/src/usr.sbin/sendmail/src/READ_ME +++ b/usr/src/usr.sbin/sendmail/src/READ_ME @@ -4,7 +4,7 @@ # # %sccs.include.redist.sh% # -# @(#)READ_ME 8.10 (Berkeley) %G% +# @(#)READ_ME 8.11 (Berkeley) %G% # 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 - 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. @@ -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. -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 @@ -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 - #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 @@ -264,4 +262,4 @@ version.c The version number and information about this Eric Allman -(Version 8.10, last update %G% 09:21:53) +(Version 8.11, last update %G% 21:38:10) diff --git a/usr/src/usr.sbin/sendmail/src/conf.c b/usr/src/usr.sbin/sendmail/src/conf.c index 259625cb59..c52e20e573 100644 --- a/usr/src/usr.sbin/sendmail/src/conf.c +++ b/usr/src/usr.sbin/sendmail/src/conf.c @@ -7,7 +7,7 @@ */ #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" @@ -491,7 +491,7 @@ setsignal(sig, handler) int sig; setsig_t handler; { -#ifdef SYS5SIGNALS +#if defined(SYS5SIGNALS) || defined(BSD4_3) return signal(sig, handler); #else struct sigaction n, o; @@ -903,41 +903,6 @@ reapchild() # endif } /* -** 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 - /* ** 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"; -#endif LIBC_SCCS and not lint +#endif /* LIBC_SCCS and not lint */ #include @@ -1296,7 +1261,7 @@ enoughspace(msize) # else struct statfs fs; # define FSBLOCKSIZE fs.f_bsize -# if defined(_SCO_UNIX_) +# if defined(_SCO_unix_) # define f_bavail f_bfree # endif # endif diff --git a/usr/src/usr.sbin/sendmail/src/conf.h b/usr/src/usr.sbin/sendmail/src/conf.h index b59a685a10..52dadd2dee 100644 --- a/usr/src/usr.sbin/sendmail/src/conf.h +++ b/usr/src/usr.sbin/sendmail/src/conf.h @@ -5,7 +5,7 @@ * * %sccs.include.redist.c% * - * @(#)conf.h 8.17 (Berkeley) %G% + * @(#)conf.h 8.18 (Berkeley) %G% */ /* @@ -140,6 +140,11 @@ # 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 @@ -159,7 +164,6 @@ #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 */ @@ -173,13 +177,11 @@ */ #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 LA_AVENRUN "avenrun" #endif /* @@ -192,6 +194,15 @@ # 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 /* @@ -199,8 +210,12 @@ typedef int pid_t; */ #ifdef BSD4_4 +# define HASUNSETENV 1 /* has unsetenv(3) call */ # include # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ +# ifndef LA_TYPE +# define LA_TYPE LA_SUBR +# endif #endif /* @@ -259,7 +274,6 @@ typedef int pid_t; */ #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 @@ -277,15 +291,10 @@ typedef int pid_t; /* 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 */ -# ifndef LA_TYPE -# define LA_TYPE LA_SUBR -# endif #endif /* general System V defines */ @@ -437,7 +446,9 @@ struct utsname #ifdef HASFLOCK # include -#else +#endif + +#ifndef LOCK_SH # define LOCK_SH 0x01 /* shared lock */ # define LOCK_EX 0x02 /* exclusive lock */ # define LOCK_NB 0x04 /* non-blocking lock */