xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 67967)
19147Seric /*
234920Sbostic  * Copyright (c) 1983 Eric P. Allman
362522Sbostic  * Copyright (c) 1988, 1993
462522Sbostic  *	The Regents of the University of California.  All rights reserved.
533728Sbostic  *
642825Sbostic  * %sccs.include.redist.c%
733728Sbostic  *
8*67967Seric  *	@(#)conf.h	8.123 (Berkeley) 11/22/94
933728Sbostic  */
109147Seric 
1122726Sdist /*
1222726Sdist **  CONF.H -- All user-configurable parameters for sendmail
1322726Sdist */
149147Seric 
1557232Seric # include <sys/param.h>
1664705Seric # include <sys/types.h>
1759389Seric # include <sys/stat.h>
1864380Seric # include <sys/file.h>
1964500Seric # include <sys/wait.h>
2058689Seric # include <fcntl.h>
2164035Seric # include <signal.h>
2257232Seric 
2363902Seric /**********************************************************************
249147Seric **  Table sizes, etc....
259147Seric **	There shouldn't be much need to change these....
2663902Seric **********************************************************************/
279147Seric 
2859303Seric # define MAXLINE	2048		/* max line length */
2924945Seric # define MAXNAME	256		/* max length of a name */
309147Seric # define MAXPV		40		/* max # of parms to mailers */
3159303Seric # define MAXATOM	200		/* max atoms per address */
329147Seric # define MAXMAILERS	25		/* maximum mailers known to system */
3357143Seric # define MAXRWSETS	100		/* max # of sets of rewriting rules */
349147Seric # define MAXPRIORITIES	25		/* max values for Precedence: field */
3557143Seric # define MAXMXHOSTS	20		/* max # of MX records */
3652106Seric # define SMTPLINELIM	990		/* maximum SMTP line length */
3757232Seric # define MAXKEY		128		/* maximum size of a database key */
3857232Seric # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
3959056Seric # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
4059667Seric # define MAXALIASDB	12		/* max # of alias databases */
4167729Seric # define MAXMAPSTACK	12		/* max # of stacked or sequenced maps */
4267729Seric # define MAXTOCLASS	8		/* max # of message timeout classes */
4357143Seric 
4457143Seric # ifndef QUEUESIZE
4557143Seric # define QUEUESIZE	1000		/* max # of jobs per queue run */
4657143Seric # endif
4757143Seric 
4863902Seric /**********************************************************************
499147Seric **  Compilation options.
5025673Seric **
5125673Seric **	#define these if they are available; comment them out otherwise.
5263902Seric **********************************************************************/
539147Seric 
5425673Seric # define LOG		1	/* enable logging */
5525673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
5664813Seric # define NETUNIX	1	/* include unix domain support */
5758778Seric # define NETINET	1	/* include internet support */
5853735Seric # define MATCHGECOS	1	/* match user names from gecos field */
5963753Seric # define XDEBUG		1	/* enable extended debugging */
6056337Seric # ifdef NEWDB
6156337Seric # define USERDB		1	/* look in user database (requires NEWDB) */
6256337Seric # endif
6356337Seric 
6466334Seric /**********************************************************************
6566334Seric **  0/1 Compilation options.
6666334Seric **	#define these to 1 if they are available;
6766334Seric **	#define them to 0 otherwise.
6866334Seric **********************************************************************/
6966334Seric 
7066334Seric # ifndef NAMED_BIND
7166334Seric #  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
7266334Seric # endif
7366334Seric 
7464032Seric /*
7564944Seric **  Most systems have symbolic links today, so default them on.  You
7664944Seric **  can turn them off by #undef'ing this below.
7764944Seric */
7864944Seric 
7964944Seric # define HASLSTAT	1	/* has lstat(2) call */
8064944Seric 
8164962Seric /*
8264962Seric **  General "standard C" defines.
8364962Seric **
8464962Seric **	These may be undone later, to cope with systems that claim to
8564962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
8664962Seric **	doesn't realize that the library is part of the language.
8764962Seric **
8864962Seric **	Life would be much easier if we could get rid of this sort
8964962Seric **	of bozo problems.
9064962Seric */
9164962Seric 
9264962Seric #ifdef __STDC__
9364962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
9464962Seric #endif
9564962Seric 
9663902Seric /**********************************************************************
9759023Seric **  Operating system configuration.
9859023Seric **
9959023Seric **	Unless you are porting to a new OS, you shouldn't have to
10059023Seric **	change these.
10163902Seric **********************************************************************/
10256823Seric 
10363787Seric /*
10463787Seric **  Per-Operating System defines
10563787Seric */
10663787Seric 
10764314Seric 
10863902Seric /*
10965565Seric **  HP-UX -- tested for 8.07, 9.00, and 9.01.
11063902Seric */
11163902Seric 
11267626Seric #ifdef __hpux
11364727Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HP 300 */
11464727Seric # undef m_flags
11563787Seric # define SYSTEM5	1	/* include all the System V defines */
11664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
11764035Seric # define HASSETREUID	1	/* has setreuid(2) call */
11865982Seric # define setreuid(r, e)		setresuid(r, e, -1)
11963962Seric # define LA_TYPE	LA_FLOAT
12065749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
12165354Seric # define GIDSET_T	gid_t
12263962Seric # define _PATH_UNIX	"/hp-ux"
12365354Seric # ifndef _PATH_SENDMAILCF
12465354Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
12565354Seric # endif
12665167Seric # ifndef IDENTPROTO
12765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
12856823Seric # endif
12965581Seric # ifndef HASGETUSERSHELL
13065581Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
13165581Seric # endif
13265504Seric # define syslog		hard_syslog
13365581Seric # ifdef __STDC__
13465581Seric extern int	syslog(int, char *, ...);
13565167Seric # endif
13667626Seric #endif
13756823Seric 
13864314Seric 
13963902Seric /*
14063902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
14163902Seric */
14263902Seric 
14367626Seric #ifdef _AIX3
14464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
14564840Seric # define HASUNAME	1	/* use System V uname(2) system call */
14665211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
14760219Seric # define FORK		fork	/* no vfork primitive available */
14865749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
14967771Seric # define SPT_PADCHAR	'\0'	/* pad process title with nulls */
15067626Seric #endif
15160219Seric 
15264314Seric 
15363902Seric /*
15463902Seric **  Silicon Graphics IRIX
15563902Seric **
15663965Seric **	Compiles on 4.0.1.
157*67967Seric **
158*67967Seric **	Use IRIX64 instead of IRIX for 64-bit IRIX.
159*67967Seric **
160*67967Seric **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
16163902Seric */
16263902Seric 
163*67967Seric #ifdef IRIX64
164*67967Seric # define IRIX
165*67967Seric #endif
166*67967Seric 
16767626Seric #ifdef IRIX
16866763Seric # define SYSTEM5	1	/* this is a System-V derived system */
16964035Seric # define HASSETREUID	1	/* has setreuid(2) call */
17064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
17165211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
17263753Seric # define FORK		fork	/* no vfork primitive available */
17364562Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
17464155Seric # define setpgid	BSDsetpgrp
17563937Seric # define GIDSET_T	gid_t
17665749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
17766763Seric # define LA_TYPE	LA_INT
178*67967Seric # ifdef IRIX64
179*67967Seric #  define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
180*67967Seric # else
181*67967Seric #  define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
182*67967Seric # endif
18367626Seric #endif
18463753Seric 
18563902Seric 
18663902Seric /*
18764813Seric **  SunOS and Solaris
18864813Seric **
18964813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
19064813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
19163902Seric */
19263902Seric 
19363787Seric #if defined(sun) && !defined(BSD)
19459074Seric 
19564035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
19664813Seric # define HASUNAME	1	/* use System V uname(2) system call */
19765211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
19865749Seric # define LA_TYPE	LA_INT
19960564Seric 
20064842Seric # ifdef SOLARIS_2_3
20164842Seric #  define SOLARIS
20264842Seric # endif
20364842Seric 
20460602Seric # ifdef SOLARIS
20563902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
20665222Seric #  ifndef __svr4__
20765222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
20865222Seric #  endif
20963787Seric #  include <sys/time.h>
21064832Seric #  define gethostbyname	solaris_gethostbyname	/* get working version */
21164832Seric #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
21265172Seric #  define GIDSET_T	gid_t
21365189Seric #  ifndef _PATH_UNIX
21467129Seric #   define _PATH_UNIX	"/dev/ksyms"
21565189Seric #  endif
21663962Seric #  ifndef _PATH_SENDMAILCF
21763962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
21864072Seric #  endif
21964072Seric #  ifndef _PATH_SENDMAILPID
22063962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
22163962Seric #  endif
22266022Seric #  ifndef SYSLOG_BUFSIZE
22366022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
22466022Seric #  endif
22563787Seric 
22660602Seric # else
22765105Seric 			/* SunOS 4.0.3 or 4.1.x */
22865189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
22965830Seric #  ifndef HASFLOCK
23065830Seric #   define HASFLOCK	1	/* has flock(2) call */
23165830Seric #  endif
23265749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
23360564Seric #  include <vfork.h>
23463787Seric 
23565105Seric #  ifdef SUNOS403
23665105Seric 			/* special tweaking for SunOS 4.0.3 */
23765105Seric #   include <malloc.h>
23865105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
23965105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
24065105Seric #   undef WIFEXITED
24165105Seric #   undef WEXITSTATUS
24265105Seric #   undef HASUNAME
24365105Seric #   define setpgid	setpgrp
24465105Seric typedef int		pid_t;
24565105Seric extern char		*getenv();
24665105Seric 
24766732Seric #  else
24866732Seric 			/* 4.1.x specifics */
24966732Seric #   define HASSETSID	1	/* has Posix setsid(2) call */
25066732Seric #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
25166732Seric 
25265105Seric #  endif
25360564Seric # endif
25459023Seric #endif
25559023Seric 
25664718Seric /*
25764813Seric **  DG/UX
25864813Seric **
25967427Seric **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
26067427Seric **	older support.
26167427Seric **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
26264718Seric */
26364314Seric 
26467427Seric #ifdef DGUX_5_4_2
26567427Seric # define DGUX		1
26667427Seric #endif
26767427Seric 
26864718Seric #ifdef	DGUX
26964718Seric # define SYSTEM5	1
27064718Seric # define LA_TYPE	LA_SUBR
27164718Seric # define HASSETREUID	1	/* has setreuid(2) call */
27264718Seric # define HASUNAME	1	/* use System V uname(2) system call */
27364718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
27464718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
27566036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
27665167Seric # ifndef IDENTPROTO
27765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
27865167Seric # endif
27967771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
28065749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
28164813Seric 
28264813Seric /* these include files must be included early on DG/UX */
28364813Seric # include <netinet/in.h>
28464813Seric # include <arpa/inet.h>
28564813Seric 
28667427Seric # ifdef DGUX_5_4_2
28767427Seric #  define inet_addr	dgux_inet_addr
28864718Seric extern long	dgux_inet_addr();
28967427Seric # endif
29064718Seric #endif
29164718Seric 
29264718Seric 
29363902Seric /*
29463902Seric **  Digital Ultrix 4.2A or 4.3
29564264Seric **
29664264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
29764264Seric **	not dropped when the process exits.  This causes major problems,
29864264Seric **	so flock is the only alternative.
29963902Seric */
30063902Seric 
30160564Seric #ifdef ultrix
30264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
30363962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
30464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
30566242Seric # define HASUNAME	1	/* use System V uname(2) system call */
30665830Seric # ifndef HASFLOCK
30765830Seric #  define HASFLOCK	1	/* has flock(2) call */
30865830Seric # endif
30965211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
31066318Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
31165135Seric # ifdef vax
31265135Seric #  define LA_TYPE	LA_FLOAT
31365135Seric # else
31465135Seric #  define LA_TYPE	LA_INT
31565135Seric #  define LA_AVENRUN	"avenrun"
31665135Seric # endif
31765749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
31865167Seric # ifndef IDENTPROTO
31965167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
32065167Seric # endif
32160564Seric #endif
32260564Seric 
32364314Seric 
32463902Seric /*
32563902Seric **  OSF/1 (tested on Alpha)
32663902Seric */
32763902Seric 
32863787Seric #ifdef __osf__
32963962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
33064035Seric # define HASSETREUID	1	/* has setreuid(2) call */
33164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
33266226Seric # ifndef HASFLOCK
33365830Seric #  define HASFLOCK	1	/* has flock(2) call */
33465830Seric # endif
33563962Seric # define LA_TYPE	LA_INT
33665749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
33764813Seric # ifndef _PATH_SENDMAILPID
33865504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
33964813Seric # endif
34059287Seric #endif
34159287Seric 
34264314Seric 
34363902Seric /*
34463902Seric **  NeXTstep
34563902Seric */
34663902Seric 
34764076Seric #ifdef NeXT
34864035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
34965830Seric # ifndef HASFLOCK
35065830Seric #  define HASFLOCK	1	/* has flock(2) call */
35165830Seric # endif
35264125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
35364563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
35463753Seric # define sleep		sleepX
35564155Seric # define setpgid	setpgrp
35664295Seric # ifndef LA_TYPE
35764295Seric #  define LA_TYPE	LA_MACH
35864295Seric # endif
35965749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
36064500Seric # ifndef _POSIX_SOURCE
36164035Seric typedef int		pid_t;
36264500Seric #  undef WEXITSTATUS
36364500Seric #  undef WIFEXITED
36464500Seric # endif
36564072Seric # ifndef _PATH_SENDMAILCF
36664072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
36764072Seric # endif
36864072Seric # ifndef _PATH_SENDMAILPID
36964072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
37064072Seric # endif
37159288Seric #endif
37259288Seric 
37364314Seric 
37463902Seric /*
37563962Seric **  4.4 BSD
37664831Seric **
37764831Seric **	See also BSD defines.
37863902Seric */
37963902Seric 
38060568Seric #ifdef BSD4_4
38164072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
38260568Seric # include <sys/cdefs.h>
38363838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
38464072Seric # ifndef LA_TYPE
38564072Seric #  define LA_TYPE	LA_SUBR
38664072Seric # endif
38765749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
38867771Seric # define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
38960568Seric #endif
39060568Seric 
39164314Seric 
39263902Seric /*
39365982Seric **  BSD/386 (all versions)
39465982Seric **	From Tony Sanders, BSDI
39565982Seric */
39665982Seric 
39765982Seric #ifdef __bsdi__
39865982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
39965982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
40066843Seric # include <sys/cdefs.h>
40166843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
40266030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
40366843Seric # ifndef LA_TYPE
40466843Seric #  define LA_TYPE	LA_SUBR
40566843Seric # endif
40665982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
40766843Seric 			/* version 1.1 or later */
40867771Seric #  undef SPT_TYPE
40967771Seric #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
41066843Seric # else
41166843Seric 			/* version 1.0 or earlier */
41266843Seric #  ifndef OLD_NEWDB
41366843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
41466843Seric #  endif
41567771Seric #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
41665982Seric # endif
41765982Seric #endif
41865982Seric 
41965982Seric 
42065982Seric 
42165982Seric /*
42265049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
42364733Seric **
42464733Seric **  4.3BSD clone, closer to 4.4BSD
42564831Seric **
42664831Seric **	See also BSD defines.
42764733Seric */
42864733Seric 
42965049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
43064733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
43164733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
43266754Seric # ifdef __NetBSD__
43366754Seric #  define HASUNAME	1	/* has uname(2) syscall */
43466754Seric # endif
43564733Seric # include <sys/cdefs.h>
43664733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
43764733Seric # ifndef LA_TYPE
43864733Seric #  define LA_TYPE	LA_SUBR
43964733Seric # endif
44065749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
44164733Seric #endif
44264733Seric 
44364733Seric 
44464733Seric /*
44564813Seric **  Mach386
44664813Seric **
44764813Seric **	For mt Xinu's Mach386 system.
44864813Seric */
44964813Seric 
45064813Seric #if defined(MACH) && defined(i386)
45164813Seric # define MACH386	1
45264813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
45364813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
45466226Seric # ifndef HASFLOCK
45565830Seric #  define HASFLOCK	1	/* has flock(2) call */
45665830Seric # endif
45764813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
45864813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
45964813Seric # define setpgid	setpgrp
46064813Seric # ifndef LA_TYPE
46164813Seric #  define LA_TYPE	LA_FLOAT
46264813Seric # endif
46365749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
46464962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
46564813Seric # undef WEXITSTATUS
46664813Seric # undef WIFEXITED
46764813Seric # ifndef _PATH_SENDMAILCF
46864813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
46964813Seric # endif
47064813Seric # ifndef _PATH_SENDMAILPID
47164813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
47264813Seric # endif
47364813Seric #endif
47464813Seric 
47564813Seric 
47664813Seric /*
47763969Seric **  4.3 BSD -- this is for very old systems
47863969Seric **
47965949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
48065949Seric **
48163969Seric **	You'll also have to install a new resolver library.
48263969Seric **	I don't guarantee that support for this environment is complete.
48363969Seric */
48463969Seric 
48565949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
48663969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
48763969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
48863970Seric # define ARBPTR_T	char *
48964155Seric # define setpgid	setpgrp
49063969Seric # ifndef LA_TYPE
49163969Seric #  define LA_TYPE	LA_FLOAT
49263969Seric # endif
49363969Seric # ifndef _PATH_SENDMAILCF
49463969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
49563969Seric # endif
49665167Seric # ifndef IDENTPROTO
49765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
49865167Seric # endif
49964834Seric # undef WEXITSTATUS
50064834Seric # undef WIFEXITED
50164834Seric typedef short		pid_t;
50264834Seric extern int		errno;
50363969Seric #endif
50463969Seric 
50564314Seric 
50663969Seric /*
50763902Seric **  SCO Unix
50865087Seric **
50965087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
51065087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
51165087Seric **	The second is, I believe, for an older version.
51263902Seric */
51363902Seric 
51465087Seric #ifdef _SCO_unix_4_2
51565087Seric # define _SCO_unix_
51665087Seric # define HASSETREUID	1	/* has setreuid(2) call */
51766757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
51865087Seric # define _PATH_UNIX	"/unix"
51965087Seric # ifndef _PATH_SENDMAILCF
52065087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
52165087Seric # endif
52265087Seric # ifndef _PATH_SENDMAILPID
52365087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
52465087Seric # endif
52565087Seric #endif
52665087Seric 
52763838Seric #ifdef _SCO_unix_
52863838Seric # define SYSTEM5	1	/* include all the System V defines */
52964035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
53065212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
53163838Seric # define FORK		fork
53263838Seric # define MAXPATHLEN	PATHSIZE
53364718Seric # define LA_TYPE	LA_SHORT
53467812Seric # define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
53567608Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
53664813Seric # undef NETUNIX			/* no unix domain socket support */
53763838Seric #endif
53863838Seric 
53964314Seric 
54063962Seric /*
54163962Seric **  ConvexOS 11.0 and later
54265949Seric **
54365949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
54465949Seric **	works on 9.1 as well.
54563962Seric */
54663962Seric 
54763962Seric #ifdef _CONVEX_SOURCE
54863977Seric # define BSD		1	/* include all the BSD defines */
54963977Seric # define HASUNAME	1	/* use System V uname(2) system call */
55063962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
55163977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
55263962Seric # define LA_TYPE	LA_FLOAT
55365749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
55465949Seric # ifndef _PATH_SENDMAILCF
55565949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
55665949Seric # endif
55765949Seric # ifndef S_IREAD
55865949Seric #  define S_IREAD	_S_IREAD
55965949Seric #  define S_IWRITE	_S_IWRITE
56065949Seric #  define S_IEXEC	_S_IEXEC
56165949Seric #  define S_IFMT	_S_IFMT
56265949Seric #  define S_IFCHR	_S_IFCHR
56365949Seric #  define S_IFBLK	_S_IFBLK
56465949Seric # endif
56565167Seric # ifndef IDENTPROTO
56665167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
56765167Seric # endif
56863962Seric #endif
56963962Seric 
57064314Seric 
57163962Seric /*
57264999Seric **  RISC/os 4.52
57363962Seric **
57464999Seric **	Gives a ton of warning messages, but otherwise compiles.
57563962Seric */
57663962Seric 
57763965Seric #ifdef RISCOS
57864999Seric 
57963962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
58066226Seric # ifndef HASFLOCK
58165830Seric #  define HASFLOCK	1	/* has flock(2) call */
58265830Seric # endif
58364999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
58464999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
58563962Seric # define LA_TYPE	LA_INT
58663962Seric # define LA_AVENRUN	"avenrun"
58763962Seric # define _PATH_UNIX	"/unix"
58864999Seric # undef WIFEXITED
58964999Seric 
59064999Seric # define setpgid	setpgrp
59164999Seric 
59264999Seric extern int		errno;
59364999Seric typedef int		pid_t;
59464999Seric #define			SIGFUNC_DEFINED
59564999Seric typedef int		(*sigfunc_t)();
59664999Seric extern char		*getenv();
59764999Seric extern void		*malloc();
59864999Seric 
59963962Seric #endif
60063962Seric 
60164314Seric 
60264155Seric /*
60364155Seric **  Linux 0.99pl10 and above...
60466300Seric **
60566300Seric **  Thanks to, in reverse order of contact:
60666300Seric **
60767885Seric **	Andrew Pam <avatar@aus.xanadu.com>
60866300Seric **	John Kennedy <warlock@csuchico.edu>
60966300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
61066300Seric **	Karl London <karl@borg.demon.co.uk>
61166300Seric **
61266300Seric **  Last compiled against:	[03/02/94 @ 05:34 PM (Wednesday)]
61366300Seric **	sendmail 8.6.6.b9	named 4.9.2-931205-p1	db-1.73
61466300Seric **	gcc 2.5.8		libc.so.4.5.19
61566300Seric **	slackware 1.1.2		linux 0.99.15
61664155Seric */
61764155Seric 
61864770Seric #ifdef __linux__
61966298Seric # define BSD		1	/* include BSD defines */
62064155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
62166298Seric # define HASUNAME	1	/* use System V uname(2) system call */
62264380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
62366298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
62466300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
62567885Seric # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
62664155Seric # ifndef LA_TYPE
62766301Seric #  define LA_TYPE	LA_PROCSTR
62864155Seric # endif
62966300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
63064763Seric # include <sys/sysmacros.h>
63166300Seric # undef atol			/* wounded in <stdlib.h> */
63264155Seric #endif
63364155Seric 
63464155Seric 
63564345Seric /*
63664345Seric **  DELL SVR4 Issue 2.2, and others
63764345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
63864345Seric **
63964345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
64064345Seric **	defined, and the definitions conflict.
64164924Seric **
64264924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
64364924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
64464924Seric **	(SVR4.0/386 version 3.0).
64564345Seric */
64664345Seric 
64764345Seric #ifdef DELL_SVR4
64865189Seric 				/* no changes necessary */
64965189Seric 				/* see general __svr4__ defines below */
65064345Seric #endif
65164345Seric 
65264345Seric 
65364380Seric /*
65464380Seric **  Apple A/UX 3.0
65564380Seric */
65664345Seric 
65764380Seric #ifdef _AUX_SOURCE
65864729Seric # include <sys/sysmacros.h>
65964380Seric # define BSD			/* has BSD routines */
66064380Seric # define HASUNAME	1	/* use System V uname(2) system call */
66164380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
66264561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
66365167Seric # ifndef IDENTPROTO
66465167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
66565167Seric # endif
66664380Seric # define FORK		fork
66764380Seric # ifndef _PATH_SENDMAILCF
66864380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
66964380Seric # endif
67064380Seric # ifndef LA_TYPE
67164380Seric #  define LA_TYPE	LA_ZERO
67264380Seric # endif
67365749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
67464560Seric # undef WIFEXITED
67564560Seric # undef WEXITSTATUS
67664380Seric #endif
67764380Seric 
67864380Seric 
67964705Seric /*
68064705Seric **  Encore UMAX V
68164705Seric **
68264705Seric **	Not extensively tested.
68364705Seric */
68464380Seric 
68564705Seric #ifdef UMAXV
68664705Seric # include <limits.h>
68764705Seric # define HASUNAME	1	/* use System V uname(2) system call */
68864705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
68964705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
69065211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
69164705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
69264705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
69364705Seric # define FORK		fork	/* no vfork(2) primitive available */
69465749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
69564705Seric # define MAXPATHLEN	PATH_MAX
69664705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
69764705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
69864705Seric # undef WIFEXITED
69964705Seric # undef WEXITSTATUS
70064705Seric #endif
70164705Seric 
70264705Seric 
70364939Seric /*
70464939Seric **  Stardent Titan 3000 running TitanOS 4.2.
70564939Seric **
70664939Seric **	Must be compiled in "cc -43" mode.
70764939Seric **
70864944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
70964939Seric **
71064939Seric **	Note the tweaking below after the BSD defines are set.
71164939Seric */
71264705Seric 
71364939Seric #ifdef titan
71464939Seric # define setpgid	setpgrp
71564939Seric typedef int		pid_t;
71664939Seric # undef WIFEXITED
71764939Seric # undef WEXITSTATUS
71864939Seric #endif
71964939Seric 
72064939Seric 
72164962Seric /*
72264962Seric **  Sequent DYNIX 3.2.0
72364962Seric **
72464962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
72564962Seric */
72664939Seric 
72764962Seric #ifdef sequent
72866038Seric 
72964962Seric # define BSD		1
73064962Seric # define HASUNSETENV	1
73164962Seric # define BSD4_3		1	/* to get signal() in conf.c */
73264962Seric # define WAITUNION	1
73364962Seric # define LA_TYPE	LA_FLOAT
73464962Seric # ifdef	_POSIX_VERSION
73564962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
73664962Seric # endif
73764962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
73864962Seric # define setpgid	setpgrp
73964962Seric 
74064962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
74164962Seric # undef	WIFEXITED
74264962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
74364962Seric 			 ((union wait*)&(s))->w_termsig == 0)
74464962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
74564962Seric typedef int		pid_t;
74664962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
74764962Seric 
74866144Seric # ifndef IDENTPROTO
74966144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
75066144Seric # endif
75166144Seric 
75264962Seric # ifndef _PATH_UNIX
75364962Seric #  define _PATH_UNIX	"/dynix"
75464962Seric # endif
75564962Seric # ifndef _PATH_SENDMAILCF
75664962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
75764962Seric # endif
75864962Seric 
75964962Seric #endif
76064962Seric 
76164962Seric 
76265748Seric /*
76366038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
76466038Seric **
76566038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
76666038Seric **
76766038Seric **	From Tim Wright <timw@sequent.com>.
76866038Seric */
76966038Seric 
77066038Seric #ifdef _SEQUENT_
77166038Seric # define SYSTEM5	1	/* include all the System V defines */
77266038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
77366038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
77466038Seric # define HASSETREUID	1	/* has setreuid(2) call */
77566038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
77666038Seric # define GIDSET_T	gid_t
77766038Seric # define LA_TYPE	LA_INT
77866038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
77967771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
78066144Seric # ifndef IDENTPROTO
78166144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
78266144Seric # endif
78366038Seric # ifndef _PATH_SENDMAILCF
78466038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
78566038Seric # endif
78666038Seric # ifndef _PATH_SENDMAILPID
78766038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
78866038Seric # endif
78966038Seric #endif
79066038Seric 
79166038Seric 
79266038Seric /*
79365748Seric **  Cray Unicos
79465748Seric **
79565748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
79665748Seric */
79764962Seric 
79865748Seric #ifdef UNICOS
79965748Seric # define SYSTEM5	1	/* include all the System V defines */
80065748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
80165748Seric # define MAXPATHLEN	PATHSIZE
80265748Seric # define LA_TYPE	LA_ZERO
80365749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
80465748Seric #endif
80564962Seric 
80665748Seric 
80765820Seric /*
80865820Seric **  Apollo DomainOS
80965820Seric **
81065820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
81165982Seric **
81265820Seric **  15 Jan 1994
81365820Seric **
81465820Seric */
81565748Seric 
81665820Seric #ifdef apollo
81765820Seric # define HASSETREUID	1	/* has setreuid(2) call */
81865820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
81967771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
82065820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
82166044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
82265820Seric # ifndef _PATH_SENDMAILCF
82365820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
82465820Seric # endif
82565820Seric # ifndef _PATH_SENDMAILPID
82665820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
82765820Seric # endif
82865820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
82965820Seric # undef  S_IFIFO
83065820Seric # define S_IFIFO	0010000
83165820Seric # ifndef IDENTPROTO
83265820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
83365820Seric # endif
83465982Seric #endif
83565820Seric 
83665820Seric 
83766748Seric /*
83867745Seric **  UnixWare 1.1.2.
83966752Seric **
84066752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
84166752Seric */
84266752Seric 
84366752Seric #ifdef UNIXWARE
84466752Seric # define SYSTEM5		1
84567745Seric # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
84667745Seric # define HASGETDTABLESIZE	1
84767745Seric # define HASSETREUID		1
84867745Seric # define HASSETSID		1
84967745Seric # define HASINITGROUPS		1
85067745Seric # define GIDSET_T		gid_t
85167745Seric # define SLEEP_T		unsigned
85266752Seric # define SFS_TYPE		SFS_STATVFS
85366752Seric # define LA_TYPE		LA_ZERO
85466752Seric # undef WIFEXITED
85566752Seric # undef WEXITSTATUS
85666752Seric # define _PATH_UNIX		"/unix"
85766752Seric # ifndef _PATH_SENDMAILCF
85866752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
85966752Seric # endif
86066752Seric # ifndef _PATH_SENDMAILPID
86166752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
86266752Seric # endif
86366752Seric # define SYSLOG_BUFSIZE	128
86466752Seric #endif
86566752Seric 
86666752Seric 
86766752Seric /*
86866748Seric **  Intergraph CLIX 3.1
86966748Seric **
87066748Seric **	From Paul Southworth <pauls@locust.cic.net>
87166748Seric */
87265820Seric 
87366748Seric #ifdef CLIX
87466748Seric # define SYSTEM5	1	/* looks like System V */
87566752Seric # ifndef HASGETUSERSHELL
87666752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
87766752Seric # endif
87866748Seric # define DEV_BSIZE	512	/* device block size not defined */
87966748Seric # define GIDSET_T	gid_t
88066748Seric # undef LOG			/* syslog not available */
88166748Seric # define NEEDFSYNC	1	/* no fsync in system library */
88266748Seric # define GETSHORT	_getshort
88366748Seric #endif
88465820Seric 
88566748Seric 
88666776Seric /*
88766776Seric **  NCR 3000 Series (SysVr4)
88866776Seric **
88967434Seric **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
89066776Seric */
89166748Seric 
89266776Seric #ifdef NCR3000
89366776Seric # define __svr4__
89466776Seric # undef BSD
89566776Seric # define LA_AVENRUN	"avenrun"
89666776Seric #endif
89766748Seric 
89866776Seric 
89967434Seric /*
90067434Seric **  Tandem NonStop-UX SVR4
90167434Seric **
90267434Seric **	From Rick McCarty <mccarty@mpd.tandem.com>.
90367434Seric */
90466776Seric 
90567434Seric #ifdef NonStop_UX_BXX
90667434Seric # define __svr4__
90767434Seric #endif
90866776Seric 
90967434Seric 
91067488Seric /*
91167488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
91267488Seric **
91367488Seric **	Tested for 1.04 and 1.03
91467488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
91567488Seric */
91667434Seric 
91767488Seric #ifdef __H3050R
91867488Seric # define SYSTEM5	1	/* include all the System V defines */
91967488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
92067488Seric # define setreuid(r, e)	setresuid(r, e, -1)
92167488Seric # define LA_TYPE	LA_FLOAT
92267488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
92367488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
92467488Seric # ifndef GIDSET_T
92567488Seric #  define GIDSET_T	gid_t
92667488Seric # endif
92767488Seric # ifndef _PATH_UNIX
92867488Seric #  define _PATH_UNIX	"/HI-UX"
92967488Seric # endif
93067488Seric # ifndef _PATH_SENDMAILCF
93167488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
93267488Seric # endif
93367488Seric # ifndef IDENTPROTO
93467488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
93567488Seric # endif
93667488Seric # ifndef HASGETUSERSHELL
93767488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
93867488Seric # endif
93967488Seric 
94067488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
94167488Seric # undef m_flags
94267488Seric 
94367488Seric # ifdef __STDC__
94467488Seric extern int	syslog(int, char *, ...);
94567488Seric # endif
94667488Seric 
94767488Seric #endif
94867488Seric 
94967488Seric 
95067488Seric 
95163902Seric /**********************************************************************
95263787Seric **  End of Per-Operating System defines
95363902Seric **********************************************************************/
95463787Seric 
95563949Seric /**********************************************************************
95663949Seric **  More general defines
95763949Seric **********************************************************************/
95863949Seric 
95963962Seric /* general BSD defines */
96063962Seric #ifdef BSD
96164035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
96264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
96367742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
96467430Seric # ifndef HASSETRLIMIT
96567430Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
96667430Seric # endif
96765830Seric # ifndef HASFLOCK
96865830Seric #  define HASFLOCK	1	/* has flock(2) call */
96965830Seric # endif
97067602Seric # ifndef TZ_TYPE
97167608Seric #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
97267602Seric # endif
97363962Seric #endif
97463962Seric 
97565189Seric /* general System V Release 4 defines */
97665189Seric #ifdef __svr4__
97765189Seric # define SYSTEM5	1
97865189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
97967742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
98067742Seric # ifndef HASSETRLIMIT
98167742Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
98267742Seric # endif
98365211Seric # ifndef HASGETUSERSHELL
98465211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
98565210Seric # endif
98665189Seric # define setreuid(r, e)	seteuid(e)
98765189Seric 
98865189Seric # ifndef _PATH_UNIX
98965189Seric #  define _PATH_UNIX		"/unix"
99065189Seric # endif
99165189Seric # ifndef _PATH_SENDMAILCF
99265189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
99365189Seric # endif
99465189Seric # ifndef _PATH_SENDMAILPID
99565189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
99665189Seric # endif
99765189Seric # ifndef SYSLOG_BUFSIZE
99865189Seric #  define SYSLOG_BUFSIZE	128
99965189Seric # endif
100067159Seric # ifndef SFS_TYPE
100167159Seric #  define SFS_TYPE		SFS_STATVFS
100267159Seric # endif
100365189Seric #endif
100465189Seric 
100563787Seric /* general System V defines */
100666298Seric #ifdef SYSTEM5
100764813Seric # include <sys/sysmacros.h>
100863949Seric # define HASUNAME	1	/* use System V uname(2) system call */
100964705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
101064962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
101167430Seric # ifndef HASULIMIT
101267430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
101367430Seric # endif
101463962Seric # ifndef LA_TYPE
101565749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
101663962Seric # endif
101765749Seric # ifndef SFS_TYPE
101865749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
101965749Seric # endif
102067602Seric # ifndef TZ_TYPE
102167608Seric #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
102267602Seric # endif
102363949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
102463949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
102563949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
102666298Seric #endif
102763787Seric 
102863949Seric /* general POSIX defines */
102963949Seric #ifdef _POSIX_VERSION
103064718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
103164718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
103263949Seric #endif
103363949Seric 
103463787Seric /*
103563937Seric **  If no type for argument two of getgroups call is defined, assume
103663937Seric **  it's an integer -- unfortunately, there seem to be several choices
103763937Seric **  here.
103863937Seric */
103963937Seric 
104063937Seric #ifndef GIDSET_T
104163937Seric # define GIDSET_T	int
104263937Seric #endif
104363937Seric 
104464939Seric /*
104564939Seric **  Tweaking for systems that (for example) claim to be BSD but
104664939Seric **  don't have all the standard BSD routines (boo hiss).
104764939Seric */
104864439Seric 
104964939Seric #ifdef titan
105064939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
105164939Seric #endif
105264939Seric 
105365830Seric 
105465167Seric /*
105565167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
105665167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
105765167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
105865167Seric **  are closed.  Some firewalls return this error if you try to connect
105965167Seric **  to the IDENT port (113), so you can't receive email from these hosts
106065167Seric **  on these systems.  The firewall really should use a more specific
106165167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
106265167Seric **  not explicitly set to zero above, default it on.
106365167Seric */
106464939Seric 
106565167Seric #ifndef IDENTPROTO
106665167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
106765167Seric #endif
106865167Seric 
106965211Seric #ifndef HASGETUSERSHELL
107065211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
107165210Seric #endif
107265167Seric 
107365830Seric #ifndef HASFLOCK
107465830Seric # define HASFLOCK	0	/* assume no flock(2) support */
107565830Seric #endif
107665210Seric 
107767430Seric #ifndef HASSETRLIMIT
107867430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
107967430Seric #endif
108067430Seric 
108167430Seric #ifndef HASULIMIT
108267430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
108367430Seric #endif
108467430Seric 
108566843Seric #ifndef OLD_NEWDB
108666843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
108766843Seric #endif
108865830Seric 
108966843Seric 
109064439Seric /**********************************************************************
109159023Seric **  Remaining definitions should never have to be changed.  They are
109259023Seric **  primarily to provide back compatibility for older systems -- for
109359287Seric **  example, it includes some POSIX compatibility definitions
109464439Seric **********************************************************************/
109559023Seric 
109659388Seric /* System 5 compatibility */
109759388Seric #ifndef S_ISREG
109864944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
109959388Seric #endif
110064944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
110164944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
110264944Seric #endif
110359388Seric #ifndef S_IWGRP
110459388Seric #define S_IWGRP		020
110559388Seric #endif
110659388Seric #ifndef S_IWOTH
110759388Seric #define S_IWOTH		002
110859388Seric #endif
110959388Seric 
111059023Seric /*
111150537Seric **  Older systems don't have this error code -- it should be in
111250537Seric **  /usr/include/sysexits.h.
111350537Seric */
111450537Seric 
111550537Seric # ifndef EX_CONFIG
111650537Seric # define EX_CONFIG	78	/* configuration error */
111750537Seric # endif
111856852Seric 
111964718Seric /* pseudo-code used in server SMTP */
112064718Seric # define EX_QUIT	22	/* drop out of server immediately */
112164718Seric 
112264718Seric 
112363993Seric /*
112463993Seric **  These are used in a few cases where we need some special
112563993Seric **  error codes, but where the system doesn't provide something
112663993Seric **  reasonable.  They are printed in errstring.
112763993Seric */
112863993Seric 
112963993Seric #ifndef E_PSEUDOBASE
113063993Seric # define E_PSEUDOBASE	256
113163993Seric #endif
113263993Seric 
113363993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
113463993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
113563993Seric 
113663970Seric /* type of arbitrary pointer */
113763970Seric #ifndef ARBPTR_T
113863970Seric # define ARBPTR_T	void *
113963970Seric #endif
114063970Seric 
114160568Seric #ifndef __P
114260568Seric # include "cdefs.h"
114360568Seric #endif
114460568Seric 
114567421Seric #if NAMED_BIND
114667421Seric # include <arpa/nameser.h>
114767434Seric # ifdef __svr4__
114867434Seric #  ifdef NOERROR
114967434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
115067434Seric #  endif
115167434Seric # endif
115267421Seric #endif
115367421Seric 
115456852Seric /*
115567419Seric **  The size of an IP address -- can't use sizeof because of problems
115667419Seric **  on Crays, where everything is 64 bits.  This will break if/when
115767419Seric **  IP addresses are expanded to eight bytes.
115867419Seric */
115967419Seric 
116067421Seric #ifndef INADDRSZ
116167421Seric # define INADDRSZ	4
116267421Seric #endif
116367419Seric 
116467419Seric /*
116567421Seric **  The size of various known types -- for reading network protocols.
116667421Seric **  Again, we can't use sizeof because of compiler randomness.
116767421Seric */
116867421Seric 
116967421Seric #ifndef INT16SZ
117067421Seric # define INT16SZ	2
117167421Seric #endif
117267421Seric #ifndef INT32SZ
117367421Seric # define INT32SZ	4
117467421Seric #endif
117567421Seric 
117667421Seric /*
117758778Seric **  Do some required dependencies
117858778Seric */
117958778Seric 
118058778Seric #if defined(NETINET) || defined(NETISO)
118159107Seric # define SMTP		1	/* enable user and server SMTP */
118259107Seric # define QUEUE		1	/* enable queueing */
118359107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
118458778Seric #endif
118558778Seric 
118658778Seric 
118758778Seric /*
118856852Seric **  Arrange to use either varargs or stdargs
118956852Seric */
119056852Seric 
119156852Seric # ifdef __STDC__
119256852Seric 
119356852Seric # include <stdarg.h>
119456852Seric 
119556852Seric # define VA_LOCAL_DECL	va_list ap;
119656852Seric # define VA_START(f)	va_start(ap, f)
119756852Seric # define VA_END		va_end(ap)
119856852Seric 
119956852Seric # else
120056852Seric 
120156852Seric # include <varargs.h>
120256852Seric 
120356852Seric # define VA_LOCAL_DECL	va_list ap;
120456852Seric # define VA_START(f)	va_start(ap)
120556852Seric # define VA_END		va_end(ap)
120656852Seric 
120756852Seric # endif
120857631Seric 
120957943Seric #ifdef HASUNAME
121057631Seric # include <sys/utsname.h>
121157631Seric # ifdef newstr
121257631Seric #  undef newstr
121357631Seric # endif
121457943Seric #else /* ! HASUNAME */
121557631Seric # define NODE_LENGTH 32
121657631Seric struct utsname
121757631Seric {
121857631Seric 	char nodename[NODE_LENGTH+1];
121957631Seric };
122057943Seric #endif /* HASUNAME */
122157642Seric 
122267434Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX)
122363838Seric # define MAXHOSTNAMELEN	256
122457735Seric #endif
122558153Seric 
122658153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
122758153Seric # define SIGCHLD	SIGCLD
122858153Seric #endif
122958153Seric 
123058153Seric #ifndef STDIN_FILENO
123158153Seric #define STDIN_FILENO	0
123258153Seric #endif
123358153Seric 
123458153Seric #ifndef STDOUT_FILENO
123558153Seric #define STDOUT_FILENO	1
123658153Seric #endif
123758153Seric 
123858153Seric #ifndef STDERR_FILENO
123958153Seric #define STDERR_FILENO	2
124058153Seric #endif
124158689Seric 
124264072Seric #ifndef LOCK_SH
124364035Seric # define LOCK_SH	0x01	/* shared lock */
124464035Seric # define LOCK_EX	0x02	/* exclusive lock */
124564035Seric # define LOCK_NB	0x04	/* non-blocking lock */
124664035Seric # define LOCK_UN	0x08	/* unlock */
124764035Seric #endif
124858692Seric 
124964035Seric #ifndef SIG_ERR
125064035Seric # define SIG_ERR	((void (*)()) -1)
125158689Seric #endif
125258702Seric 
125364500Seric #ifndef WEXITSTATUS
125464500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
125564500Seric #endif
125664500Seric #ifndef WIFEXITED
125764500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
125864500Seric #endif
125964500Seric 
126064561Seric #ifndef SIGFUNC_DEFINED
126164561Seric typedef void		(*sigfunc_t) __P((int));
126264561Seric #endif
126364561Seric 
126465053Seric /* size of syslog buffer */
126565053Seric #ifndef SYSLOG_BUFSIZE
126665053Seric # define SYSLOG_BUFSIZE	1024
126765053Seric #endif
126865053Seric 
126958702Seric /*
127058702Seric **  Size of tobuf (deliver.c)
127158702Seric **	Tweak this to match your syslog implementation.  It will have to
127258702Seric **	allow for the extra information printed.
127358702Seric */
127458702Seric 
127558702Seric #ifndef TOBUFSIZE
127665053Seric # if (SYSLOG_BUFSIZE) > 512
127765053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
127865053Seric # else
127965053Seric #  define TOBUFSIZE	256
128065053Seric # endif
128158702Seric #endif
128260219Seric 
128365015Seric /*
128465015Seric **  Size of prescan buffer.
128565015Seric **	Despite comments in the _sendmail_ book, this probably should
128665015Seric **	not be changed; there are some hard-to-define dependencies.
128765015Seric */
128865015Seric 
128965015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
129060219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
129160219Seric # ifndef FORK
129260219Seric # define FORK		vfork		/* function to call to fork mailer */
129360219Seric # endif
129465955Seric 
129565955Seric /*
129665955Seric **  If we are going to link scanf anyway, use it in readcf
129765955Seric */
129865955Seric 
129965955Seric #if !defined(HASUNAME) && !defined(SCANF)
130065955Seric # define SCANF		1
130165955Seric #endif
1302