xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 67812)
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*67812Seric  *	@(#)conf.h	8.121 (Berkeley) 10/15/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.
15763902Seric */
15863902Seric 
15967626Seric #ifdef IRIX
16066763Seric # define SYSTEM5	1	/* this is a System-V derived system */
16164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
16264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
16365211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
16463753Seric # define FORK		fork	/* no vfork primitive available */
16564562Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
16664155Seric # define setpgid	BSDsetpgrp
16763937Seric # define GIDSET_T	gid_t
16865749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
16966763Seric # define LA_TYPE	LA_INT
17067435Seric # define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
17167626Seric #endif
17263753Seric 
17363902Seric 
17463902Seric /*
17564813Seric **  SunOS and Solaris
17664813Seric **
17764813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
17864813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
17963902Seric */
18063902Seric 
18163787Seric #if defined(sun) && !defined(BSD)
18259074Seric 
18364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
18464813Seric # define HASUNAME	1	/* use System V uname(2) system call */
18565211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
18665749Seric # define LA_TYPE	LA_INT
18760564Seric 
18864842Seric # ifdef SOLARIS_2_3
18964842Seric #  define SOLARIS
19064842Seric # endif
19164842Seric 
19260602Seric # ifdef SOLARIS
19363902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
19465222Seric #  ifndef __svr4__
19565222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
19665222Seric #  endif
19763787Seric #  include <sys/time.h>
19864832Seric #  define gethostbyname	solaris_gethostbyname	/* get working version */
19964832Seric #  define gethostbyaddr	solaris_gethostbyaddr	/* get working version */
20065172Seric #  define GIDSET_T	gid_t
20165189Seric #  ifndef _PATH_UNIX
20267129Seric #   define _PATH_UNIX	"/dev/ksyms"
20365189Seric #  endif
20463962Seric #  ifndef _PATH_SENDMAILCF
20563962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
20664072Seric #  endif
20764072Seric #  ifndef _PATH_SENDMAILPID
20863962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
20963962Seric #  endif
21066022Seric #  ifndef SYSLOG_BUFSIZE
21166022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
21266022Seric #  endif
21363787Seric 
21460602Seric # else
21565105Seric 			/* SunOS 4.0.3 or 4.1.x */
21665189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
21765830Seric #  ifndef HASFLOCK
21865830Seric #   define HASFLOCK	1	/* has flock(2) call */
21965830Seric #  endif
22065749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
22160564Seric #  include <vfork.h>
22263787Seric 
22365105Seric #  ifdef SUNOS403
22465105Seric 			/* special tweaking for SunOS 4.0.3 */
22565105Seric #   include <malloc.h>
22665105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
22765105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
22865105Seric #   undef WIFEXITED
22965105Seric #   undef WEXITSTATUS
23065105Seric #   undef HASUNAME
23165105Seric #   define setpgid	setpgrp
23265105Seric typedef int		pid_t;
23365105Seric extern char		*getenv();
23465105Seric 
23566732Seric #  else
23666732Seric 			/* 4.1.x specifics */
23766732Seric #   define HASSETSID	1	/* has Posix setsid(2) call */
23866732Seric #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
23966732Seric 
24065105Seric #  endif
24160564Seric # endif
24259023Seric #endif
24359023Seric 
24464718Seric /*
24564813Seric **  DG/UX
24664813Seric **
24767427Seric **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
24867427Seric **	older support.
24967427Seric **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
25064718Seric */
25164314Seric 
25267427Seric #ifdef DGUX_5_4_2
25367427Seric # define DGUX		1
25467427Seric #endif
25567427Seric 
25664718Seric #ifdef	DGUX
25764718Seric # define SYSTEM5	1
25864718Seric # define LA_TYPE	LA_SUBR
25964718Seric # define HASSETREUID	1	/* has setreuid(2) call */
26064718Seric # define HASUNAME	1	/* use System V uname(2) system call */
26164718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
26264718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
26366036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
26465167Seric # ifndef IDENTPROTO
26565167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
26665167Seric # endif
26767771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
26865749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
26964813Seric 
27064813Seric /* these include files must be included early on DG/UX */
27164813Seric # include <netinet/in.h>
27264813Seric # include <arpa/inet.h>
27364813Seric 
27467427Seric # ifdef DGUX_5_4_2
27567427Seric #  define inet_addr	dgux_inet_addr
27664718Seric extern long	dgux_inet_addr();
27767427Seric # endif
27864718Seric #endif
27964718Seric 
28064718Seric 
28163902Seric /*
28263902Seric **  Digital Ultrix 4.2A or 4.3
28364264Seric **
28464264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
28564264Seric **	not dropped when the process exits.  This causes major problems,
28664264Seric **	so flock is the only alternative.
28763902Seric */
28863902Seric 
28960564Seric #ifdef ultrix
29064035Seric # define HASSETREUID	1	/* has setreuid(2) call */
29163962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
29264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
29366242Seric # define HASUNAME	1	/* use System V uname(2) system call */
29465830Seric # ifndef HASFLOCK
29565830Seric #  define HASFLOCK	1	/* has flock(2) call */
29665830Seric # endif
29765211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
29866318Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
29965135Seric # ifdef vax
30065135Seric #  define LA_TYPE	LA_FLOAT
30165135Seric # else
30265135Seric #  define LA_TYPE	LA_INT
30365135Seric #  define LA_AVENRUN	"avenrun"
30465135Seric # endif
30565749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
30665167Seric # ifndef IDENTPROTO
30765167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
30865167Seric # endif
30960564Seric #endif
31060564Seric 
31164314Seric 
31263902Seric /*
31363902Seric **  OSF/1 (tested on Alpha)
31463902Seric */
31563902Seric 
31663787Seric #ifdef __osf__
31763962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
31864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
31964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
32066226Seric # ifndef HASFLOCK
32165830Seric #  define HASFLOCK	1	/* has flock(2) call */
32265830Seric # endif
32363962Seric # define LA_TYPE	LA_INT
32465749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
32564813Seric # ifndef _PATH_SENDMAILPID
32665504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
32764813Seric # endif
32859287Seric #endif
32959287Seric 
33064314Seric 
33163902Seric /*
33263902Seric **  NeXTstep
33363902Seric */
33463902Seric 
33564076Seric #ifdef NeXT
33664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
33765830Seric # ifndef HASFLOCK
33865830Seric #  define HASFLOCK	1	/* has flock(2) call */
33965830Seric # endif
34064125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
34164563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
34263753Seric # define sleep		sleepX
34364155Seric # define setpgid	setpgrp
34464295Seric # ifndef LA_TYPE
34564295Seric #  define LA_TYPE	LA_MACH
34664295Seric # endif
34765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
34864500Seric # ifndef _POSIX_SOURCE
34964035Seric typedef int		pid_t;
35064500Seric #  undef WEXITSTATUS
35164500Seric #  undef WIFEXITED
35264500Seric # endif
35364072Seric # ifndef _PATH_SENDMAILCF
35464072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
35564072Seric # endif
35664072Seric # ifndef _PATH_SENDMAILPID
35764072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
35864072Seric # endif
35959288Seric #endif
36059288Seric 
36164314Seric 
36263902Seric /*
36363962Seric **  4.4 BSD
36464831Seric **
36564831Seric **	See also BSD defines.
36663902Seric */
36763902Seric 
36860568Seric #ifdef BSD4_4
36964072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
37060568Seric # include <sys/cdefs.h>
37163838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
37264072Seric # ifndef LA_TYPE
37364072Seric #  define LA_TYPE	LA_SUBR
37464072Seric # endif
37565749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
37667771Seric # define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
37760568Seric #endif
37860568Seric 
37964314Seric 
38063902Seric /*
38165982Seric **  BSD/386 (all versions)
38265982Seric **	From Tony Sanders, BSDI
38365982Seric */
38465982Seric 
38565982Seric #ifdef __bsdi__
38665982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
38765982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
38866843Seric # include <sys/cdefs.h>
38966843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
39066030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
39166843Seric # ifndef LA_TYPE
39266843Seric #  define LA_TYPE	LA_SUBR
39366843Seric # endif
39465982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
39566843Seric 			/* version 1.1 or later */
39667771Seric #  undef SPT_TYPE
39767771Seric #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
39866843Seric # else
39966843Seric 			/* version 1.0 or earlier */
40066843Seric #  ifndef OLD_NEWDB
40166843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
40266843Seric #  endif
40367771Seric #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
40465982Seric # endif
40565982Seric #endif
40665982Seric 
40765982Seric 
40865982Seric 
40965982Seric /*
41065049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
41164733Seric **
41264733Seric **  4.3BSD clone, closer to 4.4BSD
41364831Seric **
41464831Seric **	See also BSD defines.
41564733Seric */
41664733Seric 
41765049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
41864733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
41964733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
42066754Seric # ifdef __NetBSD__
42166754Seric #  define HASUNAME	1	/* has uname(2) syscall */
42266754Seric # endif
42364733Seric # include <sys/cdefs.h>
42464733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
42564733Seric # ifndef LA_TYPE
42664733Seric #  define LA_TYPE	LA_SUBR
42764733Seric # endif
42865749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
42964733Seric #endif
43064733Seric 
43164733Seric 
43264733Seric /*
43364813Seric **  Mach386
43464813Seric **
43564813Seric **	For mt Xinu's Mach386 system.
43664813Seric */
43764813Seric 
43864813Seric #if defined(MACH) && defined(i386)
43964813Seric # define MACH386	1
44064813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
44164813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
44266226Seric # ifndef HASFLOCK
44365830Seric #  define HASFLOCK	1	/* has flock(2) call */
44465830Seric # endif
44564813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
44664813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
44764813Seric # define setpgid	setpgrp
44864813Seric # ifndef LA_TYPE
44964813Seric #  define LA_TYPE	LA_FLOAT
45064813Seric # endif
45165749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
45264962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
45364813Seric # undef WEXITSTATUS
45464813Seric # undef WIFEXITED
45564813Seric # ifndef _PATH_SENDMAILCF
45664813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
45764813Seric # endif
45864813Seric # ifndef _PATH_SENDMAILPID
45964813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
46064813Seric # endif
46164813Seric #endif
46264813Seric 
46364813Seric 
46464813Seric /*
46563969Seric **  4.3 BSD -- this is for very old systems
46663969Seric **
46765949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
46865949Seric **
46963969Seric **	You'll also have to install a new resolver library.
47063969Seric **	I don't guarantee that support for this environment is complete.
47163969Seric */
47263969Seric 
47365949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
47463969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
47563969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
47663970Seric # define ARBPTR_T	char *
47764155Seric # define setpgid	setpgrp
47863969Seric # ifndef LA_TYPE
47963969Seric #  define LA_TYPE	LA_FLOAT
48063969Seric # endif
48163969Seric # ifndef _PATH_SENDMAILCF
48263969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
48363969Seric # endif
48465167Seric # ifndef IDENTPROTO
48565167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
48665167Seric # endif
48764834Seric # undef WEXITSTATUS
48864834Seric # undef WIFEXITED
48964834Seric typedef short		pid_t;
49064834Seric extern int		errno;
49163969Seric #endif
49263969Seric 
49364314Seric 
49463969Seric /*
49563902Seric **  SCO Unix
49665087Seric **
49765087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
49865087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
49965087Seric **	The second is, I believe, for an older version.
50063902Seric */
50163902Seric 
50265087Seric #ifdef _SCO_unix_4_2
50365087Seric # define _SCO_unix_
50465087Seric # define HASSETREUID	1	/* has setreuid(2) call */
50566757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
50665087Seric # define _PATH_UNIX	"/unix"
50765087Seric # ifndef _PATH_SENDMAILCF
50865087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
50965087Seric # endif
51065087Seric # ifndef _PATH_SENDMAILPID
51165087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
51265087Seric # endif
51365087Seric #endif
51465087Seric 
51563838Seric #ifdef _SCO_unix_
51663838Seric # define SYSTEM5	1	/* include all the System V defines */
51764035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
51865212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
51963838Seric # define FORK		fork
52063838Seric # define MAXPATHLEN	PATHSIZE
52164718Seric # define LA_TYPE	LA_SHORT
522*67812Seric # define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
52367608Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
52464813Seric # undef NETUNIX			/* no unix domain socket support */
52563838Seric #endif
52663838Seric 
52764314Seric 
52863962Seric /*
52963962Seric **  ConvexOS 11.0 and later
53065949Seric **
53165949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
53265949Seric **	works on 9.1 as well.
53363962Seric */
53463962Seric 
53563962Seric #ifdef _CONVEX_SOURCE
53663977Seric # define BSD		1	/* include all the BSD defines */
53763977Seric # define HASUNAME	1	/* use System V uname(2) system call */
53863962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
53963977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
54063962Seric # define LA_TYPE	LA_FLOAT
54165749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
54265949Seric # ifndef _PATH_SENDMAILCF
54365949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
54465949Seric # endif
54565949Seric # ifndef S_IREAD
54665949Seric #  define S_IREAD	_S_IREAD
54765949Seric #  define S_IWRITE	_S_IWRITE
54865949Seric #  define S_IEXEC	_S_IEXEC
54965949Seric #  define S_IFMT	_S_IFMT
55065949Seric #  define S_IFCHR	_S_IFCHR
55165949Seric #  define S_IFBLK	_S_IFBLK
55265949Seric # endif
55365167Seric # ifndef IDENTPROTO
55465167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
55565167Seric # endif
55663962Seric #endif
55763962Seric 
55864314Seric 
55963962Seric /*
56064999Seric **  RISC/os 4.52
56163962Seric **
56264999Seric **	Gives a ton of warning messages, but otherwise compiles.
56363962Seric */
56463962Seric 
56563965Seric #ifdef RISCOS
56664999Seric 
56763962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
56866226Seric # ifndef HASFLOCK
56965830Seric #  define HASFLOCK	1	/* has flock(2) call */
57065830Seric # endif
57164999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
57264999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
57363962Seric # define LA_TYPE	LA_INT
57463962Seric # define LA_AVENRUN	"avenrun"
57563962Seric # define _PATH_UNIX	"/unix"
57664999Seric # undef WIFEXITED
57764999Seric 
57864999Seric # define setpgid	setpgrp
57964999Seric 
58064999Seric extern int		errno;
58164999Seric typedef int		pid_t;
58264999Seric #define			SIGFUNC_DEFINED
58364999Seric typedef int		(*sigfunc_t)();
58464999Seric extern char		*getenv();
58564999Seric extern void		*malloc();
58664999Seric 
58763962Seric #endif
58863962Seric 
58964314Seric 
59064155Seric /*
59164155Seric **  Linux 0.99pl10 and above...
59266300Seric **
59366300Seric **  Thanks to, in reverse order of contact:
59466300Seric **
59566300Seric **	John Kennedy <warlock@csuchico.edu>
59666300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
59766300Seric **	Karl London <karl@borg.demon.co.uk>
59866300Seric **
59966300Seric **  Last compiled against:	[03/02/94 @ 05:34 PM (Wednesday)]
60066300Seric **	sendmail 8.6.6.b9	named 4.9.2-931205-p1	db-1.73
60166300Seric **	gcc 2.5.8		libc.so.4.5.19
60266300Seric **	slackware 1.1.2		linux 0.99.15
60364155Seric */
60464155Seric 
60564770Seric #ifdef __linux__
60666298Seric # define BSD		1	/* include BSD defines */
60764155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
60866298Seric # define HASUNAME	1	/* use System V uname(2) system call */
60964380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
61066298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
61166300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
61264155Seric # ifndef LA_TYPE
61366301Seric #  define LA_TYPE	LA_PROCSTR
61464155Seric # endif
61566300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
61664763Seric # include <sys/sysmacros.h>
61766300Seric # undef atol			/* wounded in <stdlib.h> */
61864155Seric #endif
61964155Seric 
62064155Seric 
62164345Seric /*
62264345Seric **  DELL SVR4 Issue 2.2, and others
62364345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
62464345Seric **
62564345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
62664345Seric **	defined, and the definitions conflict.
62764924Seric **
62864924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
62964924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
63064924Seric **	(SVR4.0/386 version 3.0).
63164345Seric */
63264345Seric 
63364345Seric #ifdef DELL_SVR4
63465189Seric 				/* no changes necessary */
63565189Seric 				/* see general __svr4__ defines below */
63664345Seric #endif
63764345Seric 
63864345Seric 
63964380Seric /*
64064380Seric **  Apple A/UX 3.0
64164380Seric */
64264345Seric 
64364380Seric #ifdef _AUX_SOURCE
64464729Seric # include <sys/sysmacros.h>
64564380Seric # define BSD			/* has BSD routines */
64664380Seric # define HASUNAME	1	/* use System V uname(2) system call */
64764380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
64864561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
64965167Seric # ifndef IDENTPROTO
65065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
65165167Seric # endif
65264380Seric # define FORK		fork
65364380Seric # ifndef _PATH_SENDMAILCF
65464380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
65564380Seric # endif
65664380Seric # ifndef LA_TYPE
65764380Seric #  define LA_TYPE	LA_ZERO
65864380Seric # endif
65965749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
66064560Seric # undef WIFEXITED
66164560Seric # undef WEXITSTATUS
66264380Seric #endif
66364380Seric 
66464380Seric 
66564705Seric /*
66664705Seric **  Encore UMAX V
66764705Seric **
66864705Seric **	Not extensively tested.
66964705Seric */
67064380Seric 
67164705Seric #ifdef UMAXV
67264705Seric # include <limits.h>
67364705Seric # define HASUNAME	1	/* use System V uname(2) system call */
67464705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
67564705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
67665211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
67764705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
67864705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
67964705Seric # define FORK		fork	/* no vfork(2) primitive available */
68065749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
68164705Seric # define MAXPATHLEN	PATH_MAX
68264705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
68364705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
68464705Seric # undef WIFEXITED
68564705Seric # undef WEXITSTATUS
68664705Seric #endif
68764705Seric 
68864705Seric 
68964939Seric /*
69064939Seric **  Stardent Titan 3000 running TitanOS 4.2.
69164939Seric **
69264939Seric **	Must be compiled in "cc -43" mode.
69364939Seric **
69464944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
69564939Seric **
69664939Seric **	Note the tweaking below after the BSD defines are set.
69764939Seric */
69864705Seric 
69964939Seric #ifdef titan
70064939Seric # define setpgid	setpgrp
70164939Seric typedef int		pid_t;
70264939Seric # undef WIFEXITED
70364939Seric # undef WEXITSTATUS
70464939Seric #endif
70564939Seric 
70664939Seric 
70764962Seric /*
70864962Seric **  Sequent DYNIX 3.2.0
70964962Seric **
71064962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
71164962Seric */
71264939Seric 
71364962Seric #ifdef sequent
71466038Seric 
71564962Seric # define BSD		1
71664962Seric # define HASUNSETENV	1
71764962Seric # define BSD4_3		1	/* to get signal() in conf.c */
71864962Seric # define WAITUNION	1
71964962Seric # define LA_TYPE	LA_FLOAT
72064962Seric # ifdef	_POSIX_VERSION
72164962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
72264962Seric # endif
72364962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
72464962Seric # define setpgid	setpgrp
72564962Seric 
72664962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
72764962Seric # undef	WIFEXITED
72864962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
72964962Seric 			 ((union wait*)&(s))->w_termsig == 0)
73064962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
73164962Seric typedef int		pid_t;
73264962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
73364962Seric 
73466144Seric # ifndef IDENTPROTO
73566144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
73666144Seric # endif
73766144Seric 
73864962Seric # ifndef _PATH_UNIX
73964962Seric #  define _PATH_UNIX	"/dynix"
74064962Seric # endif
74164962Seric # ifndef _PATH_SENDMAILCF
74264962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
74364962Seric # endif
74464962Seric 
74564962Seric #endif
74664962Seric 
74764962Seric 
74865748Seric /*
74966038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
75066038Seric **
75166038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
75266038Seric **
75366038Seric **	From Tim Wright <timw@sequent.com>.
75466038Seric */
75566038Seric 
75666038Seric #ifdef _SEQUENT_
75766038Seric # define SYSTEM5	1	/* include all the System V defines */
75866038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
75966038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
76066038Seric # define HASSETREUID	1	/* has setreuid(2) call */
76166038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
76266038Seric # define GIDSET_T	gid_t
76366038Seric # define LA_TYPE	LA_INT
76466038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
76567771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
76666144Seric # ifndef IDENTPROTO
76766144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
76866144Seric # endif
76966038Seric # ifndef _PATH_SENDMAILCF
77066038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
77166038Seric # endif
77266038Seric # ifndef _PATH_SENDMAILPID
77366038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
77466038Seric # endif
77566038Seric #endif
77666038Seric 
77766038Seric 
77866038Seric /*
77965748Seric **  Cray Unicos
78065748Seric **
78165748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
78265748Seric */
78364962Seric 
78465748Seric #ifdef UNICOS
78565748Seric # define SYSTEM5	1	/* include all the System V defines */
78665748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
78765748Seric # define MAXPATHLEN	PATHSIZE
78865748Seric # define LA_TYPE	LA_ZERO
78965749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
79065748Seric #endif
79164962Seric 
79265748Seric 
79365820Seric /*
79465820Seric **  Apollo DomainOS
79565820Seric **
79665820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
79765982Seric **
79865820Seric **  15 Jan 1994
79965820Seric **
80065820Seric */
80165748Seric 
80265820Seric #ifdef apollo
80365820Seric # define HASSETREUID	1	/* has setreuid(2) call */
80465820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
80567771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
80665820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
80766044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
80865820Seric # ifndef _PATH_SENDMAILCF
80965820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
81065820Seric # endif
81165820Seric # ifndef _PATH_SENDMAILPID
81265820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
81365820Seric # endif
81465820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
81565820Seric # undef  S_IFIFO
81665820Seric # define S_IFIFO	0010000
81765820Seric # ifndef IDENTPROTO
81865820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
81965820Seric # endif
82065982Seric #endif
82165820Seric 
82265820Seric 
82366748Seric /*
82467745Seric **  UnixWare 1.1.2.
82566752Seric **
82666752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
82766752Seric */
82866752Seric 
82966752Seric #ifdef UNIXWARE
83066752Seric # define SYSTEM5		1
83167745Seric # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
83267745Seric # define HASGETDTABLESIZE	1
83367745Seric # define HASSETREUID		1
83467745Seric # define HASSETSID		1
83567745Seric # define HASINITGROUPS		1
83667745Seric # define GIDSET_T		gid_t
83767745Seric # define SLEEP_T		unsigned
83866752Seric # define SFS_TYPE		SFS_STATVFS
83966752Seric # define LA_TYPE		LA_ZERO
84066752Seric # undef WIFEXITED
84166752Seric # undef WEXITSTATUS
84266752Seric # define _PATH_UNIX		"/unix"
84366752Seric # ifndef _PATH_SENDMAILCF
84466752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
84566752Seric # endif
84666752Seric # ifndef _PATH_SENDMAILPID
84766752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
84866752Seric # endif
84966752Seric # define SYSLOG_BUFSIZE	128
85066752Seric #endif
85166752Seric 
85266752Seric 
85366752Seric /*
85466748Seric **  Intergraph CLIX 3.1
85566748Seric **
85666748Seric **	From Paul Southworth <pauls@locust.cic.net>
85766748Seric */
85865820Seric 
85966748Seric #ifdef CLIX
86066748Seric # define SYSTEM5	1	/* looks like System V */
86166752Seric # ifndef HASGETUSERSHELL
86266752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
86366752Seric # endif
86466748Seric # define DEV_BSIZE	512	/* device block size not defined */
86566748Seric # define GIDSET_T	gid_t
86666748Seric # undef LOG			/* syslog not available */
86766748Seric # define NEEDFSYNC	1	/* no fsync in system library */
86866748Seric # define GETSHORT	_getshort
86966748Seric #endif
87065820Seric 
87166748Seric 
87266776Seric /*
87366776Seric **  NCR 3000 Series (SysVr4)
87466776Seric **
87567434Seric **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
87666776Seric */
87766748Seric 
87866776Seric #ifdef NCR3000
87966776Seric # define __svr4__
88066776Seric # undef BSD
88166776Seric # define LA_AVENRUN	"avenrun"
88266776Seric #endif
88366748Seric 
88466776Seric 
88567434Seric /*
88667434Seric **  Tandem NonStop-UX SVR4
88767434Seric **
88867434Seric **	From Rick McCarty <mccarty@mpd.tandem.com>.
88967434Seric */
89066776Seric 
89167434Seric #ifdef NonStop_UX_BXX
89267434Seric # define __svr4__
89367434Seric #endif
89466776Seric 
89567434Seric 
89667488Seric /*
89767488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
89867488Seric **
89967488Seric **	Tested for 1.04 and 1.03
90067488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
90167488Seric */
90267434Seric 
90367488Seric #ifdef __H3050R
90467488Seric # define SYSTEM5	1	/* include all the System V defines */
90567488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
90667488Seric # define setreuid(r, e)	setresuid(r, e, -1)
90767488Seric # define LA_TYPE	LA_FLOAT
90867488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
90967488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
91067488Seric # ifndef GIDSET_T
91167488Seric #  define GIDSET_T	gid_t
91267488Seric # endif
91367488Seric # ifndef _PATH_UNIX
91467488Seric #  define _PATH_UNIX	"/HI-UX"
91567488Seric # endif
91667488Seric # ifndef _PATH_SENDMAILCF
91767488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
91867488Seric # endif
91967488Seric # ifndef IDENTPROTO
92067488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
92167488Seric # endif
92267488Seric # ifndef HASGETUSERSHELL
92367488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
92467488Seric # endif
92567488Seric 
92667488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
92767488Seric # undef m_flags
92867488Seric 
92967488Seric # ifdef __STDC__
93067488Seric extern int	syslog(int, char *, ...);
93167488Seric # endif
93267488Seric 
93367488Seric #endif
93467488Seric 
93567488Seric 
93667488Seric 
93763902Seric /**********************************************************************
93863787Seric **  End of Per-Operating System defines
93963902Seric **********************************************************************/
94063787Seric 
94163949Seric /**********************************************************************
94263949Seric **  More general defines
94363949Seric **********************************************************************/
94463949Seric 
94563962Seric /* general BSD defines */
94663962Seric #ifdef BSD
94764035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
94864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
94967742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
95067430Seric # ifndef HASSETRLIMIT
95167430Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
95267430Seric # endif
95365830Seric # ifndef HASFLOCK
95465830Seric #  define HASFLOCK	1	/* has flock(2) call */
95565830Seric # endif
95667602Seric # ifndef TZ_TYPE
95767608Seric #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
95867602Seric # endif
95963962Seric #endif
96063962Seric 
96165189Seric /* general System V Release 4 defines */
96265189Seric #ifdef __svr4__
96365189Seric # define SYSTEM5	1
96465189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
96567742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
96667742Seric # ifndef HASSETRLIMIT
96767742Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
96867742Seric # endif
96965211Seric # ifndef HASGETUSERSHELL
97065211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
97165210Seric # endif
97265189Seric # define setreuid(r, e)	seteuid(e)
97365189Seric 
97465189Seric # ifndef _PATH_UNIX
97565189Seric #  define _PATH_UNIX		"/unix"
97665189Seric # endif
97765189Seric # ifndef _PATH_SENDMAILCF
97865189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
97965189Seric # endif
98065189Seric # ifndef _PATH_SENDMAILPID
98165189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
98265189Seric # endif
98365189Seric # ifndef SYSLOG_BUFSIZE
98465189Seric #  define SYSLOG_BUFSIZE	128
98565189Seric # endif
98667159Seric # ifndef SFS_TYPE
98767159Seric #  define SFS_TYPE		SFS_STATVFS
98867159Seric # endif
98965189Seric #endif
99065189Seric 
99163787Seric /* general System V defines */
99266298Seric #ifdef SYSTEM5
99364813Seric # include <sys/sysmacros.h>
99463949Seric # define HASUNAME	1	/* use System V uname(2) system call */
99564705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
99664962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
99767430Seric # ifndef HASULIMIT
99867430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
99967430Seric # endif
100063962Seric # ifndef LA_TYPE
100165749Seric #  define LA_TYPE	LA_INT		/* assume integer load average */
100263962Seric # endif
100365749Seric # ifndef SFS_TYPE
100465749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
100565749Seric # endif
100667602Seric # ifndef TZ_TYPE
100767608Seric #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
100867602Seric # endif
100963949Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
101063949Seric # define bzero(d, l)		(memset((d), '\0', (l)))
101163949Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
101266298Seric #endif
101363787Seric 
101463949Seric /* general POSIX defines */
101563949Seric #ifdef _POSIX_VERSION
101664718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
101764718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
101863949Seric #endif
101963949Seric 
102063787Seric /*
102163937Seric **  If no type for argument two of getgroups call is defined, assume
102263937Seric **  it's an integer -- unfortunately, there seem to be several choices
102363937Seric **  here.
102463937Seric */
102563937Seric 
102663937Seric #ifndef GIDSET_T
102763937Seric # define GIDSET_T	int
102863937Seric #endif
102963937Seric 
103064939Seric /*
103164939Seric **  Tweaking for systems that (for example) claim to be BSD but
103264939Seric **  don't have all the standard BSD routines (boo hiss).
103364939Seric */
103464439Seric 
103564939Seric #ifdef titan
103664939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
103764939Seric #endif
103864939Seric 
103965830Seric 
104065167Seric /*
104165167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
104265167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
104365167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
104465167Seric **  are closed.  Some firewalls return this error if you try to connect
104565167Seric **  to the IDENT port (113), so you can't receive email from these hosts
104665167Seric **  on these systems.  The firewall really should use a more specific
104765167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
104865167Seric **  not explicitly set to zero above, default it on.
104965167Seric */
105064939Seric 
105165167Seric #ifndef IDENTPROTO
105265167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
105365167Seric #endif
105465167Seric 
105565211Seric #ifndef HASGETUSERSHELL
105665211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
105765210Seric #endif
105865167Seric 
105965830Seric #ifndef HASFLOCK
106065830Seric # define HASFLOCK	0	/* assume no flock(2) support */
106165830Seric #endif
106265210Seric 
106367430Seric #ifndef HASSETRLIMIT
106467430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
106567430Seric #endif
106667430Seric 
106767430Seric #ifndef HASULIMIT
106867430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
106967430Seric #endif
107067430Seric 
107166843Seric #ifndef OLD_NEWDB
107266843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
107366843Seric #endif
107465830Seric 
107566843Seric 
107664439Seric /**********************************************************************
107759023Seric **  Remaining definitions should never have to be changed.  They are
107859023Seric **  primarily to provide back compatibility for older systems -- for
107959287Seric **  example, it includes some POSIX compatibility definitions
108064439Seric **********************************************************************/
108159023Seric 
108259388Seric /* System 5 compatibility */
108359388Seric #ifndef S_ISREG
108464944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
108559388Seric #endif
108664944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
108764944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
108864944Seric #endif
108959388Seric #ifndef S_IWGRP
109059388Seric #define S_IWGRP		020
109159388Seric #endif
109259388Seric #ifndef S_IWOTH
109359388Seric #define S_IWOTH		002
109459388Seric #endif
109559388Seric 
109659023Seric /*
109750537Seric **  Older systems don't have this error code -- it should be in
109850537Seric **  /usr/include/sysexits.h.
109950537Seric */
110050537Seric 
110150537Seric # ifndef EX_CONFIG
110250537Seric # define EX_CONFIG	78	/* configuration error */
110350537Seric # endif
110456852Seric 
110564718Seric /* pseudo-code used in server SMTP */
110664718Seric # define EX_QUIT	22	/* drop out of server immediately */
110764718Seric 
110864718Seric 
110963993Seric /*
111063993Seric **  These are used in a few cases where we need some special
111163993Seric **  error codes, but where the system doesn't provide something
111263993Seric **  reasonable.  They are printed in errstring.
111363993Seric */
111463993Seric 
111563993Seric #ifndef E_PSEUDOBASE
111663993Seric # define E_PSEUDOBASE	256
111763993Seric #endif
111863993Seric 
111963993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
112063993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
112163993Seric 
112263970Seric /* type of arbitrary pointer */
112363970Seric #ifndef ARBPTR_T
112463970Seric # define ARBPTR_T	void *
112563970Seric #endif
112663970Seric 
112760568Seric #ifndef __P
112860568Seric # include "cdefs.h"
112960568Seric #endif
113060568Seric 
113167421Seric #if NAMED_BIND
113267421Seric # include <arpa/nameser.h>
113367434Seric # ifdef __svr4__
113467434Seric #  ifdef NOERROR
113567434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
113667434Seric #  endif
113767434Seric # endif
113867421Seric #endif
113967421Seric 
114056852Seric /*
114167419Seric **  The size of an IP address -- can't use sizeof because of problems
114267419Seric **  on Crays, where everything is 64 bits.  This will break if/when
114367419Seric **  IP addresses are expanded to eight bytes.
114467419Seric */
114567419Seric 
114667421Seric #ifndef INADDRSZ
114767421Seric # define INADDRSZ	4
114867421Seric #endif
114967419Seric 
115067419Seric /*
115167421Seric **  The size of various known types -- for reading network protocols.
115267421Seric **  Again, we can't use sizeof because of compiler randomness.
115367421Seric */
115467421Seric 
115567421Seric #ifndef INT16SZ
115667421Seric # define INT16SZ	2
115767421Seric #endif
115867421Seric #ifndef INT32SZ
115967421Seric # define INT32SZ	4
116067421Seric #endif
116167421Seric 
116267421Seric /*
116358778Seric **  Do some required dependencies
116458778Seric */
116558778Seric 
116658778Seric #if defined(NETINET) || defined(NETISO)
116759107Seric # define SMTP		1	/* enable user and server SMTP */
116859107Seric # define QUEUE		1	/* enable queueing */
116959107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
117058778Seric #endif
117158778Seric 
117258778Seric 
117358778Seric /*
117456852Seric **  Arrange to use either varargs or stdargs
117556852Seric */
117656852Seric 
117756852Seric # ifdef __STDC__
117856852Seric 
117956852Seric # include <stdarg.h>
118056852Seric 
118156852Seric # define VA_LOCAL_DECL	va_list ap;
118256852Seric # define VA_START(f)	va_start(ap, f)
118356852Seric # define VA_END		va_end(ap)
118456852Seric 
118556852Seric # else
118656852Seric 
118756852Seric # include <varargs.h>
118856852Seric 
118956852Seric # define VA_LOCAL_DECL	va_list ap;
119056852Seric # define VA_START(f)	va_start(ap)
119156852Seric # define VA_END		va_end(ap)
119256852Seric 
119356852Seric # endif
119457631Seric 
119557943Seric #ifdef HASUNAME
119657631Seric # include <sys/utsname.h>
119757631Seric # ifdef newstr
119857631Seric #  undef newstr
119957631Seric # endif
120057943Seric #else /* ! HASUNAME */
120157631Seric # define NODE_LENGTH 32
120257631Seric struct utsname
120357631Seric {
120457631Seric 	char nodename[NODE_LENGTH+1];
120557631Seric };
120657943Seric #endif /* HASUNAME */
120757642Seric 
120867434Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX)
120963838Seric # define MAXHOSTNAMELEN	256
121057735Seric #endif
121158153Seric 
121258153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
121358153Seric # define SIGCHLD	SIGCLD
121458153Seric #endif
121558153Seric 
121658153Seric #ifndef STDIN_FILENO
121758153Seric #define STDIN_FILENO	0
121858153Seric #endif
121958153Seric 
122058153Seric #ifndef STDOUT_FILENO
122158153Seric #define STDOUT_FILENO	1
122258153Seric #endif
122358153Seric 
122458153Seric #ifndef STDERR_FILENO
122558153Seric #define STDERR_FILENO	2
122658153Seric #endif
122758689Seric 
122864072Seric #ifndef LOCK_SH
122964035Seric # define LOCK_SH	0x01	/* shared lock */
123064035Seric # define LOCK_EX	0x02	/* exclusive lock */
123164035Seric # define LOCK_NB	0x04	/* non-blocking lock */
123264035Seric # define LOCK_UN	0x08	/* unlock */
123364035Seric #endif
123458692Seric 
123564035Seric #ifndef SIG_ERR
123664035Seric # define SIG_ERR	((void (*)()) -1)
123758689Seric #endif
123858702Seric 
123964500Seric #ifndef WEXITSTATUS
124064500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
124164500Seric #endif
124264500Seric #ifndef WIFEXITED
124364500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
124464500Seric #endif
124564500Seric 
124664561Seric #ifndef SIGFUNC_DEFINED
124764561Seric typedef void		(*sigfunc_t) __P((int));
124864561Seric #endif
124964561Seric 
125065053Seric /* size of syslog buffer */
125165053Seric #ifndef SYSLOG_BUFSIZE
125265053Seric # define SYSLOG_BUFSIZE	1024
125365053Seric #endif
125465053Seric 
125558702Seric /*
125658702Seric **  Size of tobuf (deliver.c)
125758702Seric **	Tweak this to match your syslog implementation.  It will have to
125858702Seric **	allow for the extra information printed.
125958702Seric */
126058702Seric 
126158702Seric #ifndef TOBUFSIZE
126265053Seric # if (SYSLOG_BUFSIZE) > 512
126365053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
126465053Seric # else
126565053Seric #  define TOBUFSIZE	256
126665053Seric # endif
126758702Seric #endif
126860219Seric 
126965015Seric /*
127065015Seric **  Size of prescan buffer.
127165015Seric **	Despite comments in the _sendmail_ book, this probably should
127265015Seric **	not be changed; there are some hard-to-define dependencies.
127365015Seric */
127465015Seric 
127565015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
127660219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
127760219Seric # ifndef FORK
127860219Seric # define FORK		vfork		/* function to call to fork mailer */
127960219Seric # endif
128065955Seric 
128165955Seric /*
128265955Seric **  If we are going to link scanf anyway, use it in readcf
128365955Seric */
128465955Seric 
128565955Seric #if !defined(HASUNAME) && !defined(SCANF)
128665955Seric # define SCANF		1
128765955Seric #endif
1288