xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 69892)
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*69892Seric  *	@(#)conf.h	8.190 (Berkeley) 06/15/95
933728Sbostic  */
109147Seric 
1122726Sdist /*
1222726Sdist **  CONF.H -- All user-configurable parameters for sendmail
1369681Seric **
1469681Seric **	Send updates to sendmail@CS.Berkeley.EDU so they will be
1569681Seric **	included in the next release.
1622726Sdist */
179147Seric 
1869562Seric struct rusage;	/* forward declaration to get gcc to shut up in wait.h */
1969562Seric 
2057232Seric # include <sys/param.h>
2164705Seric # include <sys/types.h>
2259389Seric # include <sys/stat.h>
2364380Seric # include <sys/file.h>
2464500Seric # include <sys/wait.h>
2558689Seric # include <fcntl.h>
2664035Seric # include <signal.h>
2768693Seric # include <netdb.h>
2868693Seric # include <pwd.h>
2957232Seric 
3063902Seric /**********************************************************************
319147Seric **  Table sizes, etc....
329147Seric **	There shouldn't be much need to change these....
3363902Seric **********************************************************************/
349147Seric 
3559303Seric # define MAXLINE	2048		/* max line length */
3624945Seric # define MAXNAME	256		/* max length of a name */
379147Seric # define MAXPV		40		/* max # of parms to mailers */
3859303Seric # define MAXATOM	200		/* max atoms per address */
399147Seric # define MAXMAILERS	25		/* maximum mailers known to system */
4068384Seric # define MAXRWSETS	200		/* max # of sets of rewriting rules */
419147Seric # define MAXPRIORITIES	25		/* max values for Precedence: field */
4257143Seric # define MAXMXHOSTS	20		/* max # of MX records */
4352106Seric # define SMTPLINELIM	990		/* maximum SMTP line length */
4457232Seric # define MAXKEY		128		/* maximum size of a database key */
4557232Seric # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
4659056Seric # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
4759667Seric # define MAXALIASDB	12		/* max # of alias databases */
4867729Seric # define MAXMAPSTACK	12		/* max # of stacked or sequenced maps */
4967729Seric # define MAXTOCLASS	8		/* max # of message timeout classes */
5068517Seric # define MAXMIMEARGS	20		/* max args in Content-Type: */
5168517Seric # define MAXMIMENESTING	20		/* max MIME multipart nesting */
5269722Seric # define QUEUESEGSIZE	1000		/* increment for queue size */
5357143Seric 
5463902Seric /**********************************************************************
559147Seric **  Compilation options.
5669881Seric **	#define these to 1 if they are available;
5769881Seric **	#define them to 0 otherwise.
5869881Seric **  All can be overridden from Makefile.
5963902Seric **********************************************************************/
609147Seric 
6169881Seric # ifndef NETINET
6269881Seric #  define NETINET	1	/* include internet support */
6356337Seric # endif
6456337Seric 
6566334Seric # ifndef NAMED_BIND
6666334Seric #  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
6766334Seric # endif
6866334Seric 
6969881Seric # ifndef XDEBUG
7069881Seric #  define XDEBUG	1	/* enable extended debugging */
7169881Seric # endif
7269881Seric 
7369881Seric # ifndef MATCHGECOS
7469881Seric #  define MATCHGECOS	1	/* match user names from gecos field */
7569881Seric # endif
7669881Seric 
7768848Seric # ifndef DSN
7868848Seric #  define DSN		1	/* include delivery status notification code */
7968848Seric # endif
8068848Seric 
8169881Seric # if !defined(USERDB) && (defined(NEWDB) || defined(HESIOD))
8269881Seric #  define USERDB	1	/* look in user database */
8369881Seric # endif
8469881Seric 
8569480Seric # ifndef MIME8TO7
8669480Seric #  define MIME8TO7	1	/* 8->7 bit MIME conversions */
8769480Seric # endif
8869480Seric 
8969480Seric # ifndef MIME7TO8
9069480Seric #  define MIME7TO8	1	/* 7->8 bit MIME conversions */
9169480Seric # endif
9269480Seric 
9369881Seric /**********************************************************************
9469881Seric **  "Hard" compilation options.
9569881Seric **	#define these if they are available; comment them out otherwise.
9669881Seric **  These cannot be overridden from the Makefile, and should really not
9769881Seric **  be turned off unless absolutely necessary.
9869881Seric **********************************************************************/
9964944Seric 
10069881Seric # define LOG			/* enable logging -- don't turn off */
10164944Seric 
10269881Seric /**********************************************************************
10369881Seric **  End of site-specific configuration.
10469881Seric **********************************************************************/
10569881Seric /*
10664962Seric **  General "standard C" defines.
10764962Seric **
10864962Seric **	These may be undone later, to cope with systems that claim to
10964962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
11064962Seric **	doesn't realize that the library is part of the language.
11164962Seric **
11264962Seric **	Life would be much easier if we could get rid of this sort
11364962Seric **	of bozo problems.
11464962Seric */
11564962Seric 
11664962Seric #ifdef __STDC__
11764962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
11864962Seric #endif
11969881Seric 
12069881Seric /*
12169881Seric **  Assume you have standard calls; can be #undefed below if necessary.
12269881Seric */
12369881Seric 
12469881Seric # define HASLSTAT	1	/* has lstat(2) call */
12569681Seric /**********************************************************************
12659023Seric **  Operating system configuration.
12759023Seric **
12859023Seric **	Unless you are porting to a new OS, you shouldn't have to
12959023Seric **	change these.
13063902Seric **********************************************************************/
13156823Seric 
13263902Seric /*
13365565Seric **  HP-UX -- tested for 8.07, 9.00, and 9.01.
13468889Seric **
13568889Seric **	If V4FS is defined, compile for HP-UX 10.0.
13663902Seric */
13763902Seric 
13867626Seric #ifdef __hpux
13968889Seric 		/* common definitions for HP-UX 9.x and 10.x */
14068889Seric # undef m_flags		/* conflict between db.h & sys/sysmacros.h on HP 300 */
14163787Seric # define SYSTEM5	1	/* include all the System V defines */
14264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
14369638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
14469638Seric # define seteuid(e)	setresuid(-1, e, -1)
14569681Seric # define IP_SRCROUTE	1	/* can check IP source routing */
14669462Seric # define LA_TYPE	LA_HPUX
14768873Seric # define SPT_TYPE	SPT_PSTAT
14865749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
14965354Seric # define GIDSET_T	gid_t
15065581Seric # ifndef HASGETUSERSHELL
15165581Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
15265581Seric # endif
15365504Seric # define syslog		hard_syslog
15469750Seric # ifdef __STDC__
15569750Seric extern void	hard_syslog(int, char *, ...);
15669750Seric # endif
15768889Seric 
15868889Seric # ifdef V4FS
15968889Seric 		/* HP-UX 10.x */
16068889Seric #  define _PATH_UNIX	"/stand/vmunix"
16168889Seric #  ifndef _PATH_SENDMAILCF
16268889Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
16368889Seric #  endif
16468889Seric #  ifndef _PATH_SENDMAILPID
16568889Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
16668889Seric #  endif
16768889Seric #  ifndef IDENTPROTO
16868889Seric #   define IDENTPROTO	1	/* TCP/IP implementation fixed in 10.0 */
16968889Seric #  endif
17068889Seric 
17168889Seric # else
17268889Seric 		/* HP-UX 9.x */
17368889Seric #  define _PATH_UNIX	"/hp-ux"
17468889Seric #  ifndef _PATH_SENDMAILCF
17568889Seric #   define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
17668889Seric #  endif
17768889Seric #  ifndef IDENTPROTO
17868889Seric #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
17968889Seric #  endif
18068889Seric # endif
18168889Seric 
18267626Seric #endif
18356823Seric 
18464314Seric 
18563902Seric /*
18663902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
18763902Seric */
18863902Seric 
18967626Seric #ifdef _AIX3
19069805Seric # include <paths.h>
19164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
19264840Seric # define HASUNAME	1	/* use System V uname(2) system call */
19365211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
19469681Seric # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
19560219Seric # define FORK		fork	/* no vfork primitive available */
19669562Seric # define GIDSET_T	gid_t
19765749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
19867771Seric # define SPT_PADCHAR	'\0'	/* pad process title with nulls */
19968145Seric # define LA_TYPE	LA_INT
20069805Seric # define LA_AVENRUN	"avenrun"
20167626Seric #endif
20260219Seric 
20364314Seric 
20463902Seric /*
20563902Seric **  Silicon Graphics IRIX
20663902Seric **
20763965Seric **	Compiles on 4.0.1.
20867967Seric **
20968686Seric **	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
21068686Seric **	Use IRIX5 instead of IRIX for IRIX 5.x.
21167967Seric **
21267967Seric **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
21368686Seric **	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
21463902Seric */
21563902Seric 
21668686Seric #if defined(IRIX64) || defined(IRIX5)
21767967Seric # define IRIX
21867967Seric #endif
21967967Seric 
22067626Seric #ifdef IRIX
22166763Seric # define SYSTEM5	1	/* this is a System-V derived system */
22264035Seric # define HASSETREUID	1	/* has setreuid(2) call */
22364035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
22465211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
22569681Seric # define IP_SRCROUTE	1	/* can check IP source routing */
22663753Seric # define FORK		fork	/* no vfork primitive available */
22764155Seric # define setpgid	BSDsetpgrp
22863937Seric # define GIDSET_T	gid_t
22965749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
23068439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
23166763Seric # define LA_TYPE	LA_INT
23267967Seric # ifdef IRIX64
23367967Seric #  define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
23467967Seric # else
23567967Seric #  define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
23667967Seric # endif
23769685Seric # if defined(IRIX64) || defined(IRIX5)
23869685Seric #  define ARGV_T	char *const *
23969828Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) syscall */
24069685Seric # else
24169685Seric #  define ARGV_T	const char **
24269685Seric #  define WAITUNION	1	/* use "union wait" as wait argument type */
24369685Seric # endif
24467626Seric #endif
24563753Seric 
24663902Seric 
24763902Seric /*
24864813Seric **  SunOS and Solaris
24964813Seric **
25064813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
25169638Seric **	Solaris 2.4 (a.k.a. SunOS 5.4).
25263902Seric */
25363902Seric 
25463787Seric #if defined(sun) && !defined(BSD)
25559074Seric 
25664035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
25764813Seric # define HASUNAME	1	/* use System V uname(2) system call */
25865211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
25969681Seric # define IP_SRCROUTE	1	/* can check IP source routing */
26065749Seric # define LA_TYPE	LA_INT
26160564Seric 
26264842Seric # ifdef SOLARIS_2_3
26368813Seric #  define SOLARIS	203	/* for back compat only -- use -DSOLARIS=203 */
26464842Seric # endif
26564842Seric 
26660602Seric # ifdef SOLARIS
26763902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
26865222Seric #  ifndef __svr4__
26965222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
27065222Seric #  endif
27163787Seric #  include <sys/time.h>
27265172Seric #  define GIDSET_T	gid_t
27365189Seric #  ifndef _PATH_UNIX
27467129Seric #   define _PATH_UNIX	"/dev/ksyms"
27565189Seric #  endif
27663962Seric #  ifndef _PATH_SENDMAILCF
27763962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
27864072Seric #  endif
27964072Seric #  ifndef _PATH_SENDMAILPID
28063962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
28163962Seric #  endif
28269401Seric #  ifndef _PATH_HOSTS
28369401Seric #   define _PATH_HOSTS		"/etc/inet/hosts"
28469401Seric #  endif
28566022Seric #  ifndef SYSLOG_BUFSIZE
28666022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
28766022Seric #  endif
28863787Seric 
28960602Seric # else
29065105Seric 			/* SunOS 4.0.3 or 4.1.x */
29165189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
29265830Seric #  ifndef HASFLOCK
29365830Seric #   define HASFLOCK	1	/* has flock(2) call */
29465830Seric #  endif
29565749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
29660564Seric #  include <vfork.h>
29763787Seric 
29865105Seric #  ifdef SUNOS403
29965105Seric 			/* special tweaking for SunOS 4.0.3 */
30065105Seric #   include <malloc.h>
30165105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
30269679Seric #   define NEEDSTRSTR	1	/* need emulation of strstr(3) routine */
30365105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
30465105Seric #   undef WIFEXITED
30565105Seric #   undef WEXITSTATUS
30665105Seric #   undef HASUNAME
30765105Seric #   define setpgid	setpgrp
30865105Seric typedef int		pid_t;
30965105Seric extern char		*getenv();
31065105Seric 
31166732Seric #  else
31266732Seric 			/* 4.1.x specifics */
31366732Seric #   define HASSETSID	1	/* has Posix setsid(2) call */
31466732Seric #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
31566732Seric 
31665105Seric #  endif
31760564Seric # endif
31859023Seric #endif
31959023Seric 
32064718Seric /*
32164813Seric **  DG/UX
32264813Seric **
32367427Seric **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
32467427Seric **	older support.
32567427Seric **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
32664718Seric */
32764314Seric 
32867427Seric #ifdef DGUX_5_4_2
32967427Seric # define DGUX		1
33067427Seric #endif
33167427Seric 
33264718Seric #ifdef	DGUX
33364718Seric # define SYSTEM5	1
33469462Seric # define LA_TYPE	LA_DGUX
33564718Seric # define HASSETREUID	1	/* has setreuid(2) call */
33664718Seric # define HASUNAME	1	/* use System V uname(2) system call */
33764718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
33864718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
33966036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
34065167Seric # ifndef IDENTPROTO
34165167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
34265167Seric # endif
34367771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
34465749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
34564813Seric 
34664813Seric /* these include files must be included early on DG/UX */
34764813Seric # include <netinet/in.h>
34864813Seric # include <arpa/inet.h>
34964813Seric 
35067427Seric # ifdef DGUX_5_4_2
35167427Seric #  define inet_addr	dgux_inet_addr
35264718Seric extern long	dgux_inet_addr();
35367427Seric # endif
35464718Seric #endif
35564718Seric 
35664718Seric 
35763902Seric /*
35863902Seric **  Digital Ultrix 4.2A or 4.3
35964264Seric **
36064264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
36164264Seric **	not dropped when the process exits.  This causes major problems,
36264264Seric **	so flock is the only alternative.
36363902Seric */
36463902Seric 
36560564Seric #ifdef ultrix
36664035Seric # define HASSETREUID	1	/* has setreuid(2) call */
36763962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
36864035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
36966242Seric # define HASUNAME	1	/* use System V uname(2) system call */
37065830Seric # ifndef HASFLOCK
37165830Seric #  define HASFLOCK	1	/* has flock(2) call */
37265830Seric # endif
37365211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
37469279Seric # ifndef BROKEN_RES_SEARCH
37569279Seric #  define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
37669279Seric # endif
37765135Seric # ifdef vax
37865135Seric #  define LA_TYPE	LA_FLOAT
37965135Seric # else
38065135Seric #  define LA_TYPE	LA_INT
38165135Seric #  define LA_AVENRUN	"avenrun"
38265135Seric # endif
38365749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
38465167Seric # ifndef IDENTPROTO
38569279Seric #  define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
38665167Seric # endif
38760564Seric #endif
38860564Seric 
38964314Seric 
39063902Seric /*
39168072Seric **  OSF/1 for Intel Paragon.
39268072Seric **
39368082Seric **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
39468082Seric **	of Intel Scalable Systems Divison.
39568072Seric */
39668072Seric 
39768072Seric #ifdef __PARAGON__
39868072Seric # define __osf__	1	/* get OSF/1 defines below */
39968072Seric # ifndef _PATH_SENDMAILCF
40068072Seric #  define _PATH_SENDMAILCF	"/var/adm/sendmail/sendmail.cf"
40168072Seric # endif
40268072Seric #endif
40368072Seric 
40468072Seric 
40568072Seric /*
40663902Seric **  OSF/1 (tested on Alpha)
40763902Seric */
40863902Seric 
40963787Seric #ifdef __osf__
41063962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
41169638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
41264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
41369681Seric # define IP_SRCROUTE	1	/* can check IP source routing */
41466226Seric # ifndef HASFLOCK
41565830Seric #  define HASFLOCK	1	/* has flock(2) call */
41665830Seric # endif
41763962Seric # define LA_TYPE	LA_INT
41865749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
41964813Seric # ifndef _PATH_SENDMAILPID
42065504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
42164813Seric # endif
42259287Seric #endif
42359287Seric 
42464314Seric 
42563902Seric /*
42663902Seric **  NeXTstep
42763902Seric */
42863902Seric 
42964076Seric #ifdef NeXT
43064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
43169717Seric # define NEEDPUTENV	2	/* need putenv(3) call; no setenv(3) call */
43265830Seric # ifndef HASFLOCK
43365830Seric #  define HASFLOCK	1	/* has flock(2) call */
43465830Seric # endif
43564125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
43664563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
43768705Seric # define UID_T		int	/* compiler gripes on uid_t */
43863753Seric # define sleep		sleepX
43964155Seric # define setpgid	setpgrp
44064295Seric # ifndef LA_TYPE
44164295Seric #  define LA_TYPE	LA_MACH
44264295Seric # endif
44365749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
44464500Seric # ifndef _POSIX_SOURCE
44564035Seric typedef int		pid_t;
44664500Seric #  undef WEXITSTATUS
44764500Seric #  undef WIFEXITED
44864500Seric # endif
44964072Seric # ifndef _PATH_SENDMAILCF
45064072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
45164072Seric # endif
45264072Seric # ifndef _PATH_SENDMAILPID
45364072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
45464072Seric # endif
45559288Seric #endif
45659288Seric 
45764314Seric 
45863902Seric /*
45963962Seric **  4.4 BSD
46064831Seric **
46164831Seric **	See also BSD defines.
46263902Seric */
46363902Seric 
46469860Seric #if defined(BSD4_4) && !defined(__bsdi__)
46564072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
46669638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
46760568Seric # include <sys/cdefs.h>
46863838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
46969516Seric # define BSD4_4_SOCKADDR	/* has sa_len */
47069882Seric # define NETLINK	1	/* supports AF_LINK */
47164072Seric # ifndef LA_TYPE
47264072Seric #  define LA_TYPE	LA_SUBR
47364072Seric # endif
47465749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
47567771Seric # define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
47660568Seric #endif
47760568Seric 
47864314Seric 
47963902Seric /*
48065982Seric **  BSD/386 (all versions)
48165982Seric **	From Tony Sanders, BSDI
48265982Seric */
48365982Seric 
48465982Seric #ifdef __bsdi__
48565982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
48665982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
48769638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
48866843Seric # include <sys/cdefs.h>
48966843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
49069516Seric # define BSD4_4_SOCKADDR	/* has sa_len */
49169882Seric # define NETLINK	1	/* supports AF_LINK */
49266030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
49366843Seric # ifndef LA_TYPE
49466843Seric #  define LA_TYPE	LA_SUBR
49566843Seric # endif
49668753Seric # define GIDSET_T	gid_t
49765982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
49866843Seric 			/* version 1.1 or later */
49967771Seric #  undef SPT_TYPE
50067771Seric #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
50166843Seric # else
50266843Seric 			/* version 1.0 or earlier */
50366843Seric #  ifndef OLD_NEWDB
50466843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
50566843Seric #  endif
50667771Seric #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
50765982Seric # endif
50865982Seric #endif
50965982Seric 
51065982Seric 
51165982Seric 
51265982Seric /*
51369826Seric **  FreeBSD / NetBSD (all architectures, all versions)
51464733Seric **
51569826Seric **  4.3BSD clone, closer to 4.4BSD	for FreeBSD 1.x and NetBSD 0.9x
51669826Seric **  4.4BSD-Lite based			for FreeBSD 2.x and NetBSD 1.x
51764831Seric **
51864831Seric **	See also BSD defines.
51964733Seric */
52064733Seric 
52169826Seric #if defined(__FreeBSD__) || defined(__NetBSD__)
52264733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
52364733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
52469638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
52569826Seric # define HASUNAME	1	/* has uname(2) syscall */
52664733Seric # include <sys/cdefs.h>
52764733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
52869516Seric # define BSD4_4_SOCKADDR	/* has sa_len */
52969882Seric # define NETLINK	1	/* supports AF_LINK */
53069826Seric # define GIDSET_T	gid_t
53164733Seric # ifndef LA_TYPE
53264733Seric #  define LA_TYPE	LA_SUBR
53364733Seric # endif
53465749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
53564733Seric #endif
53664733Seric 
53764733Seric 
53864733Seric /*
53964813Seric **  Mach386
54064813Seric **
54164813Seric **	For mt Xinu's Mach386 system.
54264813Seric */
54364813Seric 
54464813Seric #if defined(MACH) && defined(i386)
54564813Seric # define MACH386	1
54664813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
54764813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
54866226Seric # ifndef HASFLOCK
54965830Seric #  define HASFLOCK	1	/* has flock(2) call */
55065830Seric # endif
55164813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
55264813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
55364813Seric # define setpgid	setpgrp
55464813Seric # ifndef LA_TYPE
55564813Seric #  define LA_TYPE	LA_FLOAT
55664813Seric # endif
55765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
55864962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
55964813Seric # undef WEXITSTATUS
56064813Seric # undef WIFEXITED
56164813Seric # ifndef _PATH_SENDMAILCF
56264813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
56364813Seric # endif
56464813Seric # ifndef _PATH_SENDMAILPID
56564813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
56664813Seric # endif
56764813Seric #endif
56864813Seric 
56964813Seric 
57064813Seric /*
57163969Seric **  4.3 BSD -- this is for very old systems
57263969Seric **
57365949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
57465949Seric **
57563969Seric **	You'll also have to install a new resolver library.
57663969Seric **	I don't guarantee that support for this environment is complete.
57763969Seric */
57863969Seric 
57965949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
58063969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
58163969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
58263970Seric # define ARBPTR_T	char *
58364155Seric # define setpgid	setpgrp
58463969Seric # ifndef LA_TYPE
58563969Seric #  define LA_TYPE	LA_FLOAT
58663969Seric # endif
58763969Seric # ifndef _PATH_SENDMAILCF
58863969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
58963969Seric # endif
59065167Seric # ifndef IDENTPROTO
59165167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
59265167Seric # endif
59364834Seric # undef WEXITSTATUS
59464834Seric # undef WIFEXITED
59564834Seric typedef short		pid_t;
59664834Seric extern int		errno;
59763969Seric #endif
59863969Seric 
59964314Seric 
60063969Seric /*
60163902Seric **  SCO Unix
60265087Seric **
60365087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
60465087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
60565087Seric **	The second is, I believe, for an older version.
60663902Seric */
60763902Seric 
60865087Seric #ifdef _SCO_unix_4_2
60965087Seric # define _SCO_unix_
61065087Seric # define HASSETREUID	1	/* has setreuid(2) call */
61166757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
61265087Seric # define _PATH_UNIX	"/unix"
61365087Seric # ifndef _PATH_SENDMAILCF
61465087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
61565087Seric # endif
61665087Seric # ifndef _PATH_SENDMAILPID
61765087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
61865087Seric # endif
61965087Seric #endif
62065087Seric 
62163838Seric #ifdef _SCO_unix_
62263838Seric # define SYSTEM5	1	/* include all the System V defines */
62364035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
62465212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
62563838Seric # define FORK		fork
62663838Seric # define MAXPATHLEN	PATHSIZE
62764718Seric # define LA_TYPE	LA_SHORT
62867812Seric # define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
62968439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
63067608Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
63169881Seric # define NETUNIX	0	/* no unix domain socket support */
63263838Seric #endif
63363838Seric 
63464314Seric 
63563962Seric /*
63668442Seric **  ISC (SunSoft) Unix.
63768442Seric **
63868442Seric **	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
63968442Seric */
64068442Seric 
64168442Seric #ifdef ISC_UNIX
64268442Seric # include <net/errno.h>
64369849Seric # include <sys/stream.h>	/* needed for IP_SRCROUTE */
64469849Seric # include <sys/bsdtypes.h>
64568442Seric # define SYSTEM5	1	/* include all the System V defines */
64668442Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
64768442Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
64868442Seric # define HASSETREUID	1	/* has setreuid(2) call */
64968442Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
65069881Seric # define NETUNIX	0	/* no unix domain socket support */
65168442Seric # define FORK		fork
65268442Seric # define MAXPATHLEN	1024
65368442Seric # define LA_TYPE	LA_SHORT
65468442Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
65568442Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
65668442Seric # define _PATH_UNIX	"/unix"
65768442Seric # ifndef _PATH_SENDMAILCF
65868442Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
65968442Seric # endif
66068442Seric # ifndef _PATH_SENDMAILPID
66168442Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
66268442Seric # endif
66368442Seric 
66468442Seric typedef short		pid_t;
66568442Seric 
66668442Seric #endif
66768442Seric 
66868442Seric 
66968442Seric /*
67068040Seric **  Altos System V.
67168040Seric **	Contributed by Tim Rice <timr@crl.com>.
67268040Seric */
67368040Seric 
67468040Seric #ifdef ALTOS_SYS_V
67568040Seric # include <limits.h>
67668040Seric # define SYSTEM5	1	/* include all the System V defines */
67768040Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
67868040Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
67968040Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
68068040Seric # define NEEDFSYNC	1	/* no fsync(2) in system library */
68168040Seric # define FORK		fork
68268040Seric # define MAXPATHLEN	PATHSIZE
68368040Seric # define LA_TYPE	LA_SHORT
68468040Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
68568439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
68668040Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
68769881Seric # define NETUNIX	0	/* no unix domain socket support */
68868040Seric # undef WIFEXITED
68968040Seric # undef WEXITSTATUS
69068040Seric # define strtoul	strtol	/* gcc library bogosity */
69168040Seric 
69268040Seric typedef unsigned short	uid_t;
69368040Seric typedef unsigned short	gid_t;
69468040Seric typedef short		pid_t;
69568040Seric #endif
69668040Seric 
69768040Seric 
69868040Seric /*
69963962Seric **  ConvexOS 11.0 and later
70065949Seric **
70165949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
70265949Seric **	works on 9.1 as well.
70363962Seric */
70463962Seric 
70563962Seric #ifdef _CONVEX_SOURCE
70663977Seric # define BSD		1	/* include all the BSD defines */
70763977Seric # define HASUNAME	1	/* use System V uname(2) system call */
70863962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
70963977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
71069681Seric # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
71163962Seric # define LA_TYPE	LA_FLOAT
71265749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
71365949Seric # ifndef _PATH_SENDMAILCF
71465949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
71565949Seric # endif
71665949Seric # ifndef S_IREAD
71765949Seric #  define S_IREAD	_S_IREAD
71865949Seric #  define S_IWRITE	_S_IWRITE
71965949Seric #  define S_IEXEC	_S_IEXEC
72065949Seric #  define S_IFMT	_S_IFMT
72165949Seric #  define S_IFCHR	_S_IFCHR
72265949Seric #  define S_IFBLK	_S_IFBLK
72365949Seric # endif
72465167Seric # ifndef IDENTPROTO
72565167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
72665167Seric # endif
72763962Seric #endif
72863962Seric 
72964314Seric 
73063962Seric /*
73164999Seric **  RISC/os 4.52
73263962Seric **
73364999Seric **	Gives a ton of warning messages, but otherwise compiles.
73463962Seric */
73563962Seric 
73663965Seric #ifdef RISCOS
73764999Seric 
73863962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
73966226Seric # ifndef HASFLOCK
74065830Seric #  define HASFLOCK	1	/* has flock(2) call */
74165830Seric # endif
74264999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
74364999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
74463962Seric # define LA_TYPE	LA_INT
74563962Seric # define LA_AVENRUN	"avenrun"
74663962Seric # define _PATH_UNIX	"/unix"
74764999Seric # undef WIFEXITED
74864999Seric 
74964999Seric # define setpgid	setpgrp
75064999Seric 
75164999Seric extern int		errno;
75264999Seric typedef int		pid_t;
75364999Seric #define			SIGFUNC_DEFINED
75464999Seric typedef int		(*sigfunc_t)();
75564999Seric extern char		*getenv();
75664999Seric extern void		*malloc();
75764999Seric 
75863962Seric #endif
75963962Seric 
76064314Seric 
76164155Seric /*
76264155Seric **  Linux 0.99pl10 and above...
76366300Seric **
76466300Seric **  Thanks to, in reverse order of contact:
76566300Seric **
76668093Seric **	John Kennedy <warlock@csuchico.edu>
76767885Seric **	Andrew Pam <avatar@aus.xanadu.com>
76866300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
76966300Seric **	Karl London <karl@borg.demon.co.uk>
77066300Seric **
77169690Seric **  Last compiled against:	[05/25/95 @ 11:39:31 AM (Thursday)]
77269690Seric **	sendmail 8.7.b.0	named 4.9.3-beta17	db-1.85
77369690Seric **	gcc 2.6.4-950518	libc-5.0.9		linux 1.2.8
77464155Seric */
77564155Seric 
77664770Seric #ifdef __linux__
77766298Seric # define BSD		1	/* include BSD defines */
77864155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
77966298Seric # define HASUNAME	1	/* use System V uname(2) system call */
78064380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
78166298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
78266300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
78367885Seric # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
78469690Seric # define IP_SRCROUTE	0	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
78568518Seric # ifndef HASFLOCK
78668518Seric #  define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
78768518Seric # endif
78864155Seric # ifndef LA_TYPE
78966301Seric #  define LA_TYPE	LA_PROCSTR
79064155Seric # endif
79166300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
79268093Seric # ifndef _PATH_SENDMAILPID
79368093Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
79468093Seric # endif
79568093Seric # define TZ_TYPE	TZ_TNAME
79664763Seric # include <sys/sysmacros.h>
79766300Seric # undef atol			/* wounded in <stdlib.h> */
79864155Seric #endif
79964155Seric 
80064155Seric 
80164345Seric /*
80264345Seric **  DELL SVR4 Issue 2.2, and others
80364345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
80464345Seric **
80564345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
80664345Seric **	defined, and the definitions conflict.
80764924Seric **
80864924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
80964924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
81064924Seric **	(SVR4.0/386 version 3.0).
81164345Seric */
81264345Seric 
81364345Seric #ifdef DELL_SVR4
81465189Seric 				/* no changes necessary */
81565189Seric 				/* see general __svr4__ defines below */
81664345Seric #endif
81764345Seric 
81864345Seric 
81964380Seric /*
82064380Seric **  Apple A/UX 3.0
82164380Seric */
82264345Seric 
82364380Seric #ifdef _AUX_SOURCE
82464729Seric # include <sys/sysmacros.h>
82564380Seric # define BSD			/* has BSD routines */
826*69892Seric # define HASSETRLIMIT	0	/* ... but not setrlimit(2) */
82768803Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
82864380Seric # define HASUNAME	1	/* use System V uname(2) system call */
82964380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
83064561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
83165167Seric # ifndef IDENTPROTO
83265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
83365167Seric # endif
83464380Seric # define FORK		fork
83564380Seric # ifndef _PATH_SENDMAILCF
83664380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
83764380Seric # endif
83864380Seric # ifndef LA_TYPE
839*69892Seric #  define LA_TYPE	LA_INT
840*69892Seric #  define FSHIFT	16
84164380Seric # endif
842*69892Seric # define LA_AVENRUN	"avenrun"
84365749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
844*69892Seric # define TZ_TYPE	TZ_TZNAME
845*69892Seric # ifndef _PATH_UNIX
846*69892Seric #  define _PATH_UNIX	"/unix"		/* should be in <paths.h> */
847*69892Seric # endif
84864560Seric # undef WIFEXITED
84964560Seric # undef WEXITSTATUS
85064380Seric #endif
85164380Seric 
85264380Seric 
85364705Seric /*
85464705Seric **  Encore UMAX V
85564705Seric **
85664705Seric **	Not extensively tested.
85764705Seric */
85864380Seric 
85964705Seric #ifdef UMAXV
86064705Seric # include <limits.h>
86164705Seric # define HASUNAME	1	/* use System V uname(2) system call */
86264705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
86364705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
86465211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
86564705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
86664705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
86764705Seric # define FORK		fork	/* no vfork(2) primitive available */
86865749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
86964705Seric # define MAXPATHLEN	PATH_MAX
87064705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
87164705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
87264705Seric # undef WIFEXITED
87364705Seric # undef WEXITSTATUS
87464705Seric #endif
87564705Seric 
87664705Seric 
87764939Seric /*
87864939Seric **  Stardent Titan 3000 running TitanOS 4.2.
87964939Seric **
88064939Seric **	Must be compiled in "cc -43" mode.
88164939Seric **
88264944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
88364939Seric **
88464939Seric **	Note the tweaking below after the BSD defines are set.
88564939Seric */
88664705Seric 
88764939Seric #ifdef titan
88864939Seric # define setpgid	setpgrp
88964939Seric typedef int		pid_t;
89064939Seric # undef WIFEXITED
89164939Seric # undef WEXITSTATUS
89264939Seric #endif
89364939Seric 
89464939Seric 
89564962Seric /*
89664962Seric **  Sequent DYNIX 3.2.0
89764962Seric **
89864962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
89964962Seric */
90064939Seric 
90164962Seric #ifdef sequent
90266038Seric 
90364962Seric # define BSD		1
90464962Seric # define HASUNSETENV	1
90564962Seric # define BSD4_3		1	/* to get signal() in conf.c */
90664962Seric # define WAITUNION	1
90764962Seric # define LA_TYPE	LA_FLOAT
90864962Seric # ifdef	_POSIX_VERSION
90964962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
91064962Seric # endif
91164962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
91264962Seric # define setpgid	setpgrp
91364962Seric 
91464962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
91564962Seric # undef	WIFEXITED
91664962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
91764962Seric 			 ((union wait*)&(s))->w_termsig == 0)
91864962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
91964962Seric typedef int		pid_t;
92064962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
92164962Seric 
92266144Seric # ifndef IDENTPROTO
92366144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
92466144Seric # endif
92566144Seric 
92664962Seric # ifndef _PATH_UNIX
92764962Seric #  define _PATH_UNIX	"/dynix"
92864962Seric # endif
92964962Seric # ifndef _PATH_SENDMAILCF
93064962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
93164962Seric # endif
93264962Seric 
93364962Seric #endif
93464962Seric 
93564962Seric 
93665748Seric /*
93766038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
93866038Seric **
93966038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
94066038Seric **
94166038Seric **	From Tim Wright <timw@sequent.com>.
94266038Seric */
94366038Seric 
94466038Seric #ifdef _SEQUENT_
94566038Seric # define SYSTEM5	1	/* include all the System V defines */
94666038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
94766038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
94866038Seric # define HASSETREUID	1	/* has setreuid(2) call */
94966038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
95066038Seric # define GIDSET_T	gid_t
95166038Seric # define LA_TYPE	LA_INT
95266038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
95367771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
95466144Seric # ifndef IDENTPROTO
95566144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
95666144Seric # endif
95766038Seric # ifndef _PATH_SENDMAILCF
95866038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
95966038Seric # endif
96066038Seric # ifndef _PATH_SENDMAILPID
96166038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
96266038Seric # endif
96366038Seric #endif
96466038Seric 
96566038Seric 
96666038Seric /*
96765748Seric **  Cray Unicos
96865748Seric **
96965748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
97065748Seric */
97164962Seric 
97265748Seric #ifdef UNICOS
97365748Seric # define SYSTEM5	1	/* include all the System V defines */
97465748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
97565748Seric # define MAXPATHLEN	PATHSIZE
97665748Seric # define LA_TYPE	LA_ZERO
97765749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
97868439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
97965748Seric #endif
98064962Seric 
98165748Seric 
98265820Seric /*
98365820Seric **  Apollo DomainOS
98465820Seric **
98565820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
98665982Seric **
98765820Seric **  15 Jan 1994
98865820Seric **
98965820Seric */
99065748Seric 
99165820Seric #ifdef apollo
99265820Seric # define HASSETREUID	1	/* has setreuid(2) call */
99365820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
99467771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
99565820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
99666044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
99768439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
99865820Seric # ifndef _PATH_SENDMAILCF
99965820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
100065820Seric # endif
100165820Seric # ifndef _PATH_SENDMAILPID
100265820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
100365820Seric # endif
100465820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
100565820Seric # undef  S_IFIFO
100665820Seric # define S_IFIFO	0010000
100765820Seric # ifndef IDENTPROTO
100865820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
100965820Seric # endif
101065982Seric #endif
101165820Seric 
101265820Seric 
101366748Seric /*
101467745Seric **  UnixWare 1.1.2.
101566752Seric **
101669803Seric **	Updated by Petr Lampa <lampa@fee.vutbr.cz>.
101766752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
101866752Seric */
101966752Seric 
102066752Seric #ifdef UNIXWARE
102169841Seric # include <sys/mkdev.h>
102266752Seric # define SYSTEM5		1
102367745Seric # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
102467745Seric # define HASSETREUID		1
102567745Seric # define HASSETSID		1
102667745Seric # define HASINITGROUPS		1
102767745Seric # define GIDSET_T		gid_t
102867745Seric # define SLEEP_T		unsigned
102966752Seric # define SFS_TYPE		SFS_STATVFS
103066752Seric # define LA_TYPE		LA_ZERO
103166752Seric # undef WIFEXITED
103266752Seric # undef WEXITSTATUS
103366752Seric # define _PATH_UNIX		"/unix"
103466752Seric # ifndef _PATH_SENDMAILCF
103566752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
103666752Seric # endif
103766752Seric # ifndef _PATH_SENDMAILPID
103866752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
103966752Seric # endif
104066752Seric # define SYSLOG_BUFSIZE	128
104166752Seric #endif
104266752Seric 
104366752Seric 
104466752Seric /*
104566748Seric **  Intergraph CLIX 3.1
104666748Seric **
104766748Seric **	From Paul Southworth <pauls@locust.cic.net>
104866748Seric */
104965820Seric 
105066748Seric #ifdef CLIX
105166748Seric # define SYSTEM5	1	/* looks like System V */
105266752Seric # ifndef HASGETUSERSHELL
105366752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
105466752Seric # endif
105566748Seric # define DEV_BSIZE	512	/* device block size not defined */
105666748Seric # define GIDSET_T	gid_t
105766748Seric # undef LOG			/* syslog not available */
105866748Seric # define NEEDFSYNC	1	/* no fsync in system library */
105966748Seric # define GETSHORT	_getshort
106066748Seric #endif
106165820Seric 
106266748Seric 
106366776Seric /*
106466776Seric **  NCR 3000 Series (SysVr4)
106566776Seric **
106667434Seric **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
106766776Seric */
106866748Seric 
106966776Seric #ifdef NCR3000
107069775Seric # include <sys/sockio.h>
107166776Seric # define __svr4__
107269681Seric # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
107366776Seric # undef BSD
107466776Seric # define LA_AVENRUN	"avenrun"
107566776Seric #endif
107666748Seric 
107766776Seric 
107867434Seric /*
107967434Seric **  Tandem NonStop-UX SVR4
108067434Seric **
108167434Seric **	From Rick McCarty <mccarty@mpd.tandem.com>.
108267434Seric */
108366776Seric 
108467434Seric #ifdef NonStop_UX_BXX
108567434Seric # define __svr4__
108667434Seric #endif
108766776Seric 
108867434Seric 
108967488Seric /*
109067488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
109167488Seric **
109267488Seric **	Tested for 1.04 and 1.03
109367488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
109467488Seric */
109567434Seric 
109667488Seric #ifdef __H3050R
109767488Seric # define SYSTEM5	1	/* include all the System V defines */
109867488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
109967488Seric # define setreuid(r, e)	setresuid(r, e, -1)
110067488Seric # define LA_TYPE	LA_FLOAT
110167488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
110267488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
110367488Seric # ifndef GIDSET_T
110467488Seric #  define GIDSET_T	gid_t
110567488Seric # endif
110667488Seric # ifndef _PATH_UNIX
110767488Seric #  define _PATH_UNIX	"/HI-UX"
110867488Seric # endif
110967488Seric # ifndef _PATH_SENDMAILCF
111067488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
111167488Seric # endif
111267488Seric # ifndef IDENTPROTO
111367488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
111467488Seric # endif
111567488Seric # ifndef HASGETUSERSHELL
111667488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
111767488Seric # endif
111867488Seric 
111967488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
112067488Seric # undef m_flags
112167488Seric 
112267488Seric # ifdef __STDC__
112367488Seric extern int	syslog(int, char *, ...);
112467488Seric # endif
112567488Seric 
112667488Seric #endif
112767488Seric 
112867488Seric 
112968099Seric /*
113068099Seric **  Amdahl UTS System V 2.1.5 (SVr3-based)
113168099Seric **
113268099Seric **    From: Janet Jackson <janet@dialix.oz.au>.
113368099Seric */
113467488Seric 
113568099Seric #ifdef _UTS
113668099Seric # include <sys/sysmacros.h>
113769881Seric # undef HASLSTAT		/* has symlinks, but they cause problems */
113868099Seric # define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
113968099Seric # define SYS5SIGNALS	1	/* System V signal semantics */
114068099Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
114168099Seric # define HASUNAME	1	/* use System V uname(2) system call */
114268099Seric # define HASINITGROUPS	1	/* has initgroups(3) function */
114368099Seric # define HASSETVBUF	1	/* has setvbuf(3) function */
114468099Seric # define HASSIGSETMASK	0	/* does not have sigsetmask(2) function */
114568099Seric # ifndef HASGETUSERSHELL
114668099Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
114768099Seric # endif
114868099Seric # define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
114968099Seric # define LA_TYPE	LA_ZERO		/* doesn't have load average */
115068099Seric # define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
115168439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
115268099Seric # define _PATH_UNIX	"/unix"
115368099Seric # ifndef _PATH_SENDMAILCF
115468099Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
115568099Seric # endif
115668099Seric #endif
115768099Seric 
115868357Seric /*
115968357Seric **  Cray Computer Corporation's CSOS
116068357Seric **
116169473Seric **	From Scott Bolte <scott@craycos.com>.
116268357Seric */
116368099Seric 
116468357Seric #ifdef _CRAYCOM
116568357Seric # define SYSTEM5	1	/* include all the System V defines */
116668357Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
116768357Seric # define NEEDFSYNC	1	/* no fsync in system library */
116868357Seric # define MAXPATHLEN	PATHSIZE
116968357Seric # define LA_TYPE	LA_ZERO
117068357Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
117168439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
117268357Seric # define _POSIX_CHOWN_RESTRICTED	-1
117368357Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
117468357Seric #endif
117568099Seric 
117668099Seric 
117768742Seric /*
117868742Seric **  Sony NEWS-OS 4.2.1R and 6.0.3
117969473Seric **
118069473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
118168742Seric */
118268742Seric 
118368742Seric #ifdef sony_news
118468742Seric # ifndef __svr4
118568742Seric 			/* NEWS-OS 4.2.1R */
118668742Seric #  ifndef BSD
118768742Seric #   define BSD			/* has BSD routines */
118868742Seric #  endif
118968742Seric #  define HASUNSETENV	1	/* has unsetenv(2) call */
119068742Seric #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
119168742Seric #  define WAITUNION	1	/* use "union wait" as wait argument type */
119268742Seric #  define LA_TYPE	LA_INT
119368742Seric #  define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
119468742Seric #  ifndef HASFLOCK
119568742Seric #   define HASFLOCK	1	/* has flock(2) call */
119668742Seric #  endif
119768742Seric #  define setpgid	setpgrp
119868742Seric #  undef WIFEXITED
119968742Seric #  undef WEXITSTATUS
120068742Seric typedef int		pid_t;
120168742Seric typedef int		(*sigfunc_t)();
120268742Seric #  define SIGFUNC_DEFINED
120368742Seric 
120468742Seric # else
120568742Seric 			/* NEWS-OS 6.0.3 with /bin/cc */
120669879Seric #  ifndef __svr4__
120769879Seric #   define __svr4__		/* use all System V Releae 4 defines below */
120869879Seric #  endif
120968742Seric #  define HASSETSID	1	/* has Posix setsid(2) call */
121068742Seric #  define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
121169473Seric #  define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
121269649Seric #  ifndef SPT_TYPE
121369649Seric #   define SPT_TYPE	SPT_SYSMIPS	/* use sysmips() (OS 6.0.2 or later) */
121469649Seric #  endif
121568742Seric #  define GIDSET_T	gid_t
121668742Seric #  undef WIFEXITED
121768742Seric #  undef WEXITSTATUS
121869879Seric #  ifndef SYSLOG_BUFSIZE
121969879Seric #   define SYSLOG_BUFSIZE	1024
122069879Seric #  endif
122168742Seric #  define _PATH_UNIX  "/stand/unix"
122268742Seric #  ifndef _PATH_SENDMAILCF
122368742Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
122468742Seric #  endif
122568742Seric #  ifndef _PATH_SENDMAILPID
122668742Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
122768742Seric #  endif
122868742Seric 
122968742Seric # endif
123068742Seric #endif
123168742Seric 
123268742Seric 
123368742Seric /*
123468742Seric **  Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
123569473Seric **
123669473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
123768742Seric */
123868742Seric 
123968742Seric #ifdef luna
124068742Seric # ifndef IDENTPROTO
124168742Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
124268742Seric # endif
124368742Seric # ifdef uniosb
124469454Seric #  include <sys/time.h>
124568742Seric #  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
124668742Seric # endif
124769649Seric # define HASUNSETENV	1	/* has unsetenv(2) call */
124869649Seric # define NEEDPUTENV	1	/* need putenv(3) call */
124968742Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
125069679Seric # define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
125168742Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
125268742Seric # ifdef uniosb
125368742Seric #  define LA_TYPE	LA_INT
125468742Seric # endif
125568742Seric # ifdef luna2m
125668742Seric #  define LA_TYPE	LA_SUBR
125768742Seric # endif
125868742Seric # ifdef luna88k
125968742Seric #  define LA_TYPE	LA_INT
126068742Seric # endif
126168742Seric # define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
126268742Seric # define setpgid	setpgrp
126368742Seric # undef WIFEXITED
126468742Seric # undef WEXITSTATUS
126568742Seric typedef int		pid_t;
126668742Seric typedef int		(*sigfunc_t)();
126768742Seric # define SIGFUNC_DEFINED
126868742Seric extern char	*getenv();
126968742Seric extern int	errno;
127068742Seric # ifndef _PATH_SENDMAILCF
127168742Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
127268742Seric # endif
127368742Seric #endif
127468742Seric 
127568742Seric 
127668742Seric /*
127769473Seric **  NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
127868742Seric **
127969473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
128068742Seric */
128168742Seric 
128268742Seric #ifdef nec_ews_svr4
128369454Seric # ifndef __svr4__
128469454Seric #  define __svr4__		/* use all System V Releae 4 defines below */
128569454Seric # endif
128668742Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
128768742Seric # define HASSETSID	1	/* has Posix setsid(2) call */
128869473Seric # define LA_TYPE	LA_READKSYM	/* use MIOC_READSYM ioctl */
128968742Seric # define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
129068742Seric # define GIDSET_T	gid_t
129168742Seric # undef WIFEXITED
129268742Seric # undef WEXITSTATUS
129369454Seric # define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
129468742Seric #endif
129568742Seric 
129668742Seric 
129768742Seric 
129863902Seric /**********************************************************************
129963787Seric **  End of Per-Operating System defines
130063902Seric **********************************************************************/
130169638Seric /**********************************************************************
130263949Seric **  More general defines
130363949Seric **********************************************************************/
130463949Seric 
130563962Seric /* general BSD defines */
130663962Seric #ifdef BSD
130764035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
130864035Seric # define HASSETREUID	1	/* has setreuid(2) call */
130967742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
131069681Seric # ifndef IP_SRCROUTE
131169681Seric #  define IP_SRCROUTE	1	/* can check IP source routing */
131269681Seric # endif
131367430Seric # ifndef HASSETRLIMIT
131467430Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
131567430Seric # endif
131665830Seric # ifndef HASFLOCK
131765830Seric #  define HASFLOCK	1	/* has flock(2) call */
131865830Seric # endif
131967602Seric # ifndef TZ_TYPE
132067608Seric #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
132167602Seric # endif
132263962Seric #endif
132363962Seric 
132465189Seric /* general System V Release 4 defines */
132565189Seric #ifdef __svr4__
132665189Seric # define SYSTEM5	1
132769638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
132867742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
132969778Seric #  define BSD_COMP	1	/* get BSD ioctl calls */
133067742Seric # ifndef HASSETRLIMIT
133167742Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
133267742Seric # endif
133365211Seric # ifndef HASGETUSERSHELL
133465211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
133565210Seric # endif
133665189Seric 
133765189Seric # ifndef _PATH_UNIX
133865189Seric #  define _PATH_UNIX		"/unix"
133965189Seric # endif
134065189Seric # ifndef _PATH_SENDMAILCF
134165189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
134265189Seric # endif
134365189Seric # ifndef _PATH_SENDMAILPID
134465189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
134565189Seric # endif
134665189Seric # ifndef SYSLOG_BUFSIZE
134765189Seric #  define SYSLOG_BUFSIZE	128
134865189Seric # endif
134967159Seric # ifndef SFS_TYPE
135067159Seric #  define SFS_TYPE		SFS_STATVFS
135167159Seric # endif
135265189Seric #endif
135365189Seric 
135463787Seric /* general System V defines */
135566298Seric #ifdef SYSTEM5
135664813Seric # include <sys/sysmacros.h>
135763949Seric # define HASUNAME	1	/* use System V uname(2) system call */
135864705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
135964962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
136067430Seric # ifndef HASULIMIT
136167430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
136267430Seric # endif
136363962Seric # ifndef LA_TYPE
136469462Seric #  ifdef MIOC_READKSYM
136569462Seric #   define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
136669462Seric #  else
136769462Seric #   define LA_TYPE	LA_INT		/* assume integer load average */
136869462Seric #  endif
136963962Seric # endif
137065749Seric # ifndef SFS_TYPE
137165749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
137265749Seric # endif
137367602Seric # ifndef TZ_TYPE
137467608Seric #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
137567602Seric # endif
137668442Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
137768442Seric # define bzero(d, l)		(memset((d), '\0', (l)))
137868442Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
137966298Seric #endif
138063787Seric 
138163949Seric /* general POSIX defines */
138263949Seric #ifdef _POSIX_VERSION
138364718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
138464718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
138569638Seric # if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
138669638Seric #  define USESETEUID	1	/* has useable seteuid(2) call */
138769638Seric # endif
138863949Seric #endif
138969638Seric /*
139068357Seric **  Tweaking for systems that (for example) claim to be BSD or POSIX
139168357Seric **  but don't have all the standard BSD or POSIX routines (boo hiss).
139264939Seric */
139364439Seric 
139464939Seric #ifdef titan
139564939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
139664939Seric #endif
139764939Seric 
139868357Seric #ifdef _CRAYCOM
139968357Seric # undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
140068357Seric #endif
140165830Seric 
140268442Seric #ifdef ISC_UNIX
140368442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
140468442Seric #endif
140568357Seric 
140668442Seric #ifdef ALTOS_SYS_V
140768442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
140868442Seric # undef bzero			/* despite SystemV claim, uses BSD bzero */
140968442Seric # undef bcmp			/* despite SystemV claim, uses BSD bcmp */
141068442Seric #endif
141168442Seric 
141268442Seric 
141365167Seric /*
141465167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
141565167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
141665167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
141765167Seric **  are closed.  Some firewalls return this error if you try to connect
141865167Seric **  to the IDENT port (113), so you can't receive email from these hosts
141965167Seric **  on these systems.  The firewall really should use a more specific
142065167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
142165167Seric **  not explicitly set to zero above, default it on.
142265167Seric */
142364939Seric 
142465167Seric #ifndef IDENTPROTO
142565167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
142665167Seric #endif
142765167Seric 
142869601Seric #ifndef IP_SRCROUTE
142969601Seric # define IP_SRCROUTE	1	/* Detect IP source routing */
143069601Seric #endif
143169601Seric 
143265211Seric #ifndef HASGETUSERSHELL
143365211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
143465210Seric #endif
143565167Seric 
143669881Seric #ifndef NETUNIX
143769881Seric # define NETUNIX	1	/* include unix domain support */
143869881Seric #endif
143969881Seric 
144065830Seric #ifndef HASFLOCK
144165830Seric # define HASFLOCK	0	/* assume no flock(2) support */
144265830Seric #endif
144365210Seric 
144469638Seric #ifndef HASSETREUID
144569638Seric # define HASSETREUID	0	/* assume no setreuid(2) call */
144669638Seric #endif
144769638Seric 
144869638Seric #ifndef USESETEUID
144969638Seric # define USESETEUID	0	/* assume no seteuid(2) call or no saved ids */
145069638Seric #endif
145169638Seric 
145267430Seric #ifndef HASSETRLIMIT
145367430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
145467430Seric #endif
145567430Seric 
145667430Seric #ifndef HASULIMIT
145767430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
145867430Seric #endif
145967430Seric 
146066843Seric #ifndef OLD_NEWDB
146166843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
146266843Seric #endif
146365830Seric 
146468099Seric /* heuristic setting of HASSETSIGMASK; can override above */
146568099Seric #ifndef HASSIGSETMASK
146668099Seric # ifdef SIGVTALRM
146768099Seric #  define HASSETSIGMASK	1
146868099Seric # else
146968099Seric #  define HASSETSIGMASK	0
147068099Seric # endif
147168099Seric #endif
147266843Seric 
147369638Seric /*
147469638Seric **  If no type for argument two of getgroups call is defined, assume
147569638Seric **  it's an integer -- unfortunately, there seem to be several choices
147669638Seric **  here.
147769638Seric */
147869638Seric 
147969638Seric #ifndef GIDSET_T
148069638Seric # define GIDSET_T	int
148169638Seric #endif
148269638Seric 
148368705Seric #ifndef UID_T
148468705Seric # define UID_T		uid_t
148568705Seric #endif
148668099Seric 
148768706Seric #ifndef SIZE_T
148868706Seric # define SIZE_T		size_t
148968706Seric #endif
149068706Seric 
149168705Seric #ifndef ARGV_T
149268705Seric # define ARGV_T		char **
149368705Seric #endif
149469681Seric /**********************************************************************
149559023Seric **  Remaining definitions should never have to be changed.  They are
149659023Seric **  primarily to provide back compatibility for older systems -- for
149759287Seric **  example, it includes some POSIX compatibility definitions
149864439Seric **********************************************************************/
149959023Seric 
150059388Seric /* System 5 compatibility */
150159388Seric #ifndef S_ISREG
150264944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
150359388Seric #endif
150464944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
150564944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
150664944Seric #endif
150768494Seric #ifndef S_IWUSR
150868494Seric # define S_IWUSR		0200
150968494Seric #endif
151059388Seric #ifndef S_IWGRP
151168494Seric # define S_IWGRP		0020
151259388Seric #endif
151359388Seric #ifndef S_IWOTH
151468494Seric # define S_IWOTH		0002
151559388Seric #endif
151659388Seric 
151759023Seric /*
151850537Seric **  Older systems don't have this error code -- it should be in
151950537Seric **  /usr/include/sysexits.h.
152050537Seric */
152150537Seric 
152250537Seric # ifndef EX_CONFIG
152350537Seric # define EX_CONFIG	78	/* configuration error */
152450537Seric # endif
152556852Seric 
152664718Seric /* pseudo-code used in server SMTP */
152764718Seric # define EX_QUIT	22	/* drop out of server immediately */
152864718Seric 
152964718Seric 
153063993Seric /*
153163993Seric **  These are used in a few cases where we need some special
153263993Seric **  error codes, but where the system doesn't provide something
153363993Seric **  reasonable.  They are printed in errstring.
153463993Seric */
153563993Seric 
153663993Seric #ifndef E_PSEUDOBASE
153763993Seric # define E_PSEUDOBASE	256
153863993Seric #endif
153963993Seric 
154063993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
154163993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
154263993Seric 
154363970Seric /* type of arbitrary pointer */
154463970Seric #ifndef ARBPTR_T
154563970Seric # define ARBPTR_T	void *
154663970Seric #endif
154763970Seric 
154860568Seric #ifndef __P
154960568Seric # include "cdefs.h"
155060568Seric #endif
155160568Seric 
155267421Seric #if NAMED_BIND
155367421Seric # include <arpa/nameser.h>
155467434Seric # ifdef __svr4__
155567434Seric #  ifdef NOERROR
155667434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
155767434Seric #  endif
155867434Seric # endif
155967421Seric #endif
156067421Seric 
156156852Seric /*
156267419Seric **  The size of an IP address -- can't use sizeof because of problems
156367419Seric **  on Crays, where everything is 64 bits.  This will break if/when
156467419Seric **  IP addresses are expanded to eight bytes.
156567419Seric */
156667419Seric 
156767421Seric #ifndef INADDRSZ
156867421Seric # define INADDRSZ	4
156967421Seric #endif
157067419Seric 
157167419Seric /*
157267421Seric **  The size of various known types -- for reading network protocols.
157367421Seric **  Again, we can't use sizeof because of compiler randomness.
157467421Seric */
157567421Seric 
157667421Seric #ifndef INT16SZ
157767421Seric # define INT16SZ	2
157867421Seric #endif
157967421Seric #ifndef INT32SZ
158067421Seric # define INT32SZ	4
158167421Seric #endif
158267421Seric 
158367421Seric /*
158458778Seric **  Do some required dependencies
158558778Seric */
158658778Seric 
158758778Seric #if defined(NETINET) || defined(NETISO)
158859107Seric # define SMTP		1	/* enable user and server SMTP */
158959107Seric # define QUEUE		1	/* enable queueing */
159059107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
159158778Seric #endif
159258778Seric 
159358778Seric 
159458778Seric /*
159556852Seric **  Arrange to use either varargs or stdargs
159656852Seric */
159756852Seric 
159856852Seric # ifdef __STDC__
159956852Seric 
160056852Seric # include <stdarg.h>
160156852Seric 
160256852Seric # define VA_LOCAL_DECL	va_list ap;
160356852Seric # define VA_START(f)	va_start(ap, f)
160456852Seric # define VA_END		va_end(ap)
160556852Seric 
160656852Seric # else
160756852Seric 
160856852Seric # include <varargs.h>
160956852Seric 
161056852Seric # define VA_LOCAL_DECL	va_list ap;
161156852Seric # define VA_START(f)	va_start(ap)
161256852Seric # define VA_END		va_end(ap)
161356852Seric 
161456852Seric # endif
161557631Seric 
161657943Seric #ifdef HASUNAME
161757631Seric # include <sys/utsname.h>
161857631Seric # ifdef newstr
161957631Seric #  undef newstr
162057631Seric # endif
162157943Seric #else /* ! HASUNAME */
162257631Seric # define NODE_LENGTH 32
162357631Seric struct utsname
162457631Seric {
162557631Seric 	char nodename[NODE_LENGTH+1];
162657631Seric };
162757943Seric #endif /* HASUNAME */
162857642Seric 
162968040Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
163063838Seric # define MAXHOSTNAMELEN	256
163157735Seric #endif
163258153Seric 
163358153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
163458153Seric # define SIGCHLD	SIGCLD
163558153Seric #endif
163658153Seric 
163758153Seric #ifndef STDIN_FILENO
163868742Seric # define STDIN_FILENO	0
163958153Seric #endif
164058153Seric 
164158153Seric #ifndef STDOUT_FILENO
164268742Seric # define STDOUT_FILENO	1
164358153Seric #endif
164458153Seric 
164558153Seric #ifndef STDERR_FILENO
164668742Seric # define STDERR_FILENO	2
164758153Seric #endif
164858689Seric 
164964072Seric #ifndef LOCK_SH
165064035Seric # define LOCK_SH	0x01	/* shared lock */
165164035Seric # define LOCK_EX	0x02	/* exclusive lock */
165264035Seric # define LOCK_NB	0x04	/* non-blocking lock */
165364035Seric # define LOCK_UN	0x08	/* unlock */
165464035Seric #endif
165558692Seric 
165668742Seric #ifndef SEEK_SET
165768742Seric # define SEEK_SET	0
165868742Seric # define SEEK_CUR	1
165968742Seric # define SEEK_END	2
166068742Seric #endif
166168742Seric 
166264035Seric #ifndef SIG_ERR
166364035Seric # define SIG_ERR	((void (*)()) -1)
166458689Seric #endif
166558702Seric 
166664500Seric #ifndef WEXITSTATUS
166764500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
166864500Seric #endif
166964500Seric #ifndef WIFEXITED
167064500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
167164500Seric #endif
167264500Seric 
167364561Seric #ifndef SIGFUNC_DEFINED
167464561Seric typedef void		(*sigfunc_t) __P((int));
167564561Seric #endif
167664561Seric 
167765053Seric /* size of syslog buffer */
167865053Seric #ifndef SYSLOG_BUFSIZE
167965053Seric # define SYSLOG_BUFSIZE	1024
168065053Seric #endif
168165053Seric 
168258702Seric /*
168358702Seric **  Size of tobuf (deliver.c)
168458702Seric **	Tweak this to match your syslog implementation.  It will have to
168558702Seric **	allow for the extra information printed.
168658702Seric */
168758702Seric 
168858702Seric #ifndef TOBUFSIZE
168965053Seric # if (SYSLOG_BUFSIZE) > 512
169065053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
169165053Seric # else
169265053Seric #  define TOBUFSIZE	256
169365053Seric # endif
169458702Seric #endif
169560219Seric 
169665015Seric /*
169765015Seric **  Size of prescan buffer.
169865015Seric **	Despite comments in the _sendmail_ book, this probably should
169965015Seric **	not be changed; there are some hard-to-define dependencies.
170065015Seric */
170165015Seric 
170265015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
170360219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
170460219Seric # ifndef FORK
170560219Seric # define FORK		vfork		/* function to call to fork mailer */
170660219Seric # endif
170765955Seric 
170865955Seric /*
170965955Seric **  If we are going to link scanf anyway, use it in readcf
171065955Seric */
171165955Seric 
171265955Seric #if !defined(HASUNAME) && !defined(SCANF)
171365955Seric # define SCANF		1
171465955Seric #endif
1715