xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 69516)
19147Seric /*
268839Seric  * Copyright (c) 1983, 1995 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*69516Seric  *	@(#)conf.h	8.161 (Berkeley) 05/17/95
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>
2268693Seric # include <netdb.h>
2368693Seric # include <pwd.h>
2457232Seric 
2563902Seric /**********************************************************************
269147Seric **  Table sizes, etc....
279147Seric **	There shouldn't be much need to change these....
2863902Seric **********************************************************************/
299147Seric 
3059303Seric # define MAXLINE	2048		/* max line length */
3124945Seric # define MAXNAME	256		/* max length of a name */
329147Seric # define MAXPV		40		/* max # of parms to mailers */
3359303Seric # define MAXATOM	200		/* max atoms per address */
349147Seric # define MAXMAILERS	25		/* maximum mailers known to system */
3568384Seric # define MAXRWSETS	200		/* max # of sets of rewriting rules */
369147Seric # define MAXPRIORITIES	25		/* max values for Precedence: field */
3757143Seric # define MAXMXHOSTS	20		/* max # of MX records */
3852106Seric # define SMTPLINELIM	990		/* maximum SMTP line length */
3957232Seric # define MAXKEY		128		/* maximum size of a database key */
4057232Seric # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
4159056Seric # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
4259667Seric # define MAXALIASDB	12		/* max # of alias databases */
4367729Seric # define MAXMAPSTACK	12		/* max # of stacked or sequenced maps */
4467729Seric # define MAXTOCLASS	8		/* max # of message timeout classes */
4568517Seric # define MAXMIMEARGS	20		/* max args in Content-Type: */
4668517Seric # define MAXMIMENESTING	20		/* max MIME multipart nesting */
4757143Seric 
4857143Seric # ifndef QUEUESIZE
4957143Seric # define QUEUESIZE	1000		/* max # of jobs per queue run */
5057143Seric # endif
5157143Seric 
5263902Seric /**********************************************************************
539147Seric **  Compilation options.
5425673Seric **
5525673Seric **	#define these if they are available; comment them out otherwise.
5663902Seric **********************************************************************/
579147Seric 
5825673Seric # define LOG		1	/* enable logging */
5925673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
6064813Seric # define NETUNIX	1	/* include unix domain support */
6158778Seric # define NETINET	1	/* include internet support */
6253735Seric # define MATCHGECOS	1	/* match user names from gecos field */
6363753Seric # define XDEBUG		1	/* enable extended debugging */
6468785Seric # if (defined(NEWDB) || defined(HESIOD)) && !defined(USERDB)
6568848Seric #  define USERDB	1	/* look in user database */
6656337Seric # endif
6756337Seric 
6866334Seric /**********************************************************************
6966334Seric **  0/1 Compilation options.
7066334Seric **	#define these to 1 if they are available;
7166334Seric **	#define them to 0 otherwise.
7266334Seric **********************************************************************/
7366334Seric 
7466334Seric # ifndef NAMED_BIND
7566334Seric #  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
7666334Seric # endif
7766334Seric 
7868848Seric # ifndef DSN
7968848Seric #  define DSN		1	/* include delivery status notification code */
8068848Seric # endif
8168848Seric 
8269480Seric # ifndef MIME8TO7
8369480Seric #  define MIME8TO7	1	/* 8->7 bit MIME conversions */
8469480Seric # endif
8569480Seric 
8669480Seric # ifndef MIME7TO8
8769480Seric #  define MIME7TO8	1	/* 7->8 bit MIME conversions */
8869480Seric # endif
8969480Seric 
9064032Seric /*
9164944Seric **  Most systems have symbolic links today, so default them on.  You
9264944Seric **  can turn them off by #undef'ing this below.
9364944Seric */
9464944Seric 
9564944Seric # define HASLSTAT	1	/* has lstat(2) call */
9664944Seric 
9764962Seric /*
9864962Seric **  General "standard C" defines.
9964962Seric **
10064962Seric **	These may be undone later, to cope with systems that claim to
10164962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
10264962Seric **	doesn't realize that the library is part of the language.
10364962Seric **
10464962Seric **	Life would be much easier if we could get rid of this sort
10564962Seric **	of bozo problems.
10664962Seric */
10764962Seric 
10864962Seric #ifdef __STDC__
10964962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
11064962Seric #endif
11164962Seric 
11263902Seric /**********************************************************************
11359023Seric **  Operating system configuration.
11459023Seric **
11559023Seric **	Unless you are porting to a new OS, you shouldn't have to
11659023Seric **	change these.
11763902Seric **********************************************************************/
11856823Seric 
11963787Seric /*
12063787Seric **  Per-Operating System defines
12163787Seric */
12263787Seric 
12364314Seric 
12463902Seric /*
12565565Seric **  HP-UX -- tested for 8.07, 9.00, and 9.01.
12668889Seric **
12768889Seric **	If V4FS is defined, compile for HP-UX 10.0.
12863902Seric */
12963902Seric 
13067626Seric #ifdef __hpux
13168889Seric 		/* common definitions for HP-UX 9.x and 10.x */
13268889Seric # undef m_flags		/* conflict between db.h & sys/sysmacros.h on HP 300 */
13363787Seric # define SYSTEM5	1	/* include all the System V defines */
13464035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
13564035Seric # define HASSETREUID	1	/* has setreuid(2) call */
13665982Seric # define setreuid(r, e)		setresuid(r, e, -1)
13769462Seric # define LA_TYPE	LA_HPUX
13868873Seric # define SPT_TYPE	SPT_PSTAT
13965749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
14065354Seric # define GIDSET_T	gid_t
14165581Seric # ifndef HASGETUSERSHELL
14265581Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
14365581Seric # endif
14465504Seric # define syslog		hard_syslog
14565581Seric # ifdef __STDC__
14665581Seric extern int	syslog(int, char *, ...);
14765167Seric # endif
14868889Seric 
14968889Seric # ifdef V4FS
15068889Seric 		/* HP-UX 10.x */
15168889Seric #  define _PATH_UNIX	"/stand/vmunix"
15268889Seric #  ifndef _PATH_SENDMAILCF
15368889Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
15468889Seric #  endif
15568889Seric #  ifndef _PATH_SENDMAILPID
15668889Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
15768889Seric #  endif
15868889Seric #  ifndef IDENTPROTO
15968889Seric #   define IDENTPROTO	1	/* TCP/IP implementation fixed in 10.0 */
16068889Seric #  endif
16168889Seric 
16268889Seric # else
16368889Seric 		/* HP-UX 9.x */
16468889Seric #  define _PATH_UNIX	"/hp-ux"
16568889Seric #  ifndef _PATH_SENDMAILCF
16668889Seric #   define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
16768889Seric #  endif
16868889Seric #  ifndef IDENTPROTO
16968889Seric #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
17068889Seric #  endif
17168889Seric # endif
17268889Seric 
17367626Seric #endif
17456823Seric 
17564314Seric 
17663902Seric /*
17763902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
17863902Seric */
17963902Seric 
18067626Seric #ifdef _AIX3
18164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
18264840Seric # define HASUNAME	1	/* use System V uname(2) system call */
18365211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
18460219Seric # define FORK		fork	/* no vfork primitive available */
18565749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
18667771Seric # define SPT_PADCHAR	'\0'	/* pad process title with nulls */
18768145Seric # define LA_TYPE	LA_INT
18867626Seric #endif
18960219Seric 
19064314Seric 
19163902Seric /*
19263902Seric **  Silicon Graphics IRIX
19363902Seric **
19463965Seric **	Compiles on 4.0.1.
19567967Seric **
19668686Seric **	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
19768686Seric **	Use IRIX5 instead of IRIX for IRIX 5.x.
19867967Seric **
19967967Seric **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
20068686Seric **	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
20163902Seric */
20263902Seric 
20368686Seric #if defined(IRIX64) || defined(IRIX5)
20467967Seric # define IRIX
20567967Seric #endif
20667967Seric 
20767626Seric #ifdef IRIX
20866763Seric # define SYSTEM5	1	/* this is a System-V derived system */
20964035Seric # define HASSETREUID	1	/* has setreuid(2) call */
21064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
21165211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
21263753Seric # define FORK		fork	/* no vfork primitive available */
21368686Seric # if !defined(IRIX64) && !defined(IRIX5)
21468225Seric #  define WAITUNION	1	/* use "union wait" as wait argument type */
21568225Seric # endif
21664155Seric # define setpgid	BSDsetpgrp
21763937Seric # define GIDSET_T	gid_t
21868705Seric # define ARGV_T		const char **
21965749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
22068439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
22166763Seric # define LA_TYPE	LA_INT
22267967Seric # ifdef IRIX64
22367967Seric #  define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
22467967Seric # else
22567967Seric #  define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
22667967Seric # endif
22767626Seric #endif
22863753Seric 
22963902Seric 
23063902Seric /*
23164813Seric **  SunOS and Solaris
23264813Seric **
23364813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
23464813Seric **	Solaris 2.2 (a.k.a. SunOS 5.2).
23563902Seric */
23663902Seric 
23763787Seric #if defined(sun) && !defined(BSD)
23859074Seric 
23964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
24064813Seric # define HASUNAME	1	/* use System V uname(2) system call */
24165211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
24265749Seric # define LA_TYPE	LA_INT
24360564Seric 
24464842Seric # ifdef SOLARIS_2_3
24568813Seric #  define SOLARIS	203	/* for back compat only -- use -DSOLARIS=203 */
24664842Seric # endif
24764842Seric 
24860602Seric # ifdef SOLARIS
24963902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
25065222Seric #  ifndef __svr4__
25165222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
25265222Seric #  endif
25363787Seric #  include <sys/time.h>
25465172Seric #  define GIDSET_T	gid_t
25565189Seric #  ifndef _PATH_UNIX
25667129Seric #   define _PATH_UNIX	"/dev/ksyms"
25765189Seric #  endif
25863962Seric #  ifndef _PATH_SENDMAILCF
25963962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
26064072Seric #  endif
26164072Seric #  ifndef _PATH_SENDMAILPID
26263962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
26363962Seric #  endif
26469401Seric #  ifndef _PATH_HOSTS
26569401Seric #   define _PATH_HOSTS		"/etc/inet/hosts"
26669401Seric #  endif
26766022Seric #  ifndef SYSLOG_BUFSIZE
26866022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
26966022Seric #  endif
27063787Seric 
27160602Seric # else
27265105Seric 			/* SunOS 4.0.3 or 4.1.x */
27365189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
27465830Seric #  ifndef HASFLOCK
27565830Seric #   define HASFLOCK	1	/* has flock(2) call */
27665830Seric #  endif
27765749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
27860564Seric #  include <vfork.h>
27963787Seric 
28065105Seric #  ifdef SUNOS403
28165105Seric 			/* special tweaking for SunOS 4.0.3 */
28265105Seric #   include <malloc.h>
28365105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
28465105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
28565105Seric #   undef WIFEXITED
28665105Seric #   undef WEXITSTATUS
28765105Seric #   undef HASUNAME
28865105Seric #   define setpgid	setpgrp
28965105Seric typedef int		pid_t;
29065105Seric extern char		*getenv();
29165105Seric 
29266732Seric #  else
29366732Seric 			/* 4.1.x specifics */
29466732Seric #   define HASSETSID	1	/* has Posix setsid(2) call */
29566732Seric #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
29666732Seric 
29765105Seric #  endif
29860564Seric # endif
29959023Seric #endif
30059023Seric 
30164718Seric /*
30264813Seric **  DG/UX
30364813Seric **
30467427Seric **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
30567427Seric **	older support.
30667427Seric **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
30764718Seric */
30864314Seric 
30967427Seric #ifdef DGUX_5_4_2
31067427Seric # define DGUX		1
31167427Seric #endif
31267427Seric 
31364718Seric #ifdef	DGUX
31464718Seric # define SYSTEM5	1
31569462Seric # define LA_TYPE	LA_DGUX
31664718Seric # define HASSETREUID	1	/* has setreuid(2) call */
31764718Seric # define HASUNAME	1	/* use System V uname(2) system call */
31864718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
31964718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
32066036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
32165167Seric # ifndef IDENTPROTO
32265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
32365167Seric # endif
32467771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
32565749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
32664813Seric 
32764813Seric /* these include files must be included early on DG/UX */
32864813Seric # include <netinet/in.h>
32964813Seric # include <arpa/inet.h>
33064813Seric 
33167427Seric # ifdef DGUX_5_4_2
33267427Seric #  define inet_addr	dgux_inet_addr
33364718Seric extern long	dgux_inet_addr();
33467427Seric # endif
33564718Seric #endif
33664718Seric 
33764718Seric 
33863902Seric /*
33963902Seric **  Digital Ultrix 4.2A or 4.3
34064264Seric **
34164264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
34264264Seric **	not dropped when the process exits.  This causes major problems,
34364264Seric **	so flock is the only alternative.
34463902Seric */
34563902Seric 
34660564Seric #ifdef ultrix
34764035Seric # define HASSETREUID	1	/* has setreuid(2) call */
34863962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
34964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
35066242Seric # define HASUNAME	1	/* use System V uname(2) system call */
35165830Seric # ifndef HASFLOCK
35265830Seric #  define HASFLOCK	1	/* has flock(2) call */
35365830Seric # endif
35465211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
35569279Seric # ifndef BROKEN_RES_SEARCH
35669279Seric #  define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
35769279Seric # endif
35865135Seric # ifdef vax
35965135Seric #  define LA_TYPE	LA_FLOAT
36065135Seric # else
36165135Seric #  define LA_TYPE	LA_INT
36265135Seric #  define LA_AVENRUN	"avenrun"
36365135Seric # endif
36465749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
36565167Seric # ifndef IDENTPROTO
36669279Seric #  define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
36765167Seric # endif
36860564Seric #endif
36960564Seric 
37064314Seric 
37163902Seric /*
37268072Seric **  OSF/1 for Intel Paragon.
37368072Seric **
37468082Seric **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
37568082Seric **	of Intel Scalable Systems Divison.
37668072Seric */
37768072Seric 
37868072Seric #ifdef __PARAGON__
37968072Seric # define __osf__	1	/* get OSF/1 defines below */
38068072Seric # ifndef _PATH_SENDMAILCF
38168072Seric #  define _PATH_SENDMAILCF	"/var/adm/sendmail/sendmail.cf"
38268072Seric # endif
38368072Seric #endif
38468072Seric 
38568072Seric 
38668072Seric /*
38763902Seric **  OSF/1 (tested on Alpha)
38863902Seric */
38963902Seric 
39063787Seric #ifdef __osf__
39163962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
39264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
39364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
39466226Seric # ifndef HASFLOCK
39565830Seric #  define HASFLOCK	1	/* has flock(2) call */
39665830Seric # endif
39763962Seric # define LA_TYPE	LA_INT
39865749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
39964813Seric # ifndef _PATH_SENDMAILPID
40065504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
40164813Seric # endif
40259287Seric #endif
40359287Seric 
40464314Seric 
40563902Seric /*
40663902Seric **  NeXTstep
40763902Seric */
40863902Seric 
40964076Seric #ifdef NeXT
41064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
41165830Seric # ifndef HASFLOCK
41265830Seric #  define HASFLOCK	1	/* has flock(2) call */
41365830Seric # endif
41464125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
41564563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
41668705Seric # define UID_T		int	/* compiler gripes on uid_t */
41763753Seric # define sleep		sleepX
41864155Seric # define setpgid	setpgrp
41964295Seric # ifndef LA_TYPE
42064295Seric #  define LA_TYPE	LA_MACH
42164295Seric # endif
42265749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
42364500Seric # ifndef _POSIX_SOURCE
42464035Seric typedef int		pid_t;
42564500Seric #  undef WEXITSTATUS
42664500Seric #  undef WIFEXITED
42764500Seric # endif
42864072Seric # ifndef _PATH_SENDMAILCF
42964072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
43064072Seric # endif
43164072Seric # ifndef _PATH_SENDMAILPID
43264072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
43364072Seric # endif
43459288Seric #endif
43559288Seric 
43664314Seric 
43763902Seric /*
43863962Seric **  4.4 BSD
43964831Seric **
44064831Seric **	See also BSD defines.
44163902Seric */
44263902Seric 
44360568Seric #ifdef BSD4_4
44464072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
44560568Seric # include <sys/cdefs.h>
44663838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
447*69516Seric # define BSD4_4_SOCKADDR	/* has sa_len */
44864072Seric # ifndef LA_TYPE
44964072Seric #  define LA_TYPE	LA_SUBR
45064072Seric # endif
45165749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
45267771Seric # define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
45360568Seric #endif
45460568Seric 
45564314Seric 
45663902Seric /*
45765982Seric **  BSD/386 (all versions)
45865982Seric **	From Tony Sanders, BSDI
45965982Seric */
46065982Seric 
46165982Seric #ifdef __bsdi__
46265982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
46365982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
46466843Seric # include <sys/cdefs.h>
46566843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
466*69516Seric # define BSD4_4_SOCKADDR	/* has sa_len */
46766030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
46866843Seric # ifndef LA_TYPE
46966843Seric #  define LA_TYPE	LA_SUBR
47066843Seric # endif
47168753Seric # define GIDSET_T	gid_t
47265982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
47366843Seric 			/* version 1.1 or later */
47467771Seric #  undef SPT_TYPE
47567771Seric #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
47666843Seric # else
47766843Seric 			/* version 1.0 or earlier */
47866843Seric #  ifndef OLD_NEWDB
47966843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
48066843Seric #  endif
48167771Seric #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
48265982Seric # endif
48365982Seric #endif
48465982Seric 
48565982Seric 
48665982Seric 
48765982Seric /*
48865049Seric **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
48964733Seric **
49064733Seric **  4.3BSD clone, closer to 4.4BSD
49164831Seric **
49264831Seric **	See also BSD defines.
49364733Seric */
49464733Seric 
49565049Seric #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
49664733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
49764733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
49866754Seric # ifdef __NetBSD__
49966754Seric #  define HASUNAME	1	/* has uname(2) syscall */
50066754Seric # endif
50164733Seric # include <sys/cdefs.h>
50264733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
503*69516Seric # define BSD4_4_SOCKADDR	/* has sa_len */
50464733Seric # ifndef LA_TYPE
50564733Seric #  define LA_TYPE	LA_SUBR
50664733Seric # endif
50765749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
50864733Seric #endif
50964733Seric 
51064733Seric 
51164733Seric /*
51264813Seric **  Mach386
51364813Seric **
51464813Seric **	For mt Xinu's Mach386 system.
51564813Seric */
51664813Seric 
51764813Seric #if defined(MACH) && defined(i386)
51864813Seric # define MACH386	1
51964813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
52064813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
52166226Seric # ifndef HASFLOCK
52265830Seric #  define HASFLOCK	1	/* has flock(2) call */
52365830Seric # endif
52464813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
52564813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
52664813Seric # define setpgid	setpgrp
52764813Seric # ifndef LA_TYPE
52864813Seric #  define LA_TYPE	LA_FLOAT
52964813Seric # endif
53065749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
53164962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
53264813Seric # undef WEXITSTATUS
53364813Seric # undef WIFEXITED
53464813Seric # ifndef _PATH_SENDMAILCF
53564813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
53664813Seric # endif
53764813Seric # ifndef _PATH_SENDMAILPID
53864813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
53964813Seric # endif
54064813Seric #endif
54164813Seric 
54264813Seric 
54364813Seric /*
54463969Seric **  4.3 BSD -- this is for very old systems
54563969Seric **
54665949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
54765949Seric **
54863969Seric **	You'll also have to install a new resolver library.
54963969Seric **	I don't guarantee that support for this environment is complete.
55063969Seric */
55163969Seric 
55265949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
55363969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
55463969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
55563970Seric # define ARBPTR_T	char *
55664155Seric # define setpgid	setpgrp
55763969Seric # ifndef LA_TYPE
55863969Seric #  define LA_TYPE	LA_FLOAT
55963969Seric # endif
56063969Seric # ifndef _PATH_SENDMAILCF
56163969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
56263969Seric # endif
56365167Seric # ifndef IDENTPROTO
56465167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
56565167Seric # endif
56664834Seric # undef WEXITSTATUS
56764834Seric # undef WIFEXITED
56864834Seric typedef short		pid_t;
56964834Seric extern int		errno;
57063969Seric #endif
57163969Seric 
57264314Seric 
57363969Seric /*
57463902Seric **  SCO Unix
57565087Seric **
57665087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
57765087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
57865087Seric **	The second is, I believe, for an older version.
57963902Seric */
58063902Seric 
58165087Seric #ifdef _SCO_unix_4_2
58265087Seric # define _SCO_unix_
58365087Seric # define HASSETREUID	1	/* has setreuid(2) call */
58466757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
58565087Seric # define _PATH_UNIX	"/unix"
58665087Seric # ifndef _PATH_SENDMAILCF
58765087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
58865087Seric # endif
58965087Seric # ifndef _PATH_SENDMAILPID
59065087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
59165087Seric # endif
59265087Seric #endif
59365087Seric 
59463838Seric #ifdef _SCO_unix_
59563838Seric # define SYSTEM5	1	/* include all the System V defines */
59664035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
59765212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
59863838Seric # define FORK		fork
59963838Seric # define MAXPATHLEN	PATHSIZE
60064718Seric # define LA_TYPE	LA_SHORT
60167812Seric # define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
60268439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
60367608Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
60464813Seric # undef NETUNIX			/* no unix domain socket support */
60563838Seric #endif
60663838Seric 
60764314Seric 
60863962Seric /*
60968442Seric **  ISC (SunSoft) Unix.
61068442Seric **
61168442Seric **	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
61268442Seric */
61368442Seric 
61468442Seric #ifdef ISC_UNIX
61568442Seric # include <net/errno.h>
61668442Seric # define SYSTEM5	1	/* include all the System V defines */
61768442Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
61868442Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
61968442Seric # define HASSETREUID	1	/* has setreuid(2) call */
62068442Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
62168442Seric # undef NETUNIX			/* no unix domain socket support */
62268442Seric # define FORK		fork
62368442Seric # define MAXPATHLEN	1024
62468442Seric # define LA_TYPE	LA_SHORT
62568442Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
62668442Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
62768442Seric # define _PATH_UNIX	"/unix"
62868442Seric # ifndef _PATH_SENDMAILCF
62968442Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
63068442Seric # endif
63168442Seric # ifndef _PATH_SENDMAILPID
63268442Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
63368442Seric # endif
63468442Seric 
63568442Seric typedef short		pid_t;
63668442Seric 
63768442Seric #endif
63868442Seric 
63968442Seric 
64068442Seric /*
64168040Seric **  Altos System V.
64268040Seric **	Contributed by Tim Rice <timr@crl.com>.
64368040Seric */
64468040Seric 
64568040Seric #ifdef ALTOS_SYS_V
64668040Seric # include <limits.h>
64768040Seric # define SYSTEM5	1	/* include all the System V defines */
64868040Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
64968040Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
65068040Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
65168040Seric # define NEEDFSYNC	1	/* no fsync(2) in system library */
65268040Seric # define FORK		fork
65368040Seric # define MAXPATHLEN	PATHSIZE
65468040Seric # define LA_TYPE	LA_SHORT
65568040Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
65668439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
65768040Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
65868040Seric # undef NETUNIX			/* no unix domain socket support */
65968040Seric # undef WIFEXITED
66068040Seric # undef WEXITSTATUS
66168040Seric # define strtoul	strtol	/* gcc library bogosity */
66268040Seric 
66368040Seric typedef unsigned short	uid_t;
66468040Seric typedef unsigned short	gid_t;
66568040Seric typedef short		pid_t;
66668040Seric #endif
66768040Seric 
66868040Seric 
66968040Seric /*
67063962Seric **  ConvexOS 11.0 and later
67165949Seric **
67265949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
67365949Seric **	works on 9.1 as well.
67463962Seric */
67563962Seric 
67663962Seric #ifdef _CONVEX_SOURCE
67763977Seric # define BSD		1	/* include all the BSD defines */
67863977Seric # define HASUNAME	1	/* use System V uname(2) system call */
67963962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
68063977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
68163962Seric # define LA_TYPE	LA_FLOAT
68265749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
68365949Seric # ifndef _PATH_SENDMAILCF
68465949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
68565949Seric # endif
68665949Seric # ifndef S_IREAD
68765949Seric #  define S_IREAD	_S_IREAD
68865949Seric #  define S_IWRITE	_S_IWRITE
68965949Seric #  define S_IEXEC	_S_IEXEC
69065949Seric #  define S_IFMT	_S_IFMT
69165949Seric #  define S_IFCHR	_S_IFCHR
69265949Seric #  define S_IFBLK	_S_IFBLK
69365949Seric # endif
69465167Seric # ifndef IDENTPROTO
69565167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
69665167Seric # endif
69763962Seric #endif
69863962Seric 
69964314Seric 
70063962Seric /*
70164999Seric **  RISC/os 4.52
70263962Seric **
70364999Seric **	Gives a ton of warning messages, but otherwise compiles.
70463962Seric */
70563962Seric 
70663965Seric #ifdef RISCOS
70764999Seric 
70863962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
70966226Seric # ifndef HASFLOCK
71065830Seric #  define HASFLOCK	1	/* has flock(2) call */
71165830Seric # endif
71264999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
71364999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
71463962Seric # define LA_TYPE	LA_INT
71563962Seric # define LA_AVENRUN	"avenrun"
71663962Seric # define _PATH_UNIX	"/unix"
71764999Seric # undef WIFEXITED
71864999Seric 
71964999Seric # define setpgid	setpgrp
72064999Seric 
72164999Seric extern int		errno;
72264999Seric typedef int		pid_t;
72364999Seric #define			SIGFUNC_DEFINED
72464999Seric typedef int		(*sigfunc_t)();
72564999Seric extern char		*getenv();
72664999Seric extern void		*malloc();
72764999Seric 
72863962Seric #endif
72963962Seric 
73064314Seric 
73164155Seric /*
73264155Seric **  Linux 0.99pl10 and above...
73366300Seric **
73466300Seric **  Thanks to, in reverse order of contact:
73566300Seric **
73668093Seric **	John Kennedy <warlock@csuchico.edu>
73767885Seric **	Andrew Pam <avatar@aus.xanadu.com>
73866300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
73966300Seric **	Karl London <karl@borg.demon.co.uk>
74066300Seric **
74168093Seric **  Last compiled against:	[12/14/94 @ 11:38:41 PM (Wednesday)]
74268093Seric **	sendmail 8.7.a.5	named 4.9.3-beta12-p1	db-1.85
74368093Seric **	gcc 2.6.2		libc.so.4.6.20
74468093Seric **	slackware 2.1.0		linux 1.1.70
74564155Seric */
74664155Seric 
74764770Seric #ifdef __linux__
74866298Seric # define BSD		1	/* include BSD defines */
74964155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
75066298Seric # define HASUNAME	1	/* use System V uname(2) system call */
75164380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
75266298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
75366300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
75467885Seric # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
75568518Seric # ifndef HASFLOCK
75668518Seric #  define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
75768518Seric # endif
75864155Seric # ifndef LA_TYPE
75966301Seric #  define LA_TYPE	LA_PROCSTR
76064155Seric # endif
76166300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
76268093Seric # ifndef _PATH_SENDMAILPID
76368093Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
76468093Seric # endif
76568093Seric # define TZ_TYPE	TZ_TNAME
76664763Seric # include <sys/sysmacros.h>
76766300Seric # undef atol			/* wounded in <stdlib.h> */
76864155Seric #endif
76964155Seric 
77064155Seric 
77164345Seric /*
77264345Seric **  DELL SVR4 Issue 2.2, and others
77364345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
77464345Seric **
77564345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
77664345Seric **	defined, and the definitions conflict.
77764924Seric **
77864924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
77964924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
78064924Seric **	(SVR4.0/386 version 3.0).
78164345Seric */
78264345Seric 
78364345Seric #ifdef DELL_SVR4
78465189Seric 				/* no changes necessary */
78565189Seric 				/* see general __svr4__ defines below */
78664345Seric #endif
78764345Seric 
78864345Seric 
78964380Seric /*
79064380Seric **  Apple A/UX 3.0
79164380Seric */
79264345Seric 
79364380Seric #ifdef _AUX_SOURCE
79464729Seric # include <sys/sysmacros.h>
79564380Seric # define BSD			/* has BSD routines */
79668803Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
79764380Seric # define HASUNAME	1	/* use System V uname(2) system call */
79864380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
79964561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
80065167Seric # ifndef IDENTPROTO
80165167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
80265167Seric # endif
80364380Seric # define FORK		fork
80464380Seric # ifndef _PATH_SENDMAILCF
80564380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
80664380Seric # endif
80764380Seric # ifndef LA_TYPE
80864380Seric #  define LA_TYPE	LA_ZERO
80964380Seric # endif
81065749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
81164560Seric # undef WIFEXITED
81264560Seric # undef WEXITSTATUS
81364380Seric #endif
81464380Seric 
81564380Seric 
81664705Seric /*
81764705Seric **  Encore UMAX V
81864705Seric **
81964705Seric **	Not extensively tested.
82064705Seric */
82164380Seric 
82264705Seric #ifdef UMAXV
82364705Seric # include <limits.h>
82464705Seric # define HASUNAME	1	/* use System V uname(2) system call */
82564705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
82664705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
82765211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
82864705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
82964705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
83064705Seric # define FORK		fork	/* no vfork(2) primitive available */
83165749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
83264705Seric # define MAXPATHLEN	PATH_MAX
83364705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
83464705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
83564705Seric # undef WIFEXITED
83664705Seric # undef WEXITSTATUS
83764705Seric #endif
83864705Seric 
83964705Seric 
84064939Seric /*
84164939Seric **  Stardent Titan 3000 running TitanOS 4.2.
84264939Seric **
84364939Seric **	Must be compiled in "cc -43" mode.
84464939Seric **
84564944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
84664939Seric **
84764939Seric **	Note the tweaking below after the BSD defines are set.
84864939Seric */
84964705Seric 
85064939Seric #ifdef titan
85164939Seric # define setpgid	setpgrp
85264939Seric typedef int		pid_t;
85364939Seric # undef WIFEXITED
85464939Seric # undef WEXITSTATUS
85564939Seric #endif
85664939Seric 
85764939Seric 
85864962Seric /*
85964962Seric **  Sequent DYNIX 3.2.0
86064962Seric **
86164962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
86264962Seric */
86364939Seric 
86464962Seric #ifdef sequent
86566038Seric 
86664962Seric # define BSD		1
86764962Seric # define HASUNSETENV	1
86864962Seric # define BSD4_3		1	/* to get signal() in conf.c */
86964962Seric # define WAITUNION	1
87064962Seric # define LA_TYPE	LA_FLOAT
87164962Seric # ifdef	_POSIX_VERSION
87264962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
87364962Seric # endif
87464962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
87564962Seric # define setpgid	setpgrp
87664962Seric 
87764962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
87864962Seric # undef	WIFEXITED
87964962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
88064962Seric 			 ((union wait*)&(s))->w_termsig == 0)
88164962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
88264962Seric typedef int		pid_t;
88364962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
88464962Seric 
88566144Seric # ifndef IDENTPROTO
88666144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
88766144Seric # endif
88866144Seric 
88964962Seric # ifndef _PATH_UNIX
89064962Seric #  define _PATH_UNIX	"/dynix"
89164962Seric # endif
89264962Seric # ifndef _PATH_SENDMAILCF
89364962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
89464962Seric # endif
89564962Seric 
89664962Seric #endif
89764962Seric 
89864962Seric 
89965748Seric /*
90066038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
90166038Seric **
90266038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
90366038Seric **
90466038Seric **	From Tim Wright <timw@sequent.com>.
90566038Seric */
90666038Seric 
90766038Seric #ifdef _SEQUENT_
90866038Seric # define SYSTEM5	1	/* include all the System V defines */
90966038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
91066038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
91166038Seric # define HASSETREUID	1	/* has setreuid(2) call */
91266038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
91366038Seric # define GIDSET_T	gid_t
91466038Seric # define LA_TYPE	LA_INT
91566038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
91667771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
91766144Seric # ifndef IDENTPROTO
91866144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
91966144Seric # endif
92066038Seric # ifndef _PATH_SENDMAILCF
92166038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
92266038Seric # endif
92366038Seric # ifndef _PATH_SENDMAILPID
92466038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
92566038Seric # endif
92666038Seric #endif
92766038Seric 
92866038Seric 
92966038Seric /*
93065748Seric **  Cray Unicos
93165748Seric **
93265748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
93365748Seric */
93464962Seric 
93565748Seric #ifdef UNICOS
93665748Seric # define SYSTEM5	1	/* include all the System V defines */
93765748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
93865748Seric # define MAXPATHLEN	PATHSIZE
93965748Seric # define LA_TYPE	LA_ZERO
94065749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
94168439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
94265748Seric #endif
94364962Seric 
94465748Seric 
94565820Seric /*
94665820Seric **  Apollo DomainOS
94765820Seric **
94865820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
94965982Seric **
95065820Seric **  15 Jan 1994
95165820Seric **
95265820Seric */
95365748Seric 
95465820Seric #ifdef apollo
95565820Seric # define HASSETREUID	1	/* has setreuid(2) call */
95665820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
95767771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
95865820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
95966044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
96068439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
96165820Seric # ifndef _PATH_SENDMAILCF
96265820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
96365820Seric # endif
96465820Seric # ifndef _PATH_SENDMAILPID
96565820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
96665820Seric # endif
96765820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
96865820Seric # undef  S_IFIFO
96965820Seric # define S_IFIFO	0010000
97065820Seric # ifndef IDENTPROTO
97165820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
97265820Seric # endif
97365982Seric #endif
97465820Seric 
97565820Seric 
97666748Seric /*
97767745Seric **  UnixWare 1.1.2.
97866752Seric **
97966752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
98066752Seric */
98166752Seric 
98266752Seric #ifdef UNIXWARE
98366752Seric # define SYSTEM5		1
98467745Seric # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
98567745Seric # define HASGETDTABLESIZE	1
98667745Seric # define HASSETREUID		1
98767745Seric # define HASSETSID		1
98867745Seric # define HASINITGROUPS		1
98967745Seric # define GIDSET_T		gid_t
99067745Seric # define SLEEP_T		unsigned
99166752Seric # define SFS_TYPE		SFS_STATVFS
99266752Seric # define LA_TYPE		LA_ZERO
99366752Seric # undef WIFEXITED
99466752Seric # undef WEXITSTATUS
99566752Seric # define _PATH_UNIX		"/unix"
99666752Seric # ifndef _PATH_SENDMAILCF
99766752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
99866752Seric # endif
99966752Seric # ifndef _PATH_SENDMAILPID
100066752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
100166752Seric # endif
100266752Seric # define SYSLOG_BUFSIZE	128
100366752Seric #endif
100466752Seric 
100566752Seric 
100666752Seric /*
100766748Seric **  Intergraph CLIX 3.1
100866748Seric **
100966748Seric **	From Paul Southworth <pauls@locust.cic.net>
101066748Seric */
101165820Seric 
101266748Seric #ifdef CLIX
101366748Seric # define SYSTEM5	1	/* looks like System V */
101466752Seric # ifndef HASGETUSERSHELL
101566752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
101666752Seric # endif
101766748Seric # define DEV_BSIZE	512	/* device block size not defined */
101866748Seric # define GIDSET_T	gid_t
101966748Seric # undef LOG			/* syslog not available */
102066748Seric # define NEEDFSYNC	1	/* no fsync in system library */
102166748Seric # define GETSHORT	_getshort
102266748Seric #endif
102365820Seric 
102466748Seric 
102566776Seric /*
102666776Seric **  NCR 3000 Series (SysVr4)
102766776Seric **
102867434Seric **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
102966776Seric */
103066748Seric 
103166776Seric #ifdef NCR3000
103266776Seric # define __svr4__
103366776Seric # undef BSD
103466776Seric # define LA_AVENRUN	"avenrun"
103566776Seric #endif
103666748Seric 
103766776Seric 
103867434Seric /*
103967434Seric **  Tandem NonStop-UX SVR4
104067434Seric **
104167434Seric **	From Rick McCarty <mccarty@mpd.tandem.com>.
104267434Seric */
104366776Seric 
104467434Seric #ifdef NonStop_UX_BXX
104567434Seric # define __svr4__
104667434Seric #endif
104766776Seric 
104867434Seric 
104967488Seric /*
105067488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
105167488Seric **
105267488Seric **	Tested for 1.04 and 1.03
105367488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
105467488Seric */
105567434Seric 
105667488Seric #ifdef __H3050R
105767488Seric # define SYSTEM5	1	/* include all the System V defines */
105867488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
105967488Seric # define setreuid(r, e)	setresuid(r, e, -1)
106067488Seric # define LA_TYPE	LA_FLOAT
106167488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
106267488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
106367488Seric # ifndef GIDSET_T
106467488Seric #  define GIDSET_T	gid_t
106567488Seric # endif
106667488Seric # ifndef _PATH_UNIX
106767488Seric #  define _PATH_UNIX	"/HI-UX"
106867488Seric # endif
106967488Seric # ifndef _PATH_SENDMAILCF
107067488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
107167488Seric # endif
107267488Seric # ifndef IDENTPROTO
107367488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
107467488Seric # endif
107567488Seric # ifndef HASGETUSERSHELL
107667488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
107767488Seric # endif
107867488Seric 
107967488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
108067488Seric # undef m_flags
108167488Seric 
108267488Seric # ifdef __STDC__
108367488Seric extern int	syslog(int, char *, ...);
108467488Seric # endif
108567488Seric 
108667488Seric #endif
108767488Seric 
108867488Seric 
108968099Seric /*
109068099Seric **  Amdahl UTS System V 2.1.5 (SVr3-based)
109168099Seric **
109268099Seric **    From: Janet Jackson <janet@dialix.oz.au>.
109368099Seric */
109467488Seric 
109568099Seric #ifdef _UTS
109668099Seric # include <sys/sysmacros.h>
109768099Seric # undef HASLSTAT	/* has symlinks, but they cause problems */
109868099Seric # define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
109968099Seric # define SYS5SIGNALS	1	/* System V signal semantics */
110068099Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
110168099Seric # define HASUNAME	1	/* use System V uname(2) system call */
110268099Seric # define HASINITGROUPS	1	/* has initgroups(3) function */
110368099Seric # define HASSETVBUF	1	/* has setvbuf(3) function */
110468099Seric # define HASSIGSETMASK	0	/* does not have sigsetmask(2) function */
110568099Seric # ifndef HASGETUSERSHELL
110668099Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
110768099Seric # endif
110868099Seric # define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
110968099Seric # define LA_TYPE	LA_ZERO		/* doesn't have load average */
111068099Seric # define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
111168439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
111268099Seric # define _PATH_UNIX	"/unix"
111368099Seric # ifndef _PATH_SENDMAILCF
111468099Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
111568099Seric # endif
111668099Seric #endif
111768099Seric 
111868357Seric /*
111968357Seric **  Cray Computer Corporation's CSOS
112068357Seric **
112169473Seric **	From Scott Bolte <scott@craycos.com>.
112268357Seric */
112368099Seric 
112468357Seric #ifdef _CRAYCOM
112568357Seric # define SYSTEM5	1	/* include all the System V defines */
112668357Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
112768357Seric # define NEEDFSYNC	1	/* no fsync in system library */
112868357Seric # define MAXPATHLEN	PATHSIZE
112968357Seric # define LA_TYPE	LA_ZERO
113068357Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
113168439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
113268357Seric # define _POSIX_CHOWN_RESTRICTED	-1
113368357Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
113468357Seric #endif
113568099Seric 
113668099Seric 
113768742Seric /*
113868742Seric **  Sony NEWS-OS 4.2.1R and 6.0.3
113969473Seric **
114069473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
114168742Seric */
114268742Seric 
114368742Seric #ifdef sony_news
114468742Seric # ifndef __svr4
114568742Seric 			/* NEWS-OS 4.2.1R */
114668742Seric #  ifndef BSD
114768742Seric #   define BSD			/* has BSD routines */
114868742Seric #  endif
114968742Seric #  define HASUNSETENV	1	/* has unsetenv(2) call */
115068742Seric #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
115168742Seric #  define WAITUNION	1	/* use "union wait" as wait argument type */
115268742Seric #  define LA_TYPE	LA_INT
115368742Seric #  define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
115468742Seric #  ifndef HASFLOCK
115568742Seric #   define HASFLOCK	1	/* has flock(2) call */
115668742Seric #  endif
115768742Seric #  define setpgid	setpgrp
115868742Seric #  undef WIFEXITED
115968742Seric #  undef WEXITSTATUS
116068742Seric typedef int		pid_t;
116168742Seric typedef int		(*sigfunc_t)();
116268742Seric #  define SIGFUNC_DEFINED
116368742Seric 
116468742Seric # else
116568742Seric 			/* NEWS-OS 6.0.3 with /bin/cc */
116668742Seric #  define SYSTEM5	1	/* include all the System V defines */
116768742Seric #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
116868742Seric #  define HASINITGROUPS	1	/* has initgroups(3) call */
116968742Seric #  define HASSETREUID	1	/* has setreuid(2) call */
117068742Seric #  define HASSETSID	1	/* has Posix setsid(2) call */
117168742Seric #  define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
117269473Seric #  define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
117368742Seric #  define SFS_TYPE	SFS_STATVFS	/* use <sys/statvfs.h> statvfs() impl */
117468742Seric #  define GIDSET_T	gid_t
117568742Seric #  define setreuid(r, e)	seteuid(e)
117668742Seric #  undef WIFEXITED
117768742Seric #  undef WEXITSTATUS
117868742Seric #  define _PATH_UNIX  "/stand/unix"
117968742Seric #  ifndef _PATH_SENDMAILCF
118068742Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
118168742Seric #  endif
118268742Seric #  ifndef _PATH_SENDMAILPID
118368742Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
118468742Seric #  endif
118568742Seric 
118668742Seric # endif
118768742Seric #endif
118868742Seric 
118968742Seric 
119068742Seric /*
119168742Seric **  Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
119269473Seric **
119369473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
119468742Seric */
119568742Seric 
119668742Seric #ifdef luna
119768742Seric # ifndef IDENTPROTO
119868742Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
119968742Seric # endif
120068742Seric # ifdef uniosb
120169454Seric #  include <sys/time.h>
120268742Seric #  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
120368742Seric # endif
120468742Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
120568742Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
120668742Seric # ifdef uniosb
120768742Seric #  define LA_TYPE	LA_INT
120868742Seric # endif
120968742Seric # ifdef luna2m
121068742Seric #  define LA_TYPE	LA_SUBR
121168742Seric # endif
121268742Seric # ifdef luna88k
121368742Seric #  define LA_TYPE	LA_INT
121468742Seric # endif
121568742Seric # define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
121668742Seric # define setpgid	setpgrp
121768742Seric # undef WIFEXITED
121868742Seric # undef WEXITSTATUS
121968742Seric typedef int		pid_t;
122068742Seric typedef int		(*sigfunc_t)();
122168742Seric # define SIGFUNC_DEFINED
122268742Seric extern char	*getenv();
122368742Seric extern int	errno;
122468742Seric # ifndef _PATH_SENDMAILCF
122568742Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
122668742Seric # endif
122768742Seric #endif
122868742Seric 
122968742Seric 
123068742Seric /*
123169473Seric **  NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
123268742Seric **
123369473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
123468742Seric */
123568742Seric 
123668742Seric #ifdef nec_ews_svr4
123769454Seric # ifndef __svr4__
123869454Seric #  define __svr4__		/* use all System V Releae 4 defines below */
123969454Seric # endif
124068742Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
124168742Seric # define HASSETSID	1	/* has Posix setsid(2) call */
124269473Seric # define LA_TYPE	LA_READKSYM	/* use MIOC_READSYM ioctl */
124368742Seric # define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
124468742Seric # define GIDSET_T	gid_t
124568742Seric # undef WIFEXITED
124668742Seric # undef WEXITSTATUS
124769454Seric # define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
124868742Seric #endif
124968742Seric 
125068742Seric 
125168742Seric 
125263902Seric /**********************************************************************
125363787Seric **  End of Per-Operating System defines
125463902Seric **********************************************************************/
125563787Seric 
125663949Seric /**********************************************************************
125763949Seric **  More general defines
125863949Seric **********************************************************************/
125963949Seric 
126063962Seric /* general BSD defines */
126163962Seric #ifdef BSD
126264035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
126364035Seric # define HASSETREUID	1	/* has setreuid(2) call */
126467742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
126567430Seric # ifndef HASSETRLIMIT
126667430Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
126767430Seric # endif
126865830Seric # ifndef HASFLOCK
126965830Seric #  define HASFLOCK	1	/* has flock(2) call */
127065830Seric # endif
127167602Seric # ifndef TZ_TYPE
127267608Seric #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
127367602Seric # endif
127463962Seric #endif
127563962Seric 
127665189Seric /* general System V Release 4 defines */
127765189Seric #ifdef __svr4__
127865189Seric # define SYSTEM5	1
127965189Seric # define HASSETREUID	1	/* has seteuid(2) call & working saved uids */
128067742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
128167742Seric # ifndef HASSETRLIMIT
128267742Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
128367742Seric # endif
128465211Seric # ifndef HASGETUSERSHELL
128565211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
128665210Seric # endif
128765189Seric # define setreuid(r, e)	seteuid(e)
128865189Seric 
128965189Seric # ifndef _PATH_UNIX
129065189Seric #  define _PATH_UNIX		"/unix"
129165189Seric # endif
129265189Seric # ifndef _PATH_SENDMAILCF
129365189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
129465189Seric # endif
129565189Seric # ifndef _PATH_SENDMAILPID
129665189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
129765189Seric # endif
129865189Seric # ifndef SYSLOG_BUFSIZE
129965189Seric #  define SYSLOG_BUFSIZE	128
130065189Seric # endif
130167159Seric # ifndef SFS_TYPE
130267159Seric #  define SFS_TYPE		SFS_STATVFS
130367159Seric # endif
130465189Seric #endif
130565189Seric 
130663787Seric /* general System V defines */
130766298Seric #ifdef SYSTEM5
130864813Seric # include <sys/sysmacros.h>
130963949Seric # define HASUNAME	1	/* use System V uname(2) system call */
131064705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
131164962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
131267430Seric # ifndef HASULIMIT
131367430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
131467430Seric # endif
131563962Seric # ifndef LA_TYPE
131669462Seric #  ifdef MIOC_READKSYM
131769462Seric #   define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
131869462Seric #  else
131969462Seric #   define LA_TYPE	LA_INT		/* assume integer load average */
132069462Seric #  endif
132163962Seric # endif
132265749Seric # ifndef SFS_TYPE
132365749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
132465749Seric # endif
132567602Seric # ifndef TZ_TYPE
132667608Seric #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
132767602Seric # endif
132868442Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
132968442Seric # define bzero(d, l)		(memset((d), '\0', (l)))
133068442Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
133166298Seric #endif
133263787Seric 
133363949Seric /* general POSIX defines */
133463949Seric #ifdef _POSIX_VERSION
133564718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
133664718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
133763949Seric #endif
133863949Seric 
133963787Seric /*
134063937Seric **  If no type for argument two of getgroups call is defined, assume
134163937Seric **  it's an integer -- unfortunately, there seem to be several choices
134263937Seric **  here.
134363937Seric */
134463937Seric 
134563937Seric #ifndef GIDSET_T
134663937Seric # define GIDSET_T	int
134763937Seric #endif
134863937Seric 
134964939Seric /*
135068357Seric **  Tweaking for systems that (for example) claim to be BSD or POSIX
135168357Seric **  but don't have all the standard BSD or POSIX routines (boo hiss).
135264939Seric */
135364439Seric 
135464939Seric #ifdef titan
135564939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
135664939Seric #endif
135764939Seric 
135868357Seric #ifdef _CRAYCOM
135968357Seric # undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
136068357Seric #endif
136165830Seric 
136268442Seric #ifdef ISC_UNIX
136368442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
136468442Seric #endif
136568357Seric 
136668442Seric #ifdef ALTOS_SYS_V
136768442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
136868442Seric # undef bzero			/* despite SystemV claim, uses BSD bzero */
136968442Seric # undef bcmp			/* despite SystemV claim, uses BSD bcmp */
137068442Seric #endif
137168442Seric 
137268442Seric 
137365167Seric /*
137465167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
137565167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
137665167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
137765167Seric **  are closed.  Some firewalls return this error if you try to connect
137865167Seric **  to the IDENT port (113), so you can't receive email from these hosts
137965167Seric **  on these systems.  The firewall really should use a more specific
138065167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
138165167Seric **  not explicitly set to zero above, default it on.
138265167Seric */
138364939Seric 
138465167Seric #ifndef IDENTPROTO
138565167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
138665167Seric #endif
138765167Seric 
138865211Seric #ifndef HASGETUSERSHELL
138965211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
139065210Seric #endif
139165167Seric 
139265830Seric #ifndef HASFLOCK
139365830Seric # define HASFLOCK	0	/* assume no flock(2) support */
139465830Seric #endif
139565210Seric 
139667430Seric #ifndef HASSETRLIMIT
139767430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
139867430Seric #endif
139967430Seric 
140067430Seric #ifndef HASULIMIT
140167430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
140267430Seric #endif
140367430Seric 
140466843Seric #ifndef OLD_NEWDB
140566843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
140666843Seric #endif
140765830Seric 
140868099Seric /* heuristic setting of HASSETSIGMASK; can override above */
140968099Seric #ifndef HASSIGSETMASK
141068099Seric # ifdef SIGVTALRM
141168099Seric #  define HASSETSIGMASK	1
141268099Seric # else
141368099Seric #  define HASSETSIGMASK	0
141468099Seric # endif
141568099Seric #endif
141666843Seric 
141768705Seric #ifndef UID_T
141868705Seric # define UID_T		uid_t
141968705Seric #endif
142068099Seric 
142168706Seric #ifndef SIZE_T
142268706Seric # define SIZE_T		size_t
142368706Seric #endif
142468706Seric 
142568705Seric #ifndef ARGV_T
142668705Seric # define ARGV_T		char **
142768705Seric #endif
142868705Seric 
142968705Seric 
143064439Seric /**********************************************************************
143159023Seric **  Remaining definitions should never have to be changed.  They are
143259023Seric **  primarily to provide back compatibility for older systems -- for
143359287Seric **  example, it includes some POSIX compatibility definitions
143464439Seric **********************************************************************/
143559023Seric 
143659388Seric /* System 5 compatibility */
143759388Seric #ifndef S_ISREG
143864944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
143959388Seric #endif
144064944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
144164944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
144264944Seric #endif
144368494Seric #ifndef S_IWUSR
144468494Seric # define S_IWUSR		0200
144568494Seric #endif
144659388Seric #ifndef S_IWGRP
144768494Seric # define S_IWGRP		0020
144859388Seric #endif
144959388Seric #ifndef S_IWOTH
145068494Seric # define S_IWOTH		0002
145159388Seric #endif
145259388Seric 
145359023Seric /*
145450537Seric **  Older systems don't have this error code -- it should be in
145550537Seric **  /usr/include/sysexits.h.
145650537Seric */
145750537Seric 
145850537Seric # ifndef EX_CONFIG
145950537Seric # define EX_CONFIG	78	/* configuration error */
146050537Seric # endif
146156852Seric 
146264718Seric /* pseudo-code used in server SMTP */
146364718Seric # define EX_QUIT	22	/* drop out of server immediately */
146464718Seric 
146564718Seric 
146663993Seric /*
146763993Seric **  These are used in a few cases where we need some special
146863993Seric **  error codes, but where the system doesn't provide something
146963993Seric **  reasonable.  They are printed in errstring.
147063993Seric */
147163993Seric 
147263993Seric #ifndef E_PSEUDOBASE
147363993Seric # define E_PSEUDOBASE	256
147463993Seric #endif
147563993Seric 
147663993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
147763993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
147863993Seric 
147963970Seric /* type of arbitrary pointer */
148063970Seric #ifndef ARBPTR_T
148163970Seric # define ARBPTR_T	void *
148263970Seric #endif
148363970Seric 
148460568Seric #ifndef __P
148560568Seric # include "cdefs.h"
148660568Seric #endif
148760568Seric 
148867421Seric #if NAMED_BIND
148967421Seric # include <arpa/nameser.h>
149067434Seric # ifdef __svr4__
149167434Seric #  ifdef NOERROR
149267434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
149367434Seric #  endif
149467434Seric # endif
149567421Seric #endif
149667421Seric 
149756852Seric /*
149867419Seric **  The size of an IP address -- can't use sizeof because of problems
149967419Seric **  on Crays, where everything is 64 bits.  This will break if/when
150067419Seric **  IP addresses are expanded to eight bytes.
150167419Seric */
150267419Seric 
150367421Seric #ifndef INADDRSZ
150467421Seric # define INADDRSZ	4
150567421Seric #endif
150667419Seric 
150767419Seric /*
150867421Seric **  The size of various known types -- for reading network protocols.
150967421Seric **  Again, we can't use sizeof because of compiler randomness.
151067421Seric */
151167421Seric 
151267421Seric #ifndef INT16SZ
151367421Seric # define INT16SZ	2
151467421Seric #endif
151567421Seric #ifndef INT32SZ
151667421Seric # define INT32SZ	4
151767421Seric #endif
151867421Seric 
151967421Seric /*
152058778Seric **  Do some required dependencies
152158778Seric */
152258778Seric 
152358778Seric #if defined(NETINET) || defined(NETISO)
152459107Seric # define SMTP		1	/* enable user and server SMTP */
152559107Seric # define QUEUE		1	/* enable queueing */
152659107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
152758778Seric #endif
152858778Seric 
152958778Seric 
153058778Seric /*
153156852Seric **  Arrange to use either varargs or stdargs
153256852Seric */
153356852Seric 
153456852Seric # ifdef __STDC__
153556852Seric 
153656852Seric # include <stdarg.h>
153756852Seric 
153856852Seric # define VA_LOCAL_DECL	va_list ap;
153956852Seric # define VA_START(f)	va_start(ap, f)
154056852Seric # define VA_END		va_end(ap)
154156852Seric 
154256852Seric # else
154356852Seric 
154456852Seric # include <varargs.h>
154556852Seric 
154656852Seric # define VA_LOCAL_DECL	va_list ap;
154756852Seric # define VA_START(f)	va_start(ap)
154856852Seric # define VA_END		va_end(ap)
154956852Seric 
155056852Seric # endif
155157631Seric 
155257943Seric #ifdef HASUNAME
155357631Seric # include <sys/utsname.h>
155457631Seric # ifdef newstr
155557631Seric #  undef newstr
155657631Seric # endif
155757943Seric #else /* ! HASUNAME */
155857631Seric # define NODE_LENGTH 32
155957631Seric struct utsname
156057631Seric {
156157631Seric 	char nodename[NODE_LENGTH+1];
156257631Seric };
156357943Seric #endif /* HASUNAME */
156457642Seric 
156568040Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
156663838Seric # define MAXHOSTNAMELEN	256
156757735Seric #endif
156858153Seric 
156958153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
157058153Seric # define SIGCHLD	SIGCLD
157158153Seric #endif
157258153Seric 
157358153Seric #ifndef STDIN_FILENO
157468742Seric # define STDIN_FILENO	0
157558153Seric #endif
157658153Seric 
157758153Seric #ifndef STDOUT_FILENO
157868742Seric # define STDOUT_FILENO	1
157958153Seric #endif
158058153Seric 
158158153Seric #ifndef STDERR_FILENO
158268742Seric # define STDERR_FILENO	2
158358153Seric #endif
158458689Seric 
158564072Seric #ifndef LOCK_SH
158664035Seric # define LOCK_SH	0x01	/* shared lock */
158764035Seric # define LOCK_EX	0x02	/* exclusive lock */
158864035Seric # define LOCK_NB	0x04	/* non-blocking lock */
158964035Seric # define LOCK_UN	0x08	/* unlock */
159064035Seric #endif
159158692Seric 
159268742Seric #ifndef SEEK_SET
159368742Seric # define SEEK_SET	0
159468742Seric # define SEEK_CUR	1
159568742Seric # define SEEK_END	2
159668742Seric #endif
159768742Seric 
159864035Seric #ifndef SIG_ERR
159964035Seric # define SIG_ERR	((void (*)()) -1)
160058689Seric #endif
160158702Seric 
160264500Seric #ifndef WEXITSTATUS
160364500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
160464500Seric #endif
160564500Seric #ifndef WIFEXITED
160664500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
160764500Seric #endif
160864500Seric 
160964561Seric #ifndef SIGFUNC_DEFINED
161064561Seric typedef void		(*sigfunc_t) __P((int));
161164561Seric #endif
161264561Seric 
161365053Seric /* size of syslog buffer */
161465053Seric #ifndef SYSLOG_BUFSIZE
161565053Seric # define SYSLOG_BUFSIZE	1024
161665053Seric #endif
161765053Seric 
161858702Seric /*
161958702Seric **  Size of tobuf (deliver.c)
162058702Seric **	Tweak this to match your syslog implementation.  It will have to
162158702Seric **	allow for the extra information printed.
162258702Seric */
162358702Seric 
162458702Seric #ifndef TOBUFSIZE
162565053Seric # if (SYSLOG_BUFSIZE) > 512
162665053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
162765053Seric # else
162865053Seric #  define TOBUFSIZE	256
162965053Seric # endif
163058702Seric #endif
163160219Seric 
163265015Seric /*
163365015Seric **  Size of prescan buffer.
163465015Seric **	Despite comments in the _sendmail_ book, this probably should
163565015Seric **	not be changed; there are some hard-to-define dependencies.
163665015Seric */
163765015Seric 
163865015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
163960219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
164060219Seric # ifndef FORK
164160219Seric # define FORK		vfork		/* function to call to fork mailer */
164260219Seric # endif
164365955Seric 
164465955Seric /*
164565955Seric **  If we are going to link scanf anyway, use it in readcf
164665955Seric */
164765955Seric 
164865955Seric #if !defined(HASUNAME) && !defined(SCANF)
164965955Seric # define SCANF		1
165065955Seric #endif
1651