xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 69828)
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*69828Seric  *	@(#)conf.h	8.183 (Berkeley) 06/10/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.
5625673Seric **
5725673Seric **	#define these if they are available; comment them out otherwise.
5863902Seric **********************************************************************/
599147Seric 
6025673Seric # define LOG		1	/* enable logging */
6125673Seric # define UGLYUUCP	1	/* output ugly UUCP From lines */
6264813Seric # define NETUNIX	1	/* include unix domain support */
6358778Seric # define NETINET	1	/* include internet support */
6453735Seric # define MATCHGECOS	1	/* match user names from gecos field */
6563753Seric # define XDEBUG		1	/* enable extended debugging */
6668785Seric # if (defined(NEWDB) || defined(HESIOD)) && !defined(USERDB)
6768848Seric #  define USERDB	1	/* look in user database */
6856337Seric # endif
6956337Seric 
7066334Seric /**********************************************************************
7166334Seric **  0/1 Compilation options.
7266334Seric **	#define these to 1 if they are available;
7366334Seric **	#define them to 0 otherwise.
7466334Seric **********************************************************************/
7566334Seric 
7666334Seric # ifndef NAMED_BIND
7766334Seric #  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
7866334Seric # endif
7966334Seric 
8068848Seric # ifndef DSN
8168848Seric #  define DSN		1	/* include delivery status notification code */
8268848Seric # endif
8368848Seric 
8469480Seric # ifndef MIME8TO7
8569480Seric #  define MIME8TO7	1	/* 8->7 bit MIME conversions */
8669480Seric # endif
8769480Seric 
8869480Seric # ifndef MIME7TO8
8969480Seric #  define MIME7TO8	1	/* 7->8 bit MIME conversions */
9069480Seric # endif
9169480Seric 
9264032Seric /*
9364944Seric **  Most systems have symbolic links today, so default them on.  You
9464944Seric **  can turn them off by #undef'ing this below.
9564944Seric */
9664944Seric 
9764944Seric # define HASLSTAT	1	/* has lstat(2) call */
9864944Seric 
9964962Seric /*
10064962Seric **  General "standard C" defines.
10164962Seric **
10264962Seric **	These may be undone later, to cope with systems that claim to
10364962Seric **	be Standard C but aren't.  Gcc is the biggest offender -- it
10464962Seric **	doesn't realize that the library is part of the language.
10564962Seric **
10664962Seric **	Life would be much easier if we could get rid of this sort
10764962Seric **	of bozo problems.
10864962Seric */
10964962Seric 
11064962Seric #ifdef __STDC__
11164962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
11264962Seric #endif
11369681Seric /**********************************************************************
11459023Seric **  Operating system configuration.
11559023Seric **
11659023Seric **	Unless you are porting to a new OS, you shouldn't have to
11759023Seric **	change these.
11863902Seric **********************************************************************/
11956823Seric 
12063787Seric 
12163902Seric /*
12265565Seric **  HP-UX -- tested for 8.07, 9.00, and 9.01.
12368889Seric **
12468889Seric **	If V4FS is defined, compile for HP-UX 10.0.
12563902Seric */
12663902Seric 
12767626Seric #ifdef __hpux
12868889Seric 		/* common definitions for HP-UX 9.x and 10.x */
12968889Seric # undef m_flags		/* conflict between db.h & sys/sysmacros.h on HP 300 */
13063787Seric # define SYSTEM5	1	/* include all the System V defines */
13164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
13269638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
13369638Seric # define seteuid(e)	setresuid(-1, e, -1)
13469681Seric # define IP_SRCROUTE	1	/* can check IP source routing */
13569462Seric # define LA_TYPE	LA_HPUX
13668873Seric # define SPT_TYPE	SPT_PSTAT
13765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
13865354Seric # define GIDSET_T	gid_t
13965581Seric # ifndef HASGETUSERSHELL
14065581Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
14165581Seric # endif
14265504Seric # define syslog		hard_syslog
14369750Seric # ifdef __STDC__
14469750Seric extern void	hard_syslog(int, char *, ...);
14569750Seric # endif
14668889Seric 
14768889Seric # ifdef V4FS
14868889Seric 		/* HP-UX 10.x */
14968889Seric #  define _PATH_UNIX	"/stand/vmunix"
15068889Seric #  ifndef _PATH_SENDMAILCF
15168889Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
15268889Seric #  endif
15368889Seric #  ifndef _PATH_SENDMAILPID
15468889Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
15568889Seric #  endif
15668889Seric #  ifndef IDENTPROTO
15768889Seric #   define IDENTPROTO	1	/* TCP/IP implementation fixed in 10.0 */
15868889Seric #  endif
15968889Seric 
16068889Seric # else
16168889Seric 		/* HP-UX 9.x */
16268889Seric #  define _PATH_UNIX	"/hp-ux"
16368889Seric #  ifndef _PATH_SENDMAILCF
16468889Seric #   define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
16568889Seric #  endif
16668889Seric #  ifndef IDENTPROTO
16768889Seric #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
16868889Seric #  endif
16968889Seric # endif
17068889Seric 
17167626Seric #endif
17256823Seric 
17364314Seric 
17463902Seric /*
17563902Seric **  IBM AIX 3.x -- actually tested for 3.2.3
17663902Seric */
17763902Seric 
17867626Seric #ifdef _AIX3
17969805Seric # include <paths.h>
18064035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
18164840Seric # define HASUNAME	1	/* use System V uname(2) system call */
18265211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
18369681Seric # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
18460219Seric # define FORK		fork	/* no vfork primitive available */
18569562Seric # define GIDSET_T	gid_t
18665749Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
18767771Seric # define SPT_PADCHAR	'\0'	/* pad process title with nulls */
18868145Seric # define LA_TYPE	LA_INT
18969805Seric # define LA_AVENRUN	"avenrun"
19067626Seric #endif
19160219Seric 
19264314Seric 
19363902Seric /*
19463902Seric **  Silicon Graphics IRIX
19563902Seric **
19663965Seric **	Compiles on 4.0.1.
19767967Seric **
19868686Seric **	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
19968686Seric **	Use IRIX5 instead of IRIX for IRIX 5.x.
20067967Seric **
20167967Seric **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
20268686Seric **	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
20363902Seric */
20463902Seric 
20568686Seric #if defined(IRIX64) || defined(IRIX5)
20667967Seric # define IRIX
20767967Seric #endif
20867967Seric 
20967626Seric #ifdef IRIX
21066763Seric # define SYSTEM5	1	/* this is a System-V derived system */
21164035Seric # define HASSETREUID	1	/* has setreuid(2) call */
21264035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
21365211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
21469681Seric # define IP_SRCROUTE	1	/* can check IP source routing */
21563753Seric # define FORK		fork	/* no vfork primitive available */
21664155Seric # define setpgid	BSDsetpgrp
21763937Seric # define GIDSET_T	gid_t
21865749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
21968439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
22066763Seric # define LA_TYPE	LA_INT
22167967Seric # ifdef IRIX64
22267967Seric #  define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
22367967Seric # else
22467967Seric #  define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
22567967Seric # endif
22669685Seric # if defined(IRIX64) || defined(IRIX5)
22769685Seric #  define ARGV_T	char *const *
228*69828Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) syscall */
22969685Seric # else
23069685Seric #  define ARGV_T	const char **
23169685Seric #  define WAITUNION	1	/* use "union wait" as wait argument type */
23269685Seric # endif
23367626Seric #endif
23463753Seric 
23563902Seric 
23663902Seric /*
23764813Seric **  SunOS and Solaris
23864813Seric **
23964813Seric **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
24069638Seric **	Solaris 2.4 (a.k.a. SunOS 5.4).
24163902Seric */
24263902Seric 
24363787Seric #if defined(sun) && !defined(BSD)
24459074Seric 
24564035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
24664813Seric # define HASUNAME	1	/* use System V uname(2) system call */
24765211Seric # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
24869681Seric # define IP_SRCROUTE	1	/* can check IP source routing */
24965749Seric # define LA_TYPE	LA_INT
25060564Seric 
25164842Seric # ifdef SOLARIS_2_3
25268813Seric #  define SOLARIS	203	/* for back compat only -- use -DSOLARIS=203 */
25364842Seric # endif
25464842Seric 
25560602Seric # ifdef SOLARIS
25663902Seric 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
25765222Seric #  ifndef __svr4__
25865222Seric #   define __svr4__		/* use all System V Releae 4 defines below */
25965222Seric #  endif
26063787Seric #  include <sys/time.h>
26165172Seric #  define GIDSET_T	gid_t
26265189Seric #  ifndef _PATH_UNIX
26367129Seric #   define _PATH_UNIX	"/dev/ksyms"
26465189Seric #  endif
26563962Seric #  ifndef _PATH_SENDMAILCF
26663962Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
26764072Seric #  endif
26864072Seric #  ifndef _PATH_SENDMAILPID
26963962Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
27063962Seric #  endif
27169401Seric #  ifndef _PATH_HOSTS
27269401Seric #   define _PATH_HOSTS		"/etc/inet/hosts"
27369401Seric #  endif
27466022Seric #  ifndef SYSLOG_BUFSIZE
27566022Seric #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
27666022Seric #  endif
27763787Seric 
27860602Seric # else
27965105Seric 			/* SunOS 4.0.3 or 4.1.x */
28065189Seric #  define HASSETREUID	1	/* has setreuid(2) call */
28165830Seric #  ifndef HASFLOCK
28265830Seric #   define HASFLOCK	1	/* has flock(2) call */
28365830Seric #  endif
28465749Seric #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
28560564Seric #  include <vfork.h>
28663787Seric 
28765105Seric #  ifdef SUNOS403
28865105Seric 			/* special tweaking for SunOS 4.0.3 */
28965105Seric #   include <malloc.h>
29065105Seric #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
29169679Seric #   define NEEDSTRSTR	1	/* need emulation of strstr(3) routine */
29265105Seric #   define WAITUNION	1	/* use "union wait" as wait argument type */
29365105Seric #   undef WIFEXITED
29465105Seric #   undef WEXITSTATUS
29565105Seric #   undef HASUNAME
29665105Seric #   define setpgid	setpgrp
29765105Seric typedef int		pid_t;
29865105Seric extern char		*getenv();
29965105Seric 
30066732Seric #  else
30166732Seric 			/* 4.1.x specifics */
30266732Seric #   define HASSETSID	1	/* has Posix setsid(2) call */
30366732Seric #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
30466732Seric 
30565105Seric #  endif
30660564Seric # endif
30759023Seric #endif
30859023Seric 
30964718Seric /*
31064813Seric **  DG/UX
31164813Seric **
31267427Seric **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
31367427Seric **	older support.
31467427Seric **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
31564718Seric */
31664314Seric 
31767427Seric #ifdef DGUX_5_4_2
31867427Seric # define DGUX		1
31967427Seric #endif
32067427Seric 
32164718Seric #ifdef	DGUX
32264718Seric # define SYSTEM5	1
32369462Seric # define LA_TYPE	LA_DGUX
32464718Seric # define HASSETREUID	1	/* has setreuid(2) call */
32564718Seric # define HASUNAME	1	/* use System V uname(2) system call */
32664718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
32764718Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
32866036Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
32965167Seric # ifndef IDENTPROTO
33065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
33165167Seric # endif
33267771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
33365749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
33464813Seric 
33564813Seric /* these include files must be included early on DG/UX */
33664813Seric # include <netinet/in.h>
33764813Seric # include <arpa/inet.h>
33864813Seric 
33967427Seric # ifdef DGUX_5_4_2
34067427Seric #  define inet_addr	dgux_inet_addr
34164718Seric extern long	dgux_inet_addr();
34267427Seric # endif
34364718Seric #endif
34464718Seric 
34564718Seric 
34663902Seric /*
34763902Seric **  Digital Ultrix 4.2A or 4.3
34864264Seric **
34964264Seric **	Apparently, fcntl locking is broken on 4.2A, in that locks are
35064264Seric **	not dropped when the process exits.  This causes major problems,
35164264Seric **	so flock is the only alternative.
35263902Seric */
35363902Seric 
35460564Seric #ifdef ultrix
35564035Seric # define HASSETREUID	1	/* has setreuid(2) call */
35663962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
35764035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
35866242Seric # define HASUNAME	1	/* use System V uname(2) system call */
35965830Seric # ifndef HASFLOCK
36065830Seric #  define HASFLOCK	1	/* has flock(2) call */
36165830Seric # endif
36265211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
36369279Seric # ifndef BROKEN_RES_SEARCH
36469279Seric #  define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
36569279Seric # endif
36665135Seric # ifdef vax
36765135Seric #  define LA_TYPE	LA_FLOAT
36865135Seric # else
36965135Seric #  define LA_TYPE	LA_INT
37065135Seric #  define LA_AVENRUN	"avenrun"
37165135Seric # endif
37265749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
37365167Seric # ifndef IDENTPROTO
37469279Seric #  define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
37565167Seric # endif
37660564Seric #endif
37760564Seric 
37864314Seric 
37963902Seric /*
38068072Seric **  OSF/1 for Intel Paragon.
38168072Seric **
38268082Seric **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
38368082Seric **	of Intel Scalable Systems Divison.
38468072Seric */
38568072Seric 
38668072Seric #ifdef __PARAGON__
38768072Seric # define __osf__	1	/* get OSF/1 defines below */
38868072Seric # ifndef _PATH_SENDMAILCF
38968072Seric #  define _PATH_SENDMAILCF	"/var/adm/sendmail/sendmail.cf"
39068072Seric # endif
39168072Seric #endif
39268072Seric 
39368072Seric 
39468072Seric /*
39563902Seric **  OSF/1 (tested on Alpha)
39663902Seric */
39763902Seric 
39863787Seric #ifdef __osf__
39963962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
40069638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
40164035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
40269681Seric # define IP_SRCROUTE	1	/* can check IP source routing */
40366226Seric # ifndef HASFLOCK
40465830Seric #  define HASFLOCK	1	/* has flock(2) call */
40565830Seric # endif
40663962Seric # define LA_TYPE	LA_INT
40765749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
40864813Seric # ifndef _PATH_SENDMAILPID
40965504Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
41064813Seric # endif
41159287Seric #endif
41259287Seric 
41364314Seric 
41463902Seric /*
41563902Seric **  NeXTstep
41663902Seric */
41763902Seric 
41864076Seric #ifdef NeXT
41964035Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
42069717Seric # define NEEDPUTENV	2	/* need putenv(3) call; no setenv(3) call */
42165830Seric # ifndef HASFLOCK
42265830Seric #  define HASFLOCK	1	/* has flock(2) call */
42365830Seric # endif
42464125Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
42564563Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
42668705Seric # define UID_T		int	/* compiler gripes on uid_t */
42763753Seric # define sleep		sleepX
42864155Seric # define setpgid	setpgrp
42964295Seric # ifndef LA_TYPE
43064295Seric #  define LA_TYPE	LA_MACH
43164295Seric # endif
43265749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
43364500Seric # ifndef _POSIX_SOURCE
43464035Seric typedef int		pid_t;
43564500Seric #  undef WEXITSTATUS
43664500Seric #  undef WIFEXITED
43764500Seric # endif
43864072Seric # ifndef _PATH_SENDMAILCF
43964072Seric #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
44064072Seric # endif
44164072Seric # ifndef _PATH_SENDMAILPID
44264072Seric #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
44364072Seric # endif
44459288Seric #endif
44559288Seric 
44664314Seric 
44763902Seric /*
44863962Seric **  4.4 BSD
44964831Seric **
45064831Seric **	See also BSD defines.
45163902Seric */
45263902Seric 
45360568Seric #ifdef BSD4_4
45464072Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
45569638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
45660568Seric # include <sys/cdefs.h>
45763838Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
45869516Seric # define BSD4_4_SOCKADDR	/* has sa_len */
45969562Seric # define NETLINK		/* supports AF_LINK */
46064072Seric # ifndef LA_TYPE
46164072Seric #  define LA_TYPE	LA_SUBR
46264072Seric # endif
46365749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
46467771Seric # define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
46560568Seric #endif
46660568Seric 
46764314Seric 
46863902Seric /*
46965982Seric **  BSD/386 (all versions)
47065982Seric **	From Tony Sanders, BSDI
47165982Seric */
47265982Seric 
47365982Seric #ifdef __bsdi__
47465982Seric # define HASUNSETENV	1	/* has the unsetenv(3) call */
47565982Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
47669638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
47766843Seric # include <sys/cdefs.h>
47866843Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
47969516Seric # define BSD4_4_SOCKADDR	/* has sa_len */
48069562Seric # define NETLINK		/* supports AF_LINK */
48166030Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
48266843Seric # ifndef LA_TYPE
48366843Seric #  define LA_TYPE	LA_SUBR
48466843Seric # endif
48568753Seric # define GIDSET_T	gid_t
48665982Seric # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
48766843Seric 			/* version 1.1 or later */
48867771Seric #  undef SPT_TYPE
48967771Seric #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
49066843Seric # else
49166843Seric 			/* version 1.0 or earlier */
49266843Seric #  ifndef OLD_NEWDB
49366843Seric #   define OLD_NEWDB	1	/* old version of newdb library */
49466843Seric #  endif
49567771Seric #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
49665982Seric # endif
49765982Seric #endif
49865982Seric 
49965982Seric 
50065982Seric 
50165982Seric /*
50269826Seric **  FreeBSD / NetBSD (all architectures, all versions)
50364733Seric **
50469826Seric **  4.3BSD clone, closer to 4.4BSD	for FreeBSD 1.x and NetBSD 0.9x
50569826Seric **  4.4BSD-Lite based			for FreeBSD 2.x and NetBSD 1.x
50664831Seric **
50764831Seric **	See also BSD defines.
50864733Seric */
50964733Seric 
51069826Seric #if defined(__FreeBSD__) || defined(__NetBSD__)
51164733Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
51264733Seric # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
51369638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
51469826Seric # define HASUNAME	1	/* has uname(2) syscall */
51564733Seric # include <sys/cdefs.h>
51664733Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
51769516Seric # define BSD4_4_SOCKADDR	/* has sa_len */
51869562Seric # define NETLINK		/* supports AF_LINK */
51969826Seric # define GIDSET_T	gid_t
52064733Seric # ifndef LA_TYPE
52164733Seric #  define LA_TYPE	LA_SUBR
52264733Seric # endif
52365749Seric # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
52464733Seric #endif
52564733Seric 
52664733Seric 
52764733Seric /*
52864813Seric **  Mach386
52964813Seric **
53064813Seric **	For mt Xinu's Mach386 system.
53164813Seric */
53264813Seric 
53364813Seric #if defined(MACH) && defined(i386)
53464813Seric # define MACH386	1
53564813Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
53664813Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
53766226Seric # ifndef HASFLOCK
53865830Seric #  define HASFLOCK	1	/* has flock(2) call */
53965830Seric # endif
54064813Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
54164813Seric # define NEEDSTRTOL	1	/* need the strtol() function */
54264813Seric # define setpgid	setpgrp
54364813Seric # ifndef LA_TYPE
54464813Seric #  define LA_TYPE	LA_FLOAT
54564813Seric # endif
54665749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
54764962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
54864813Seric # undef WEXITSTATUS
54964813Seric # undef WIFEXITED
55064813Seric # ifndef _PATH_SENDMAILCF
55164813Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
55264813Seric # endif
55364813Seric # ifndef _PATH_SENDMAILPID
55464813Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
55564813Seric # endif
55664813Seric #endif
55764813Seric 
55864813Seric 
55964813Seric /*
56063969Seric **  4.3 BSD -- this is for very old systems
56163969Seric **
56265949Seric **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
56365949Seric **
56463969Seric **	You'll also have to install a new resolver library.
56563969Seric **	I don't guarantee that support for this environment is complete.
56663969Seric */
56763969Seric 
56865949Seric #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
56963969Seric # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
57063969Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
57163970Seric # define ARBPTR_T	char *
57264155Seric # define setpgid	setpgrp
57363969Seric # ifndef LA_TYPE
57463969Seric #  define LA_TYPE	LA_FLOAT
57563969Seric # endif
57663969Seric # ifndef _PATH_SENDMAILCF
57763969Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
57863969Seric # endif
57965167Seric # ifndef IDENTPROTO
58065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
58165167Seric # endif
58264834Seric # undef WEXITSTATUS
58364834Seric # undef WIFEXITED
58464834Seric typedef short		pid_t;
58564834Seric extern int		errno;
58663969Seric #endif
58763969Seric 
58864314Seric 
58963969Seric /*
59063902Seric **  SCO Unix
59165087Seric **
59265087Seric **	This includes two parts -- the first is for SCO Open Server 3.2v4
59365087Seric **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
59465087Seric **	The second is, I believe, for an older version.
59563902Seric */
59663902Seric 
59765087Seric #ifdef _SCO_unix_4_2
59865087Seric # define _SCO_unix_
59965087Seric # define HASSETREUID	1	/* has setreuid(2) call */
60066757Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
60165087Seric # define _PATH_UNIX	"/unix"
60265087Seric # ifndef _PATH_SENDMAILCF
60365087Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
60465087Seric # endif
60565087Seric # ifndef _PATH_SENDMAILPID
60665087Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
60765087Seric # endif
60865087Seric #endif
60965087Seric 
61063838Seric #ifdef _SCO_unix_
61163838Seric # define SYSTEM5	1	/* include all the System V defines */
61264035Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
61365212Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
61463838Seric # define FORK		fork
61563838Seric # define MAXPATHLEN	PATHSIZE
61664718Seric # define LA_TYPE	LA_SHORT
61767812Seric # define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
61868439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
61967608Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
62064813Seric # undef NETUNIX			/* no unix domain socket support */
62163838Seric #endif
62263838Seric 
62364314Seric 
62463962Seric /*
62568442Seric **  ISC (SunSoft) Unix.
62668442Seric **
62768442Seric **	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
62868442Seric */
62968442Seric 
63068442Seric #ifdef ISC_UNIX
63168442Seric # include <net/errno.h>
63268442Seric # define SYSTEM5	1	/* include all the System V defines */
63368442Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
63468442Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
63568442Seric # define HASSETREUID	1	/* has setreuid(2) call */
63668442Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
63768442Seric # undef NETUNIX			/* no unix domain socket support */
63868442Seric # define FORK		fork
63968442Seric # define MAXPATHLEN	1024
64068442Seric # define LA_TYPE	LA_SHORT
64168442Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
64268442Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
64368442Seric # define _PATH_UNIX	"/unix"
64468442Seric # ifndef _PATH_SENDMAILCF
64568442Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
64668442Seric # endif
64768442Seric # ifndef _PATH_SENDMAILPID
64868442Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
64968442Seric # endif
65068442Seric 
65168442Seric typedef short		pid_t;
65268442Seric 
65368442Seric #endif
65468442Seric 
65568442Seric 
65668442Seric /*
65768040Seric **  Altos System V.
65868040Seric **	Contributed by Tim Rice <timr@crl.com>.
65968040Seric */
66068040Seric 
66168040Seric #ifdef ALTOS_SYS_V
66268040Seric # include <limits.h>
66368040Seric # define SYSTEM5	1	/* include all the System V defines */
66468040Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
66568040Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
66668040Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
66768040Seric # define NEEDFSYNC	1	/* no fsync(2) in system library */
66868040Seric # define FORK		fork
66968040Seric # define MAXPATHLEN	PATHSIZE
67068040Seric # define LA_TYPE	LA_SHORT
67168040Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
67268439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
67368040Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
67468040Seric # undef NETUNIX			/* no unix domain socket support */
67568040Seric # undef WIFEXITED
67668040Seric # undef WEXITSTATUS
67768040Seric # define strtoul	strtol	/* gcc library bogosity */
67868040Seric 
67968040Seric typedef unsigned short	uid_t;
68068040Seric typedef unsigned short	gid_t;
68168040Seric typedef short		pid_t;
68268040Seric #endif
68368040Seric 
68468040Seric 
68568040Seric /*
68663962Seric **  ConvexOS 11.0 and later
68765949Seric **
68865949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
68965949Seric **	works on 9.1 as well.
69063962Seric */
69163962Seric 
69263962Seric #ifdef _CONVEX_SOURCE
69363977Seric # define BSD		1	/* include all the BSD defines */
69463977Seric # define HASUNAME	1	/* use System V uname(2) system call */
69563962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
69663977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
69769681Seric # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
69863962Seric # define LA_TYPE	LA_FLOAT
69965749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
70065949Seric # ifndef _PATH_SENDMAILCF
70165949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
70265949Seric # endif
70365949Seric # ifndef S_IREAD
70465949Seric #  define S_IREAD	_S_IREAD
70565949Seric #  define S_IWRITE	_S_IWRITE
70665949Seric #  define S_IEXEC	_S_IEXEC
70765949Seric #  define S_IFMT	_S_IFMT
70865949Seric #  define S_IFCHR	_S_IFCHR
70965949Seric #  define S_IFBLK	_S_IFBLK
71065949Seric # endif
71165167Seric # ifndef IDENTPROTO
71265167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
71365167Seric # endif
71463962Seric #endif
71563962Seric 
71664314Seric 
71763962Seric /*
71864999Seric **  RISC/os 4.52
71963962Seric **
72064999Seric **	Gives a ton of warning messages, but otherwise compiles.
72163962Seric */
72263962Seric 
72363965Seric #ifdef RISCOS
72464999Seric 
72563962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
72666226Seric # ifndef HASFLOCK
72765830Seric #  define HASFLOCK	1	/* has flock(2) call */
72865830Seric # endif
72964999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
73064999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
73163962Seric # define LA_TYPE	LA_INT
73263962Seric # define LA_AVENRUN	"avenrun"
73363962Seric # define _PATH_UNIX	"/unix"
73464999Seric # undef WIFEXITED
73564999Seric 
73664999Seric # define setpgid	setpgrp
73764999Seric 
73864999Seric extern int		errno;
73964999Seric typedef int		pid_t;
74064999Seric #define			SIGFUNC_DEFINED
74164999Seric typedef int		(*sigfunc_t)();
74264999Seric extern char		*getenv();
74364999Seric extern void		*malloc();
74464999Seric 
74563962Seric #endif
74663962Seric 
74764314Seric 
74864155Seric /*
74964155Seric **  Linux 0.99pl10 and above...
75066300Seric **
75166300Seric **  Thanks to, in reverse order of contact:
75266300Seric **
75368093Seric **	John Kennedy <warlock@csuchico.edu>
75467885Seric **	Andrew Pam <avatar@aus.xanadu.com>
75566300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
75666300Seric **	Karl London <karl@borg.demon.co.uk>
75766300Seric **
75869690Seric **  Last compiled against:	[05/25/95 @ 11:39:31 AM (Thursday)]
75969690Seric **	sendmail 8.7.b.0	named 4.9.3-beta17	db-1.85
76069690Seric **	gcc 2.6.4-950518	libc-5.0.9		linux 1.2.8
76164155Seric */
76264155Seric 
76364770Seric #ifdef __linux__
76466298Seric # define BSD		1	/* include BSD defines */
76564155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
76666298Seric # define HASUNAME	1	/* use System V uname(2) system call */
76764380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
76866298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
76966300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
77067885Seric # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
77169690Seric # define IP_SRCROUTE	0	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
77268518Seric # ifndef HASFLOCK
77368518Seric #  define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
77468518Seric # endif
77564155Seric # ifndef LA_TYPE
77666301Seric #  define LA_TYPE	LA_PROCSTR
77764155Seric # endif
77866300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
77968093Seric # ifndef _PATH_SENDMAILPID
78068093Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
78168093Seric # endif
78268093Seric # define TZ_TYPE	TZ_TNAME
78364763Seric # include <sys/sysmacros.h>
78466300Seric # undef atol			/* wounded in <stdlib.h> */
78564155Seric #endif
78664155Seric 
78764155Seric 
78864345Seric /*
78964345Seric **  DELL SVR4 Issue 2.2, and others
79064345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
79164345Seric **
79264345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
79364345Seric **	defined, and the definitions conflict.
79464924Seric **
79564924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
79664924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
79764924Seric **	(SVR4.0/386 version 3.0).
79864345Seric */
79964345Seric 
80064345Seric #ifdef DELL_SVR4
80165189Seric 				/* no changes necessary */
80265189Seric 				/* see general __svr4__ defines below */
80364345Seric #endif
80464345Seric 
80564345Seric 
80664380Seric /*
80764380Seric **  Apple A/UX 3.0
80864380Seric */
80964345Seric 
81064380Seric #ifdef _AUX_SOURCE
81164729Seric # include <sys/sysmacros.h>
81264380Seric # define BSD			/* has BSD routines */
81368803Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
81464380Seric # define HASUNAME	1	/* use System V uname(2) system call */
81564380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
81664561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
81765167Seric # ifndef IDENTPROTO
81865167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
81965167Seric # endif
82064380Seric # define FORK		fork
82164380Seric # ifndef _PATH_SENDMAILCF
82264380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
82364380Seric # endif
82464380Seric # ifndef LA_TYPE
82564380Seric #  define LA_TYPE	LA_ZERO
82664380Seric # endif
82765749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
82864560Seric # undef WIFEXITED
82964560Seric # undef WEXITSTATUS
83064380Seric #endif
83164380Seric 
83264380Seric 
83364705Seric /*
83464705Seric **  Encore UMAX V
83564705Seric **
83664705Seric **	Not extensively tested.
83764705Seric */
83864380Seric 
83964705Seric #ifdef UMAXV
84064705Seric # include <limits.h>
84164705Seric # define HASUNAME	1	/* use System V uname(2) system call */
84264705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
84364705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
84465211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
84564705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
84664705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
84764705Seric # define FORK		fork	/* no vfork(2) primitive available */
84865749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
84964705Seric # define MAXPATHLEN	PATH_MAX
85064705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
85164705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
85264705Seric # undef WIFEXITED
85364705Seric # undef WEXITSTATUS
85464705Seric #endif
85564705Seric 
85664705Seric 
85764939Seric /*
85864939Seric **  Stardent Titan 3000 running TitanOS 4.2.
85964939Seric **
86064939Seric **	Must be compiled in "cc -43" mode.
86164939Seric **
86264944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
86364939Seric **
86464939Seric **	Note the tweaking below after the BSD defines are set.
86564939Seric */
86664705Seric 
86764939Seric #ifdef titan
86864939Seric # define setpgid	setpgrp
86964939Seric typedef int		pid_t;
87064939Seric # undef WIFEXITED
87164939Seric # undef WEXITSTATUS
87264939Seric #endif
87364939Seric 
87464939Seric 
87564962Seric /*
87664962Seric **  Sequent DYNIX 3.2.0
87764962Seric **
87864962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
87964962Seric */
88064939Seric 
88164962Seric #ifdef sequent
88266038Seric 
88364962Seric # define BSD		1
88464962Seric # define HASUNSETENV	1
88564962Seric # define BSD4_3		1	/* to get signal() in conf.c */
88664962Seric # define WAITUNION	1
88764962Seric # define LA_TYPE	LA_FLOAT
88864962Seric # ifdef	_POSIX_VERSION
88964962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
89064962Seric # endif
89164962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
89264962Seric # define setpgid	setpgrp
89364962Seric 
89464962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
89564962Seric # undef	WIFEXITED
89664962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
89764962Seric 			 ((union wait*)&(s))->w_termsig == 0)
89864962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
89964962Seric typedef int		pid_t;
90064962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
90164962Seric 
90266144Seric # ifndef IDENTPROTO
90366144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
90466144Seric # endif
90566144Seric 
90664962Seric # ifndef _PATH_UNIX
90764962Seric #  define _PATH_UNIX	"/dynix"
90864962Seric # endif
90964962Seric # ifndef _PATH_SENDMAILCF
91064962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
91164962Seric # endif
91264962Seric 
91364962Seric #endif
91464962Seric 
91564962Seric 
91665748Seric /*
91766038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
91866038Seric **
91966038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
92066038Seric **
92166038Seric **	From Tim Wright <timw@sequent.com>.
92266038Seric */
92366038Seric 
92466038Seric #ifdef _SEQUENT_
92566038Seric # define SYSTEM5	1	/* include all the System V defines */
92666038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
92766038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
92866038Seric # define HASSETREUID	1	/* has setreuid(2) call */
92966038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
93066038Seric # define GIDSET_T	gid_t
93166038Seric # define LA_TYPE	LA_INT
93266038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
93367771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
93466144Seric # ifndef IDENTPROTO
93566144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
93666144Seric # endif
93766038Seric # ifndef _PATH_SENDMAILCF
93866038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
93966038Seric # endif
94066038Seric # ifndef _PATH_SENDMAILPID
94166038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
94266038Seric # endif
94366038Seric #endif
94466038Seric 
94566038Seric 
94666038Seric /*
94765748Seric **  Cray Unicos
94865748Seric **
94965748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
95065748Seric */
95164962Seric 
95265748Seric #ifdef UNICOS
95365748Seric # define SYSTEM5	1	/* include all the System V defines */
95465748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
95565748Seric # define MAXPATHLEN	PATHSIZE
95665748Seric # define LA_TYPE	LA_ZERO
95765749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
95868439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
95965748Seric #endif
96064962Seric 
96165748Seric 
96265820Seric /*
96365820Seric **  Apollo DomainOS
96465820Seric **
96565820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
96665982Seric **
96765820Seric **  15 Jan 1994
96865820Seric **
96965820Seric */
97065748Seric 
97165820Seric #ifdef apollo
97265820Seric # define HASSETREUID	1	/* has setreuid(2) call */
97365820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
97467771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
97565820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
97666044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
97768439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
97865820Seric # ifndef _PATH_SENDMAILCF
97965820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
98065820Seric # endif
98165820Seric # ifndef _PATH_SENDMAILPID
98265820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
98365820Seric # endif
98465820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
98565820Seric # undef  S_IFIFO
98665820Seric # define S_IFIFO	0010000
98765820Seric # ifndef IDENTPROTO
98865820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
98965820Seric # endif
99065982Seric #endif
99165820Seric 
99265820Seric 
99366748Seric /*
99467745Seric **  UnixWare 1.1.2.
99566752Seric **
99669803Seric **	Updated by Petr Lampa <lampa@fee.vutbr.cz>.
99766752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
99866752Seric */
99966752Seric 
100066752Seric #ifdef UNIXWARE
100166752Seric # define SYSTEM5		1
100267745Seric # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
100367745Seric # define HASSETREUID		1
100467745Seric # define HASSETSID		1
100567745Seric # define HASINITGROUPS		1
100667745Seric # define GIDSET_T		gid_t
100767745Seric # define SLEEP_T		unsigned
100866752Seric # define SFS_TYPE		SFS_STATVFS
100966752Seric # define LA_TYPE		LA_ZERO
101066752Seric # undef WIFEXITED
101166752Seric # undef WEXITSTATUS
101266752Seric # define _PATH_UNIX		"/unix"
101366752Seric # ifndef _PATH_SENDMAILCF
101466752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
101566752Seric # endif
101666752Seric # ifndef _PATH_SENDMAILPID
101766752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
101866752Seric # endif
101966752Seric # define SYSLOG_BUFSIZE	128
102066752Seric #endif
102166752Seric 
102266752Seric 
102366752Seric /*
102466748Seric **  Intergraph CLIX 3.1
102566748Seric **
102666748Seric **	From Paul Southworth <pauls@locust.cic.net>
102766748Seric */
102865820Seric 
102966748Seric #ifdef CLIX
103066748Seric # define SYSTEM5	1	/* looks like System V */
103166752Seric # ifndef HASGETUSERSHELL
103266752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
103366752Seric # endif
103466748Seric # define DEV_BSIZE	512	/* device block size not defined */
103566748Seric # define GIDSET_T	gid_t
103666748Seric # undef LOG			/* syslog not available */
103766748Seric # define NEEDFSYNC	1	/* no fsync in system library */
103866748Seric # define GETSHORT	_getshort
103966748Seric #endif
104065820Seric 
104166748Seric 
104266776Seric /*
104366776Seric **  NCR 3000 Series (SysVr4)
104466776Seric **
104567434Seric **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
104666776Seric */
104766748Seric 
104866776Seric #ifdef NCR3000
104969775Seric # include <sys/sockio.h>
105066776Seric # define __svr4__
105169681Seric # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
105266776Seric # undef BSD
105366776Seric # define LA_AVENRUN	"avenrun"
105466776Seric #endif
105566748Seric 
105666776Seric 
105767434Seric /*
105867434Seric **  Tandem NonStop-UX SVR4
105967434Seric **
106067434Seric **	From Rick McCarty <mccarty@mpd.tandem.com>.
106167434Seric */
106266776Seric 
106367434Seric #ifdef NonStop_UX_BXX
106467434Seric # define __svr4__
106567434Seric #endif
106666776Seric 
106767434Seric 
106867488Seric /*
106967488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
107067488Seric **
107167488Seric **	Tested for 1.04 and 1.03
107267488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
107367488Seric */
107467434Seric 
107567488Seric #ifdef __H3050R
107667488Seric # define SYSTEM5	1	/* include all the System V defines */
107767488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
107867488Seric # define setreuid(r, e)	setresuid(r, e, -1)
107967488Seric # define LA_TYPE	LA_FLOAT
108067488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
108167488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
108267488Seric # ifndef GIDSET_T
108367488Seric #  define GIDSET_T	gid_t
108467488Seric # endif
108567488Seric # ifndef _PATH_UNIX
108667488Seric #  define _PATH_UNIX	"/HI-UX"
108767488Seric # endif
108867488Seric # ifndef _PATH_SENDMAILCF
108967488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
109067488Seric # endif
109167488Seric # ifndef IDENTPROTO
109267488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
109367488Seric # endif
109467488Seric # ifndef HASGETUSERSHELL
109567488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
109667488Seric # endif
109767488Seric 
109867488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
109967488Seric # undef m_flags
110067488Seric 
110167488Seric # ifdef __STDC__
110267488Seric extern int	syslog(int, char *, ...);
110367488Seric # endif
110467488Seric 
110567488Seric #endif
110667488Seric 
110767488Seric 
110868099Seric /*
110968099Seric **  Amdahl UTS System V 2.1.5 (SVr3-based)
111068099Seric **
111168099Seric **    From: Janet Jackson <janet@dialix.oz.au>.
111268099Seric */
111367488Seric 
111468099Seric #ifdef _UTS
111568099Seric # include <sys/sysmacros.h>
111668099Seric # undef HASLSTAT	/* has symlinks, but they cause problems */
111768099Seric # define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
111868099Seric # define SYS5SIGNALS	1	/* System V signal semantics */
111968099Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
112068099Seric # define HASUNAME	1	/* use System V uname(2) system call */
112168099Seric # define HASINITGROUPS	1	/* has initgroups(3) function */
112268099Seric # define HASSETVBUF	1	/* has setvbuf(3) function */
112368099Seric # define HASSIGSETMASK	0	/* does not have sigsetmask(2) function */
112468099Seric # ifndef HASGETUSERSHELL
112568099Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
112668099Seric # endif
112768099Seric # define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
112868099Seric # define LA_TYPE	LA_ZERO		/* doesn't have load average */
112968099Seric # define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
113068439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
113168099Seric # define _PATH_UNIX	"/unix"
113268099Seric # ifndef _PATH_SENDMAILCF
113368099Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
113468099Seric # endif
113568099Seric #endif
113668099Seric 
113768357Seric /*
113868357Seric **  Cray Computer Corporation's CSOS
113968357Seric **
114069473Seric **	From Scott Bolte <scott@craycos.com>.
114168357Seric */
114268099Seric 
114368357Seric #ifdef _CRAYCOM
114468357Seric # define SYSTEM5	1	/* include all the System V defines */
114568357Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
114668357Seric # define NEEDFSYNC	1	/* no fsync in system library */
114768357Seric # define MAXPATHLEN	PATHSIZE
114868357Seric # define LA_TYPE	LA_ZERO
114968357Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
115068439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
115168357Seric # define _POSIX_CHOWN_RESTRICTED	-1
115268357Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
115368357Seric #endif
115468099Seric 
115568099Seric 
115668742Seric /*
115768742Seric **  Sony NEWS-OS 4.2.1R and 6.0.3
115869473Seric **
115969473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
116068742Seric */
116168742Seric 
116268742Seric #ifdef sony_news
116368742Seric # ifndef __svr4
116468742Seric 			/* NEWS-OS 4.2.1R */
116568742Seric #  ifndef BSD
116668742Seric #   define BSD			/* has BSD routines */
116768742Seric #  endif
116868742Seric #  define HASUNSETENV	1	/* has unsetenv(2) call */
116968742Seric #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
117068742Seric #  define WAITUNION	1	/* use "union wait" as wait argument type */
117168742Seric #  define LA_TYPE	LA_INT
117268742Seric #  define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
117368742Seric #  ifndef HASFLOCK
117468742Seric #   define HASFLOCK	1	/* has flock(2) call */
117568742Seric #  endif
117668742Seric #  define setpgid	setpgrp
117768742Seric #  undef WIFEXITED
117868742Seric #  undef WEXITSTATUS
117968742Seric typedef int		pid_t;
118068742Seric typedef int		(*sigfunc_t)();
118168742Seric #  define SIGFUNC_DEFINED
118268742Seric 
118368742Seric # else
118468742Seric 			/* NEWS-OS 6.0.3 with /bin/cc */
118568742Seric #  define SYSTEM5	1	/* include all the System V defines */
118668742Seric #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
118768742Seric #  define HASINITGROUPS	1	/* has initgroups(3) call */
118869638Seric #  define USESETEUID	1	/* has useable seteuid(2) call */
118968742Seric #  define HASSETSID	1	/* has Posix setsid(2) call */
119068742Seric #  define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
119169473Seric #  define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
119268742Seric #  define SFS_TYPE	SFS_STATVFS	/* use <sys/statvfs.h> statvfs() impl */
119369649Seric #  ifndef SPT_TYPE
119469649Seric #   define SPT_TYPE	SPT_SYSMIPS	/* use sysmips() (OS 6.0.2 or later) */
119569649Seric #  endif
119668742Seric #  define GIDSET_T	gid_t
119768742Seric #  undef WIFEXITED
119868742Seric #  undef WEXITSTATUS
119968742Seric #  define _PATH_UNIX  "/stand/unix"
120068742Seric #  ifndef _PATH_SENDMAILCF
120168742Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
120268742Seric #  endif
120368742Seric #  ifndef _PATH_SENDMAILPID
120468742Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
120568742Seric #  endif
120668742Seric 
120768742Seric # endif
120868742Seric #endif
120968742Seric 
121068742Seric 
121168742Seric /*
121268742Seric **  Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
121369473Seric **
121469473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
121568742Seric */
121668742Seric 
121768742Seric #ifdef luna
121868742Seric # ifndef IDENTPROTO
121968742Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
122068742Seric # endif
122168742Seric # ifdef uniosb
122269454Seric #  include <sys/time.h>
122368742Seric #  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
122468742Seric # endif
122569649Seric # define HASUNSETENV	1	/* has unsetenv(2) call */
122669649Seric # define NEEDPUTENV	1	/* need putenv(3) call */
122768742Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
122869679Seric # define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
122968742Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
123068742Seric # ifdef uniosb
123168742Seric #  define LA_TYPE	LA_INT
123268742Seric # endif
123368742Seric # ifdef luna2m
123468742Seric #  define LA_TYPE	LA_SUBR
123568742Seric # endif
123668742Seric # ifdef luna88k
123768742Seric #  define LA_TYPE	LA_INT
123868742Seric # endif
123968742Seric # define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
124068742Seric # define setpgid	setpgrp
124168742Seric # undef WIFEXITED
124268742Seric # undef WEXITSTATUS
124368742Seric typedef int		pid_t;
124468742Seric typedef int		(*sigfunc_t)();
124568742Seric # define SIGFUNC_DEFINED
124668742Seric extern char	*getenv();
124768742Seric extern int	errno;
124868742Seric # ifndef _PATH_SENDMAILCF
124968742Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
125068742Seric # endif
125168742Seric #endif
125268742Seric 
125368742Seric 
125468742Seric /*
125569473Seric **  NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
125668742Seric **
125769473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
125868742Seric */
125968742Seric 
126068742Seric #ifdef nec_ews_svr4
126169454Seric # ifndef __svr4__
126269454Seric #  define __svr4__		/* use all System V Releae 4 defines below */
126369454Seric # endif
126468742Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
126568742Seric # define HASSETSID	1	/* has Posix setsid(2) call */
126669473Seric # define LA_TYPE	LA_READKSYM	/* use MIOC_READSYM ioctl */
126768742Seric # define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
126868742Seric # define GIDSET_T	gid_t
126968742Seric # undef WIFEXITED
127068742Seric # undef WEXITSTATUS
127169454Seric # define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
127268742Seric #endif
127368742Seric 
127468742Seric 
127568742Seric 
127663902Seric /**********************************************************************
127763787Seric **  End of Per-Operating System defines
127863902Seric **********************************************************************/
127969638Seric /**********************************************************************
128063949Seric **  More general defines
128163949Seric **********************************************************************/
128263949Seric 
128363962Seric /* general BSD defines */
128463962Seric #ifdef BSD
128564035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
128664035Seric # define HASSETREUID	1	/* has setreuid(2) call */
128767742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
128869681Seric # ifndef IP_SRCROUTE
128969681Seric #  define IP_SRCROUTE	1	/* can check IP source routing */
129069681Seric # endif
129167430Seric # ifndef HASSETRLIMIT
129267430Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
129367430Seric # endif
129465830Seric # ifndef HASFLOCK
129565830Seric #  define HASFLOCK	1	/* has flock(2) call */
129665830Seric # endif
129767602Seric # ifndef TZ_TYPE
129867608Seric #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
129967602Seric # endif
130063962Seric #endif
130163962Seric 
130265189Seric /* general System V Release 4 defines */
130365189Seric #ifdef __svr4__
130469804Seric # include <sys/mkdev.h>
130565189Seric # define SYSTEM5	1
130669638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
130767742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
130869778Seric #  define BSD_COMP	1	/* get BSD ioctl calls */
130967742Seric # ifndef HASSETRLIMIT
131067742Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
131167742Seric # endif
131265211Seric # ifndef HASGETUSERSHELL
131365211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
131465210Seric # endif
131565189Seric 
131665189Seric # ifndef _PATH_UNIX
131765189Seric #  define _PATH_UNIX		"/unix"
131865189Seric # endif
131965189Seric # ifndef _PATH_SENDMAILCF
132065189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
132165189Seric # endif
132265189Seric # ifndef _PATH_SENDMAILPID
132365189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
132465189Seric # endif
132565189Seric # ifndef SYSLOG_BUFSIZE
132665189Seric #  define SYSLOG_BUFSIZE	128
132765189Seric # endif
132867159Seric # ifndef SFS_TYPE
132967159Seric #  define SFS_TYPE		SFS_STATVFS
133067159Seric # endif
133165189Seric #endif
133265189Seric 
133363787Seric /* general System V defines */
133466298Seric #ifdef SYSTEM5
133564813Seric # include <sys/sysmacros.h>
133663949Seric # define HASUNAME	1	/* use System V uname(2) system call */
133764705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
133864962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
133967430Seric # ifndef HASULIMIT
134067430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
134167430Seric # endif
134263962Seric # ifndef LA_TYPE
134369462Seric #  ifdef MIOC_READKSYM
134469462Seric #   define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
134569462Seric #  else
134669462Seric #   define LA_TYPE	LA_INT		/* assume integer load average */
134769462Seric #  endif
134863962Seric # endif
134965749Seric # ifndef SFS_TYPE
135065749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
135165749Seric # endif
135267602Seric # ifndef TZ_TYPE
135367608Seric #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
135467602Seric # endif
135568442Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
135668442Seric # define bzero(d, l)		(memset((d), '\0', (l)))
135768442Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
135866298Seric #endif
135963787Seric 
136063949Seric /* general POSIX defines */
136163949Seric #ifdef _POSIX_VERSION
136264718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
136364718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
136469638Seric # if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
136569638Seric #  define USESETEUID	1	/* has useable seteuid(2) call */
136669638Seric # endif
136763949Seric #endif
136869638Seric /*
136968357Seric **  Tweaking for systems that (for example) claim to be BSD or POSIX
137068357Seric **  but don't have all the standard BSD or POSIX routines (boo hiss).
137164939Seric */
137264439Seric 
137364939Seric #ifdef titan
137464939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
137564939Seric #endif
137664939Seric 
137768357Seric #ifdef _CRAYCOM
137868357Seric # undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
137968357Seric #endif
138065830Seric 
138168442Seric #ifdef ISC_UNIX
138268442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
138368442Seric #endif
138468357Seric 
138568442Seric #ifdef ALTOS_SYS_V
138668442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
138768442Seric # undef bzero			/* despite SystemV claim, uses BSD bzero */
138868442Seric # undef bcmp			/* despite SystemV claim, uses BSD bcmp */
138968442Seric #endif
139068442Seric 
139168442Seric 
139265167Seric /*
139365167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
139465167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
139565167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
139665167Seric **  are closed.  Some firewalls return this error if you try to connect
139765167Seric **  to the IDENT port (113), so you can't receive email from these hosts
139865167Seric **  on these systems.  The firewall really should use a more specific
139965167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
140065167Seric **  not explicitly set to zero above, default it on.
140165167Seric */
140264939Seric 
140365167Seric #ifndef IDENTPROTO
140465167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
140565167Seric #endif
140665167Seric 
140769601Seric #ifndef IP_SRCROUTE
140869601Seric # define IP_SRCROUTE	1	/* Detect IP source routing */
140969601Seric #endif
141069601Seric 
141165211Seric #ifndef HASGETUSERSHELL
141265211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
141365210Seric #endif
141465167Seric 
141565830Seric #ifndef HASFLOCK
141665830Seric # define HASFLOCK	0	/* assume no flock(2) support */
141765830Seric #endif
141865210Seric 
141969638Seric #ifndef HASSETREUID
142069638Seric # define HASSETREUID	0	/* assume no setreuid(2) call */
142169638Seric #endif
142269638Seric 
142369638Seric #ifndef USESETEUID
142469638Seric # define USESETEUID	0	/* assume no seteuid(2) call or no saved ids */
142569638Seric #endif
142669638Seric 
142767430Seric #ifndef HASSETRLIMIT
142867430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
142967430Seric #endif
143067430Seric 
143167430Seric #ifndef HASULIMIT
143267430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
143367430Seric #endif
143467430Seric 
143566843Seric #ifndef OLD_NEWDB
143666843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
143766843Seric #endif
143865830Seric 
143968099Seric /* heuristic setting of HASSETSIGMASK; can override above */
144068099Seric #ifndef HASSIGSETMASK
144168099Seric # ifdef SIGVTALRM
144268099Seric #  define HASSETSIGMASK	1
144368099Seric # else
144468099Seric #  define HASSETSIGMASK	0
144568099Seric # endif
144668099Seric #endif
144766843Seric 
144869638Seric /*
144969638Seric **  If no type for argument two of getgroups call is defined, assume
145069638Seric **  it's an integer -- unfortunately, there seem to be several choices
145169638Seric **  here.
145269638Seric */
145369638Seric 
145469638Seric #ifndef GIDSET_T
145569638Seric # define GIDSET_T	int
145669638Seric #endif
145769638Seric 
145868705Seric #ifndef UID_T
145968705Seric # define UID_T		uid_t
146068705Seric #endif
146168099Seric 
146268706Seric #ifndef SIZE_T
146368706Seric # define SIZE_T		size_t
146468706Seric #endif
146568706Seric 
146668705Seric #ifndef ARGV_T
146768705Seric # define ARGV_T		char **
146868705Seric #endif
146969681Seric /**********************************************************************
147059023Seric **  Remaining definitions should never have to be changed.  They are
147159023Seric **  primarily to provide back compatibility for older systems -- for
147259287Seric **  example, it includes some POSIX compatibility definitions
147364439Seric **********************************************************************/
147459023Seric 
147559388Seric /* System 5 compatibility */
147659388Seric #ifndef S_ISREG
147764944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
147859388Seric #endif
147964944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
148064944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
148164944Seric #endif
148268494Seric #ifndef S_IWUSR
148368494Seric # define S_IWUSR		0200
148468494Seric #endif
148559388Seric #ifndef S_IWGRP
148668494Seric # define S_IWGRP		0020
148759388Seric #endif
148859388Seric #ifndef S_IWOTH
148968494Seric # define S_IWOTH		0002
149059388Seric #endif
149159388Seric 
149259023Seric /*
149350537Seric **  Older systems don't have this error code -- it should be in
149450537Seric **  /usr/include/sysexits.h.
149550537Seric */
149650537Seric 
149750537Seric # ifndef EX_CONFIG
149850537Seric # define EX_CONFIG	78	/* configuration error */
149950537Seric # endif
150056852Seric 
150164718Seric /* pseudo-code used in server SMTP */
150264718Seric # define EX_QUIT	22	/* drop out of server immediately */
150364718Seric 
150464718Seric 
150563993Seric /*
150663993Seric **  These are used in a few cases where we need some special
150763993Seric **  error codes, but where the system doesn't provide something
150863993Seric **  reasonable.  They are printed in errstring.
150963993Seric */
151063993Seric 
151163993Seric #ifndef E_PSEUDOBASE
151263993Seric # define E_PSEUDOBASE	256
151363993Seric #endif
151463993Seric 
151563993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
151663993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
151763993Seric 
151863970Seric /* type of arbitrary pointer */
151963970Seric #ifndef ARBPTR_T
152063970Seric # define ARBPTR_T	void *
152163970Seric #endif
152263970Seric 
152360568Seric #ifndef __P
152460568Seric # include "cdefs.h"
152560568Seric #endif
152660568Seric 
152767421Seric #if NAMED_BIND
152867421Seric # include <arpa/nameser.h>
152967434Seric # ifdef __svr4__
153067434Seric #  ifdef NOERROR
153167434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
153267434Seric #  endif
153367434Seric # endif
153467421Seric #endif
153567421Seric 
153656852Seric /*
153767419Seric **  The size of an IP address -- can't use sizeof because of problems
153867419Seric **  on Crays, where everything is 64 bits.  This will break if/when
153967419Seric **  IP addresses are expanded to eight bytes.
154067419Seric */
154167419Seric 
154267421Seric #ifndef INADDRSZ
154367421Seric # define INADDRSZ	4
154467421Seric #endif
154567419Seric 
154667419Seric /*
154767421Seric **  The size of various known types -- for reading network protocols.
154867421Seric **  Again, we can't use sizeof because of compiler randomness.
154967421Seric */
155067421Seric 
155167421Seric #ifndef INT16SZ
155267421Seric # define INT16SZ	2
155367421Seric #endif
155467421Seric #ifndef INT32SZ
155567421Seric # define INT32SZ	4
155667421Seric #endif
155767421Seric 
155867421Seric /*
155958778Seric **  Do some required dependencies
156058778Seric */
156158778Seric 
156258778Seric #if defined(NETINET) || defined(NETISO)
156359107Seric # define SMTP		1	/* enable user and server SMTP */
156459107Seric # define QUEUE		1	/* enable queueing */
156559107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
156658778Seric #endif
156758778Seric 
156858778Seric 
156958778Seric /*
157056852Seric **  Arrange to use either varargs or stdargs
157156852Seric */
157256852Seric 
157356852Seric # ifdef __STDC__
157456852Seric 
157556852Seric # include <stdarg.h>
157656852Seric 
157756852Seric # define VA_LOCAL_DECL	va_list ap;
157856852Seric # define VA_START(f)	va_start(ap, f)
157956852Seric # define VA_END		va_end(ap)
158056852Seric 
158156852Seric # else
158256852Seric 
158356852Seric # include <varargs.h>
158456852Seric 
158556852Seric # define VA_LOCAL_DECL	va_list ap;
158656852Seric # define VA_START(f)	va_start(ap)
158756852Seric # define VA_END		va_end(ap)
158856852Seric 
158956852Seric # endif
159057631Seric 
159157943Seric #ifdef HASUNAME
159257631Seric # include <sys/utsname.h>
159357631Seric # ifdef newstr
159457631Seric #  undef newstr
159557631Seric # endif
159657943Seric #else /* ! HASUNAME */
159757631Seric # define NODE_LENGTH 32
159857631Seric struct utsname
159957631Seric {
160057631Seric 	char nodename[NODE_LENGTH+1];
160157631Seric };
160257943Seric #endif /* HASUNAME */
160357642Seric 
160468040Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
160563838Seric # define MAXHOSTNAMELEN	256
160657735Seric #endif
160758153Seric 
160858153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
160958153Seric # define SIGCHLD	SIGCLD
161058153Seric #endif
161158153Seric 
161258153Seric #ifndef STDIN_FILENO
161368742Seric # define STDIN_FILENO	0
161458153Seric #endif
161558153Seric 
161658153Seric #ifndef STDOUT_FILENO
161768742Seric # define STDOUT_FILENO	1
161858153Seric #endif
161958153Seric 
162058153Seric #ifndef STDERR_FILENO
162168742Seric # define STDERR_FILENO	2
162258153Seric #endif
162358689Seric 
162464072Seric #ifndef LOCK_SH
162564035Seric # define LOCK_SH	0x01	/* shared lock */
162664035Seric # define LOCK_EX	0x02	/* exclusive lock */
162764035Seric # define LOCK_NB	0x04	/* non-blocking lock */
162864035Seric # define LOCK_UN	0x08	/* unlock */
162964035Seric #endif
163058692Seric 
163168742Seric #ifndef SEEK_SET
163268742Seric # define SEEK_SET	0
163368742Seric # define SEEK_CUR	1
163468742Seric # define SEEK_END	2
163568742Seric #endif
163668742Seric 
163764035Seric #ifndef SIG_ERR
163864035Seric # define SIG_ERR	((void (*)()) -1)
163958689Seric #endif
164058702Seric 
164164500Seric #ifndef WEXITSTATUS
164264500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
164364500Seric #endif
164464500Seric #ifndef WIFEXITED
164564500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
164664500Seric #endif
164764500Seric 
164864561Seric #ifndef SIGFUNC_DEFINED
164964561Seric typedef void		(*sigfunc_t) __P((int));
165064561Seric #endif
165164561Seric 
165265053Seric /* size of syslog buffer */
165365053Seric #ifndef SYSLOG_BUFSIZE
165465053Seric # define SYSLOG_BUFSIZE	1024
165565053Seric #endif
165665053Seric 
165758702Seric /*
165858702Seric **  Size of tobuf (deliver.c)
165958702Seric **	Tweak this to match your syslog implementation.  It will have to
166058702Seric **	allow for the extra information printed.
166158702Seric */
166258702Seric 
166358702Seric #ifndef TOBUFSIZE
166465053Seric # if (SYSLOG_BUFSIZE) > 512
166565053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
166665053Seric # else
166765053Seric #  define TOBUFSIZE	256
166865053Seric # endif
166958702Seric #endif
167060219Seric 
167165015Seric /*
167265015Seric **  Size of prescan buffer.
167365015Seric **	Despite comments in the _sendmail_ book, this probably should
167465015Seric **	not be changed; there are some hard-to-define dependencies.
167565015Seric */
167665015Seric 
167765015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
167860219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
167960219Seric # ifndef FORK
168060219Seric # define FORK		vfork		/* function to call to fork mailer */
168160219Seric # endif
168265955Seric 
168365955Seric /*
168465955Seric **  If we are going to link scanf anyway, use it in readcf
168565955Seric */
168665955Seric 
168765955Seric #if !defined(HASUNAME) && !defined(SCANF)
168865955Seric # define SCANF		1
168965955Seric #endif
1690