xref: /csrg-svn/usr.sbin/sendmail/src/conf.h (revision 69879)
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*69879Seric  *	@(#)conf.h	8.187 (Berkeley) 06/13/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 *
22869828Seric #  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 
45369860Seric #if defined(BSD4_4) && !defined(__bsdi__)
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>
63269849Seric # include <sys/stream.h>	/* needed for IP_SRCROUTE */
63369849Seric # include <sys/bsdtypes.h>
63468442Seric # define SYSTEM5	1	/* include all the System V defines */
63568442Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
63668442Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
63768442Seric # define HASSETREUID	1	/* has setreuid(2) call */
63868442Seric # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
63968442Seric # undef NETUNIX			/* no unix domain socket support */
64068442Seric # define FORK		fork
64168442Seric # define MAXPATHLEN	1024
64268442Seric # define LA_TYPE	LA_SHORT
64368442Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
64468442Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
64568442Seric # define _PATH_UNIX	"/unix"
64668442Seric # ifndef _PATH_SENDMAILCF
64768442Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
64868442Seric # endif
64968442Seric # ifndef _PATH_SENDMAILPID
65068442Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
65168442Seric # endif
65268442Seric 
65368442Seric typedef short		pid_t;
65468442Seric 
65568442Seric #endif
65668442Seric 
65768442Seric 
65868442Seric /*
65968040Seric **  Altos System V.
66068040Seric **	Contributed by Tim Rice <timr@crl.com>.
66168040Seric */
66268040Seric 
66368040Seric #ifdef ALTOS_SYS_V
66468040Seric # include <limits.h>
66568040Seric # define SYSTEM5	1	/* include all the System V defines */
66668040Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
66768040Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
66868040Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
66968040Seric # define NEEDFSYNC	1	/* no fsync(2) in system library */
67068040Seric # define FORK		fork
67168040Seric # define MAXPATHLEN	PATHSIZE
67268040Seric # define LA_TYPE	LA_SHORT
67368040Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
67468439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
67568040Seric # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
67668040Seric # undef NETUNIX			/* no unix domain socket support */
67768040Seric # undef WIFEXITED
67868040Seric # undef WEXITSTATUS
67968040Seric # define strtoul	strtol	/* gcc library bogosity */
68068040Seric 
68168040Seric typedef unsigned short	uid_t;
68268040Seric typedef unsigned short	gid_t;
68368040Seric typedef short		pid_t;
68468040Seric #endif
68568040Seric 
68668040Seric 
68768040Seric /*
68863962Seric **  ConvexOS 11.0 and later
68965949Seric **
69065949Seric **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
69165949Seric **	works on 9.1 as well.
69263962Seric */
69363962Seric 
69463962Seric #ifdef _CONVEX_SOURCE
69563977Seric # define BSD		1	/* include all the BSD defines */
69663977Seric # define HASUNAME	1	/* use System V uname(2) system call */
69763962Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
69863977Seric # define NEEDGETOPT	1	/* need replacement for getopt(3) */
69969681Seric # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
70063962Seric # define LA_TYPE	LA_FLOAT
70165749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
70265949Seric # ifndef _PATH_SENDMAILCF
70365949Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
70465949Seric # endif
70565949Seric # ifndef S_IREAD
70665949Seric #  define S_IREAD	_S_IREAD
70765949Seric #  define S_IWRITE	_S_IWRITE
70865949Seric #  define S_IEXEC	_S_IEXEC
70965949Seric #  define S_IFMT	_S_IFMT
71065949Seric #  define S_IFCHR	_S_IFCHR
71165949Seric #  define S_IFBLK	_S_IFBLK
71265949Seric # endif
71365167Seric # ifndef IDENTPROTO
71465167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
71565167Seric # endif
71663962Seric #endif
71763962Seric 
71864314Seric 
71963962Seric /*
72064999Seric **  RISC/os 4.52
72163962Seric **
72264999Seric **	Gives a ton of warning messages, but otherwise compiles.
72363962Seric */
72463962Seric 
72563965Seric #ifdef RISCOS
72664999Seric 
72763962Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
72866226Seric # ifndef HASFLOCK
72965830Seric #  define HASFLOCK	1	/* has flock(2) call */
73065830Seric # endif
73164999Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
73264999Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
73363962Seric # define LA_TYPE	LA_INT
73463962Seric # define LA_AVENRUN	"avenrun"
73563962Seric # define _PATH_UNIX	"/unix"
73664999Seric # undef WIFEXITED
73764999Seric 
73864999Seric # define setpgid	setpgrp
73964999Seric 
74064999Seric extern int		errno;
74164999Seric typedef int		pid_t;
74264999Seric #define			SIGFUNC_DEFINED
74364999Seric typedef int		(*sigfunc_t)();
74464999Seric extern char		*getenv();
74564999Seric extern void		*malloc();
74664999Seric 
74763962Seric #endif
74863962Seric 
74964314Seric 
75064155Seric /*
75164155Seric **  Linux 0.99pl10 and above...
75266300Seric **
75366300Seric **  Thanks to, in reverse order of contact:
75466300Seric **
75568093Seric **	John Kennedy <warlock@csuchico.edu>
75667885Seric **	Andrew Pam <avatar@aus.xanadu.com>
75766300Seric **	Florian La Roche <rzsfl@rz.uni-sb.de>
75866300Seric **	Karl London <karl@borg.demon.co.uk>
75966300Seric **
76069690Seric **  Last compiled against:	[05/25/95 @ 11:39:31 AM (Thursday)]
76169690Seric **	sendmail 8.7.b.0	named 4.9.3-beta17	db-1.85
76269690Seric **	gcc 2.6.4-950518	libc-5.0.9		linux 1.2.8
76364155Seric */
76464155Seric 
76564770Seric #ifdef __linux__
76666298Seric # define BSD		1	/* include BSD defines */
76764155Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
76866298Seric # define HASUNAME	1	/* use System V uname(2) system call */
76964380Seric # define HASUNSETENV	1	/* has unsetenv(3) call */
77066298Seric # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
77166300Seric # define GIDSET_T	gid_t	/* from <linux/types.h> */
77267885Seric # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
77369690Seric # define IP_SRCROUTE	0	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
77468518Seric # ifndef HASFLOCK
77568518Seric #  define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
77668518Seric # endif
77764155Seric # ifndef LA_TYPE
77866301Seric #  define LA_TYPE	LA_PROCSTR
77964155Seric # endif
78066300Seric # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
78168093Seric # ifndef _PATH_SENDMAILPID
78268093Seric #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
78368093Seric # endif
78468093Seric # define TZ_TYPE	TZ_TNAME
78564763Seric # include <sys/sysmacros.h>
78666300Seric # undef atol			/* wounded in <stdlib.h> */
78764155Seric #endif
78864155Seric 
78964155Seric 
79064345Seric /*
79164345Seric **  DELL SVR4 Issue 2.2, and others
79264345Seric **	From Kimmo Suominen <kim@grendel.lut.fi>
79364345Seric **
79464345Seric **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
79564345Seric **	defined, and the definitions conflict.
79664924Seric **
79764924Seric **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
79864924Seric **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
79964924Seric **	(SVR4.0/386 version 3.0).
80064345Seric */
80164345Seric 
80264345Seric #ifdef DELL_SVR4
80365189Seric 				/* no changes necessary */
80465189Seric 				/* see general __svr4__ defines below */
80564345Seric #endif
80664345Seric 
80764345Seric 
80864380Seric /*
80964380Seric **  Apple A/UX 3.0
81064380Seric */
81164345Seric 
81264380Seric #ifdef _AUX_SOURCE
81364729Seric # include <sys/sysmacros.h>
81464380Seric # define BSD			/* has BSD routines */
81568803Seric # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
81664380Seric # define HASUNAME	1	/* use System V uname(2) system call */
81764380Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
81864561Seric # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
81965167Seric # ifndef IDENTPROTO
82065167Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
82165167Seric # endif
82264380Seric # define FORK		fork
82364380Seric # ifndef _PATH_SENDMAILCF
82464380Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
82564380Seric # endif
82664380Seric # ifndef LA_TYPE
82764380Seric #  define LA_TYPE	LA_ZERO
82864380Seric # endif
82965749Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
83064560Seric # undef WIFEXITED
83164560Seric # undef WEXITSTATUS
83264380Seric #endif
83364380Seric 
83464380Seric 
83564705Seric /*
83664705Seric **  Encore UMAX V
83764705Seric **
83864705Seric **	Not extensively tested.
83964705Seric */
84064380Seric 
84164705Seric #ifdef UMAXV
84264705Seric # include <limits.h>
84364705Seric # define HASUNAME	1	/* use System V uname(2) system call */
84464705Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
84564705Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
84665211Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
84764705Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
84864705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
84964705Seric # define FORK		fork	/* no vfork(2) primitive available */
85065749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
85164705Seric # define MAXPATHLEN	PATH_MAX
85264705Seric extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
85364705Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
85464705Seric # undef WIFEXITED
85564705Seric # undef WEXITSTATUS
85664705Seric #endif
85764705Seric 
85864705Seric 
85964939Seric /*
86064939Seric **  Stardent Titan 3000 running TitanOS 4.2.
86164939Seric **
86264939Seric **	Must be compiled in "cc -43" mode.
86364939Seric **
86464944Seric **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
86564939Seric **
86664939Seric **	Note the tweaking below after the BSD defines are set.
86764939Seric */
86864705Seric 
86964939Seric #ifdef titan
87064939Seric # define setpgid	setpgrp
87164939Seric typedef int		pid_t;
87264939Seric # undef WIFEXITED
87364939Seric # undef WEXITSTATUS
87464939Seric #endif
87564939Seric 
87664939Seric 
87764962Seric /*
87864962Seric **  Sequent DYNIX 3.2.0
87964962Seric **
88064962Seric **	From Jim Davis <jdavis@cs.arizona.edu>.
88164962Seric */
88264939Seric 
88364962Seric #ifdef sequent
88466038Seric 
88564962Seric # define BSD		1
88664962Seric # define HASUNSETENV	1
88764962Seric # define BSD4_3		1	/* to get signal() in conf.c */
88864962Seric # define WAITUNION	1
88964962Seric # define LA_TYPE	LA_FLOAT
89064962Seric # ifdef	_POSIX_VERSION
89164962Seric #  undef _POSIX_VERSION		/* set in <unistd.h> */
89264962Seric # endif
89364962Seric # undef HASSETVBUF		/* don't actually have setvbuf(3) */
89464962Seric # define setpgid	setpgrp
89564962Seric 
89664962Seric /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
89764962Seric # undef	WIFEXITED
89864962Seric # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
89964962Seric 			 ((union wait*)&(s))->w_termsig == 0)
90064962Seric # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
90164962Seric typedef int		pid_t;
90264962Seric # define isgraph(c)	(isprint(c) && (c != ' '))
90364962Seric 
90466144Seric # ifndef IDENTPROTO
90566144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
90666144Seric # endif
90766144Seric 
90864962Seric # ifndef _PATH_UNIX
90964962Seric #  define _PATH_UNIX	"/dynix"
91064962Seric # endif
91164962Seric # ifndef _PATH_SENDMAILCF
91264962Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
91364962Seric # endif
91464962Seric 
91564962Seric #endif
91664962Seric 
91764962Seric 
91865748Seric /*
91966038Seric **  Sequent DYNIX/ptx v2.0 (and higher)
92066038Seric **
92166038Seric **	For DYNIX/ptx v1.x, undefine HASSETREUID.
92266038Seric **
92366038Seric **	From Tim Wright <timw@sequent.com>.
92466038Seric */
92566038Seric 
92666038Seric #ifdef _SEQUENT_
92766038Seric # define SYSTEM5	1	/* include all the System V defines */
92866038Seric # define HASSETSID	1	/* has POSIX setsid(2) call */
92966038Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
93066038Seric # define HASSETREUID	1	/* has setreuid(2) call */
93166038Seric # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
93266038Seric # define GIDSET_T	gid_t
93366038Seric # define LA_TYPE	LA_INT
93466038Seric # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
93567771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
93666144Seric # ifndef IDENTPROTO
93766144Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
93866144Seric # endif
93966038Seric # ifndef _PATH_SENDMAILCF
94066038Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
94166038Seric # endif
94266038Seric # ifndef _PATH_SENDMAILPID
94366038Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
94466038Seric # endif
94566038Seric #endif
94666038Seric 
94766038Seric 
94866038Seric /*
94965748Seric **  Cray Unicos
95065748Seric **
95165748Seric **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
95265748Seric */
95364962Seric 
95465748Seric #ifdef UNICOS
95565748Seric # define SYSTEM5	1	/* include all the System V defines */
95665748Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
95765748Seric # define MAXPATHLEN	PATHSIZE
95865748Seric # define LA_TYPE	LA_ZERO
95965749Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
96068439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
96165748Seric #endif
96264962Seric 
96365748Seric 
96465820Seric /*
96565820Seric **  Apollo DomainOS
96665820Seric **
96765820Seric **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
96865982Seric **
96965820Seric **  15 Jan 1994
97065820Seric **
97165820Seric */
97265748Seric 
97365820Seric #ifdef apollo
97465820Seric # define HASSETREUID	1	/* has setreuid(2) call */
97565820Seric # define HASINITGROUPS	1	/* has initgroups(2) call */
97667771Seric # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
97765820Seric # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
97866044Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
97968439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
98065820Seric # ifndef _PATH_SENDMAILCF
98165820Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
98265820Seric # endif
98365820Seric # ifndef _PATH_SENDMAILPID
98465820Seric #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
98565820Seric # endif
98665820Seric # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
98765820Seric # undef  S_IFIFO
98865820Seric # define S_IFIFO	0010000
98965820Seric # ifndef IDENTPROTO
99065820Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
99165820Seric # endif
99265982Seric #endif
99365820Seric 
99465820Seric 
99566748Seric /*
99667745Seric **  UnixWare 1.1.2.
99766752Seric **
99869803Seric **	Updated by Petr Lampa <lampa@fee.vutbr.cz>.
99966752Seric **	From Evan Champion <evanc@spatial.synapse.org>.
100066752Seric */
100166752Seric 
100266752Seric #ifdef UNIXWARE
100369841Seric # include <sys/mkdev.h>
100466752Seric # define SYSTEM5		1
100567745Seric # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
100667745Seric # define HASSETREUID		1
100767745Seric # define HASSETSID		1
100867745Seric # define HASINITGROUPS		1
100967745Seric # define GIDSET_T		gid_t
101067745Seric # define SLEEP_T		unsigned
101166752Seric # define SFS_TYPE		SFS_STATVFS
101266752Seric # define LA_TYPE		LA_ZERO
101366752Seric # undef WIFEXITED
101466752Seric # undef WEXITSTATUS
101566752Seric # define _PATH_UNIX		"/unix"
101666752Seric # ifndef _PATH_SENDMAILCF
101766752Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
101866752Seric # endif
101966752Seric # ifndef _PATH_SENDMAILPID
102066752Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
102166752Seric # endif
102266752Seric # define SYSLOG_BUFSIZE	128
102366752Seric #endif
102466752Seric 
102566752Seric 
102666752Seric /*
102766748Seric **  Intergraph CLIX 3.1
102866748Seric **
102966748Seric **	From Paul Southworth <pauls@locust.cic.net>
103066748Seric */
103165820Seric 
103266748Seric #ifdef CLIX
103366748Seric # define SYSTEM5	1	/* looks like System V */
103466752Seric # ifndef HASGETUSERSHELL
103566752Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
103666752Seric # endif
103766748Seric # define DEV_BSIZE	512	/* device block size not defined */
103866748Seric # define GIDSET_T	gid_t
103966748Seric # undef LOG			/* syslog not available */
104066748Seric # define NEEDFSYNC	1	/* no fsync in system library */
104166748Seric # define GETSHORT	_getshort
104266748Seric #endif
104365820Seric 
104466748Seric 
104566776Seric /*
104666776Seric **  NCR 3000 Series (SysVr4)
104766776Seric **
104867434Seric **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
104966776Seric */
105066748Seric 
105166776Seric #ifdef NCR3000
105269775Seric # include <sys/sockio.h>
105366776Seric # define __svr4__
105469681Seric # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
105566776Seric # undef BSD
105666776Seric # define LA_AVENRUN	"avenrun"
105766776Seric #endif
105866748Seric 
105966776Seric 
106067434Seric /*
106167434Seric **  Tandem NonStop-UX SVR4
106267434Seric **
106367434Seric **	From Rick McCarty <mccarty@mpd.tandem.com>.
106467434Seric */
106566776Seric 
106667434Seric #ifdef NonStop_UX_BXX
106767434Seric # define __svr4__
106867434Seric #endif
106966776Seric 
107067434Seric 
107167488Seric /*
107267488Seric **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
107367488Seric **
107467488Seric **	Tested for 1.04 and 1.03
107567488Seric **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
107667488Seric */
107767434Seric 
107867488Seric #ifdef __H3050R
107967488Seric # define SYSTEM5	1	/* include all the System V defines */
108067488Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
108167488Seric # define setreuid(r, e)	setresuid(r, e, -1)
108267488Seric # define LA_TYPE	LA_FLOAT
108367488Seric # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
108467488Seric # define HASSETVBUF	/* HI-UX has no setlinebuf */
108567488Seric # ifndef GIDSET_T
108667488Seric #  define GIDSET_T	gid_t
108767488Seric # endif
108867488Seric # ifndef _PATH_UNIX
108967488Seric #  define _PATH_UNIX	"/HI-UX"
109067488Seric # endif
109167488Seric # ifndef _PATH_SENDMAILCF
109267488Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
109367488Seric # endif
109467488Seric # ifndef IDENTPROTO
109567488Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
109667488Seric # endif
109767488Seric # ifndef HASGETUSERSHELL
109867488Seric #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
109967488Seric # endif
110067488Seric 
110167488Seric /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
110267488Seric # undef m_flags
110367488Seric 
110467488Seric # ifdef __STDC__
110567488Seric extern int	syslog(int, char *, ...);
110667488Seric # endif
110767488Seric 
110867488Seric #endif
110967488Seric 
111067488Seric 
111168099Seric /*
111268099Seric **  Amdahl UTS System V 2.1.5 (SVr3-based)
111368099Seric **
111468099Seric **    From: Janet Jackson <janet@dialix.oz.au>.
111568099Seric */
111667488Seric 
111768099Seric #ifdef _UTS
111868099Seric # include <sys/sysmacros.h>
111968099Seric # undef HASLSTAT	/* has symlinks, but they cause problems */
112068099Seric # define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
112168099Seric # define SYS5SIGNALS	1	/* System V signal semantics */
112268099Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
112368099Seric # define HASUNAME	1	/* use System V uname(2) system call */
112468099Seric # define HASINITGROUPS	1	/* has initgroups(3) function */
112568099Seric # define HASSETVBUF	1	/* has setvbuf(3) function */
112668099Seric # define HASSIGSETMASK	0	/* does not have sigsetmask(2) function */
112768099Seric # ifndef HASGETUSERSHELL
112868099Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
112968099Seric # endif
113068099Seric # define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
113168099Seric # define LA_TYPE	LA_ZERO		/* doesn't have load average */
113268099Seric # define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
113368439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
113468099Seric # define _PATH_UNIX	"/unix"
113568099Seric # ifndef _PATH_SENDMAILCF
113668099Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
113768099Seric # endif
113868099Seric #endif
113968099Seric 
114068357Seric /*
114168357Seric **  Cray Computer Corporation's CSOS
114268357Seric **
114369473Seric **	From Scott Bolte <scott@craycos.com>.
114468357Seric */
114568099Seric 
114668357Seric #ifdef _CRAYCOM
114768357Seric # define SYSTEM5	1	/* include all the System V defines */
114868357Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
114968357Seric # define NEEDFSYNC	1	/* no fsync in system library */
115068357Seric # define MAXPATHLEN	PATHSIZE
115168357Seric # define LA_TYPE	LA_ZERO
115268357Seric # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
115368439Seric # define SFS_BAVAIL	f_bfree		/* alternate field name */
115468357Seric # define _POSIX_CHOWN_RESTRICTED	-1
115568357Seric extern struct group	*getgrent(), *getgrnam(), *getgrgid();
115668357Seric #endif
115768099Seric 
115868099Seric 
115968742Seric /*
116068742Seric **  Sony NEWS-OS 4.2.1R and 6.0.3
116169473Seric **
116269473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
116368742Seric */
116468742Seric 
116568742Seric #ifdef sony_news
116668742Seric # ifndef __svr4
116768742Seric 			/* NEWS-OS 4.2.1R */
116868742Seric #  ifndef BSD
116968742Seric #   define BSD			/* has BSD routines */
117068742Seric #  endif
117168742Seric #  define HASUNSETENV	1	/* has unsetenv(2) call */
117268742Seric #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
117368742Seric #  define WAITUNION	1	/* use "union wait" as wait argument type */
117468742Seric #  define LA_TYPE	LA_INT
117568742Seric #  define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
117668742Seric #  ifndef HASFLOCK
117768742Seric #   define HASFLOCK	1	/* has flock(2) call */
117868742Seric #  endif
117968742Seric #  define setpgid	setpgrp
118068742Seric #  undef WIFEXITED
118168742Seric #  undef WEXITSTATUS
118268742Seric typedef int		pid_t;
118368742Seric typedef int		(*sigfunc_t)();
118468742Seric #  define SIGFUNC_DEFINED
118568742Seric 
118668742Seric # else
118768742Seric 			/* NEWS-OS 6.0.3 with /bin/cc */
1188*69879Seric #  ifndef __svr4__
1189*69879Seric #   define __svr4__		/* use all System V Releae 4 defines below */
1190*69879Seric #  endif
119168742Seric #  define HASSETSID	1	/* has Posix setsid(2) call */
119268742Seric #  define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
119369473Seric #  define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
119469649Seric #  ifndef SPT_TYPE
119569649Seric #   define SPT_TYPE	SPT_SYSMIPS	/* use sysmips() (OS 6.0.2 or later) */
119669649Seric #  endif
119768742Seric #  define GIDSET_T	gid_t
119868742Seric #  undef WIFEXITED
119968742Seric #  undef WEXITSTATUS
1200*69879Seric #  ifndef SYSLOG_BUFSIZE
1201*69879Seric #   define SYSLOG_BUFSIZE	1024
1202*69879Seric #  endif
120368742Seric #  define _PATH_UNIX  "/stand/unix"
120468742Seric #  ifndef _PATH_SENDMAILCF
120568742Seric #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
120668742Seric #  endif
120768742Seric #  ifndef _PATH_SENDMAILPID
120868742Seric #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
120968742Seric #  endif
121068742Seric 
121168742Seric # endif
121268742Seric #endif
121368742Seric 
121468742Seric 
121568742Seric /*
121668742Seric **  Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
121769473Seric **
121869473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
121968742Seric */
122068742Seric 
122168742Seric #ifdef luna
122268742Seric # ifndef IDENTPROTO
122368742Seric #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
122468742Seric # endif
122568742Seric # ifdef uniosb
122669454Seric #  include <sys/time.h>
122768742Seric #  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
122868742Seric # endif
122969649Seric # define HASUNSETENV	1	/* has unsetenv(2) call */
123069649Seric # define NEEDPUTENV	1	/* need putenv(3) call */
123168742Seric # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
123269679Seric # define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
123368742Seric # define WAITUNION	1	/* use "union wait" as wait argument type */
123468742Seric # ifdef uniosb
123568742Seric #  define LA_TYPE	LA_INT
123668742Seric # endif
123768742Seric # ifdef luna2m
123868742Seric #  define LA_TYPE	LA_SUBR
123968742Seric # endif
124068742Seric # ifdef luna88k
124168742Seric #  define LA_TYPE	LA_INT
124268742Seric # endif
124368742Seric # define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
124468742Seric # define setpgid	setpgrp
124568742Seric # undef WIFEXITED
124668742Seric # undef WEXITSTATUS
124768742Seric typedef int		pid_t;
124868742Seric typedef int		(*sigfunc_t)();
124968742Seric # define SIGFUNC_DEFINED
125068742Seric extern char	*getenv();
125168742Seric extern int	errno;
125268742Seric # ifndef _PATH_SENDMAILCF
125368742Seric #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
125468742Seric # endif
125568742Seric #endif
125668742Seric 
125768742Seric 
125868742Seric /*
125969473Seric **  NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
126068742Seric **
126169473Seric **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
126268742Seric */
126368742Seric 
126468742Seric #ifdef nec_ews_svr4
126569454Seric # ifndef __svr4__
126669454Seric #  define __svr4__		/* use all System V Releae 4 defines below */
126769454Seric # endif
126868742Seric # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
126968742Seric # define HASSETSID	1	/* has Posix setsid(2) call */
127069473Seric # define LA_TYPE	LA_READKSYM	/* use MIOC_READSYM ioctl */
127168742Seric # define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
127268742Seric # define GIDSET_T	gid_t
127368742Seric # undef WIFEXITED
127468742Seric # undef WEXITSTATUS
127569454Seric # define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
127668742Seric #endif
127768742Seric 
127868742Seric 
127968742Seric 
128063902Seric /**********************************************************************
128163787Seric **  End of Per-Operating System defines
128263902Seric **********************************************************************/
128369638Seric /**********************************************************************
128463949Seric **  More general defines
128563949Seric **********************************************************************/
128663949Seric 
128763962Seric /* general BSD defines */
128863962Seric #ifdef BSD
128964035Seric # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
129064035Seric # define HASSETREUID	1	/* has setreuid(2) call */
129167742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
129269681Seric # ifndef IP_SRCROUTE
129369681Seric #  define IP_SRCROUTE	1	/* can check IP source routing */
129469681Seric # endif
129567430Seric # ifndef HASSETRLIMIT
129667430Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
129767430Seric # endif
129865830Seric # ifndef HASFLOCK
129965830Seric #  define HASFLOCK	1	/* has flock(2) call */
130065830Seric # endif
130167602Seric # ifndef TZ_TYPE
130267608Seric #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
130367602Seric # endif
130463962Seric #endif
130563962Seric 
130665189Seric /* general System V Release 4 defines */
130765189Seric #ifdef __svr4__
130865189Seric # define SYSTEM5	1
130969638Seric # define USESETEUID	1	/* has useable seteuid(2) call */
131067742Seric # define HASINITGROUPS	1	/* has initgroups(3) call */
131169778Seric #  define BSD_COMP	1	/* get BSD ioctl calls */
131267742Seric # ifndef HASSETRLIMIT
131367742Seric #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
131467742Seric # endif
131565211Seric # ifndef HASGETUSERSHELL
131665211Seric #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
131765210Seric # endif
131865189Seric 
131965189Seric # ifndef _PATH_UNIX
132065189Seric #  define _PATH_UNIX		"/unix"
132165189Seric # endif
132265189Seric # ifndef _PATH_SENDMAILCF
132365189Seric #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
132465189Seric # endif
132565189Seric # ifndef _PATH_SENDMAILPID
132665189Seric #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
132765189Seric # endif
132865189Seric # ifndef SYSLOG_BUFSIZE
132965189Seric #  define SYSLOG_BUFSIZE	128
133065189Seric # endif
133167159Seric # ifndef SFS_TYPE
133267159Seric #  define SFS_TYPE		SFS_STATVFS
133367159Seric # endif
133465189Seric #endif
133565189Seric 
133663787Seric /* general System V defines */
133766298Seric #ifdef SYSTEM5
133864813Seric # include <sys/sysmacros.h>
133963949Seric # define HASUNAME	1	/* use System V uname(2) system call */
134064705Seric # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
134164962Seric # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
134267430Seric # ifndef HASULIMIT
134367430Seric #  define HASULIMIT	1	/* has the ulimit(2) syscall */
134467430Seric # endif
134563962Seric # ifndef LA_TYPE
134669462Seric #  ifdef MIOC_READKSYM
134769462Seric #   define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
134869462Seric #  else
134969462Seric #   define LA_TYPE	LA_INT		/* assume integer load average */
135069462Seric #  endif
135163962Seric # endif
135265749Seric # ifndef SFS_TYPE
135365749Seric #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
135465749Seric # endif
135567602Seric # ifndef TZ_TYPE
135667608Seric #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
135767602Seric # endif
135868442Seric # define bcopy(s, d, l)		(memmove((d), (s), (l)))
135968442Seric # define bzero(d, l)		(memset((d), '\0', (l)))
136068442Seric # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
136166298Seric #endif
136263787Seric 
136363949Seric /* general POSIX defines */
136463949Seric #ifdef _POSIX_VERSION
136564718Seric # define HASSETSID	1	/* has Posix setsid(2) call */
136664718Seric # define HASWAITPID	1	/* has Posix waitpid(2) call */
136769638Seric # if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
136869638Seric #  define USESETEUID	1	/* has useable seteuid(2) call */
136969638Seric # endif
137063949Seric #endif
137169638Seric /*
137268357Seric **  Tweaking for systems that (for example) claim to be BSD or POSIX
137368357Seric **  but don't have all the standard BSD or POSIX routines (boo hiss).
137464939Seric */
137564439Seric 
137664939Seric #ifdef titan
137764939Seric # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
137864939Seric #endif
137964939Seric 
138068357Seric #ifdef _CRAYCOM
138168357Seric # undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
138268357Seric #endif
138365830Seric 
138468442Seric #ifdef ISC_UNIX
138568442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
138668442Seric #endif
138768357Seric 
138868442Seric #ifdef ALTOS_SYS_V
138968442Seric # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
139068442Seric # undef bzero			/* despite SystemV claim, uses BSD bzero */
139168442Seric # undef bcmp			/* despite SystemV claim, uses BSD bcmp */
139268442Seric #endif
139368442Seric 
139468442Seric 
139565167Seric /*
139665167Seric **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
139765167Seric **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
139865167Seric **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
139965167Seric **  are closed.  Some firewalls return this error if you try to connect
140065167Seric **  to the IDENT port (113), so you can't receive email from these hosts
140165167Seric **  on these systems.  The firewall really should use a more specific
140265167Seric **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
140365167Seric **  not explicitly set to zero above, default it on.
140465167Seric */
140564939Seric 
140665167Seric #ifndef IDENTPROTO
140765167Seric # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
140865167Seric #endif
140965167Seric 
141069601Seric #ifndef IP_SRCROUTE
141169601Seric # define IP_SRCROUTE	1	/* Detect IP source routing */
141269601Seric #endif
141369601Seric 
141465211Seric #ifndef HASGETUSERSHELL
141565211Seric # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
141665210Seric #endif
141765167Seric 
141865830Seric #ifndef HASFLOCK
141965830Seric # define HASFLOCK	0	/* assume no flock(2) support */
142065830Seric #endif
142165210Seric 
142269638Seric #ifndef HASSETREUID
142369638Seric # define HASSETREUID	0	/* assume no setreuid(2) call */
142469638Seric #endif
142569638Seric 
142669638Seric #ifndef USESETEUID
142769638Seric # define USESETEUID	0	/* assume no seteuid(2) call or no saved ids */
142869638Seric #endif
142969638Seric 
143067430Seric #ifndef HASSETRLIMIT
143167430Seric # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
143267430Seric #endif
143367430Seric 
143467430Seric #ifndef HASULIMIT
143567430Seric # define HASULIMIT	0	/* assume no ulimit(2) support */
143667430Seric #endif
143767430Seric 
143866843Seric #ifndef OLD_NEWDB
143966843Seric # define OLD_NEWDB	0	/* assume newer version of newdb */
144066843Seric #endif
144165830Seric 
144268099Seric /* heuristic setting of HASSETSIGMASK; can override above */
144368099Seric #ifndef HASSIGSETMASK
144468099Seric # ifdef SIGVTALRM
144568099Seric #  define HASSETSIGMASK	1
144668099Seric # else
144768099Seric #  define HASSETSIGMASK	0
144868099Seric # endif
144968099Seric #endif
145066843Seric 
145169638Seric /*
145269638Seric **  If no type for argument two of getgroups call is defined, assume
145369638Seric **  it's an integer -- unfortunately, there seem to be several choices
145469638Seric **  here.
145569638Seric */
145669638Seric 
145769638Seric #ifndef GIDSET_T
145869638Seric # define GIDSET_T	int
145969638Seric #endif
146069638Seric 
146168705Seric #ifndef UID_T
146268705Seric # define UID_T		uid_t
146368705Seric #endif
146468099Seric 
146568706Seric #ifndef SIZE_T
146668706Seric # define SIZE_T		size_t
146768706Seric #endif
146868706Seric 
146968705Seric #ifndef ARGV_T
147068705Seric # define ARGV_T		char **
147168705Seric #endif
147269681Seric /**********************************************************************
147359023Seric **  Remaining definitions should never have to be changed.  They are
147459023Seric **  primarily to provide back compatibility for older systems -- for
147559287Seric **  example, it includes some POSIX compatibility definitions
147664439Seric **********************************************************************/
147759023Seric 
147859388Seric /* System 5 compatibility */
147959388Seric #ifndef S_ISREG
148064944Seric # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
148159388Seric #endif
148264944Seric #if !defined(S_ISLNK) && defined(S_IFLNK)
148364944Seric # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
148464944Seric #endif
148568494Seric #ifndef S_IWUSR
148668494Seric # define S_IWUSR		0200
148768494Seric #endif
148859388Seric #ifndef S_IWGRP
148968494Seric # define S_IWGRP		0020
149059388Seric #endif
149159388Seric #ifndef S_IWOTH
149268494Seric # define S_IWOTH		0002
149359388Seric #endif
149459388Seric 
149559023Seric /*
149650537Seric **  Older systems don't have this error code -- it should be in
149750537Seric **  /usr/include/sysexits.h.
149850537Seric */
149950537Seric 
150050537Seric # ifndef EX_CONFIG
150150537Seric # define EX_CONFIG	78	/* configuration error */
150250537Seric # endif
150356852Seric 
150464718Seric /* pseudo-code used in server SMTP */
150564718Seric # define EX_QUIT	22	/* drop out of server immediately */
150664718Seric 
150764718Seric 
150863993Seric /*
150963993Seric **  These are used in a few cases where we need some special
151063993Seric **  error codes, but where the system doesn't provide something
151163993Seric **  reasonable.  They are printed in errstring.
151263993Seric */
151363993Seric 
151463993Seric #ifndef E_PSEUDOBASE
151563993Seric # define E_PSEUDOBASE	256
151663993Seric #endif
151763993Seric 
151863993Seric #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
151963993Seric #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
152063993Seric 
152163970Seric /* type of arbitrary pointer */
152263970Seric #ifndef ARBPTR_T
152363970Seric # define ARBPTR_T	void *
152463970Seric #endif
152563970Seric 
152660568Seric #ifndef __P
152760568Seric # include "cdefs.h"
152860568Seric #endif
152960568Seric 
153067421Seric #if NAMED_BIND
153167421Seric # include <arpa/nameser.h>
153267434Seric # ifdef __svr4__
153367434Seric #  ifdef NOERROR
153467434Seric #   undef NOERROR		/* avoid compiler conflict with stream.h */
153567434Seric #  endif
153667434Seric # endif
153767421Seric #endif
153867421Seric 
153956852Seric /*
154067419Seric **  The size of an IP address -- can't use sizeof because of problems
154167419Seric **  on Crays, where everything is 64 bits.  This will break if/when
154267419Seric **  IP addresses are expanded to eight bytes.
154367419Seric */
154467419Seric 
154567421Seric #ifndef INADDRSZ
154667421Seric # define INADDRSZ	4
154767421Seric #endif
154867419Seric 
154967419Seric /*
155067421Seric **  The size of various known types -- for reading network protocols.
155167421Seric **  Again, we can't use sizeof because of compiler randomness.
155267421Seric */
155367421Seric 
155467421Seric #ifndef INT16SZ
155567421Seric # define INT16SZ	2
155667421Seric #endif
155767421Seric #ifndef INT32SZ
155867421Seric # define INT32SZ	4
155967421Seric #endif
156067421Seric 
156167421Seric /*
156258778Seric **  Do some required dependencies
156358778Seric */
156458778Seric 
156558778Seric #if defined(NETINET) || defined(NETISO)
156659107Seric # define SMTP		1	/* enable user and server SMTP */
156759107Seric # define QUEUE		1	/* enable queueing */
156859107Seric # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
156958778Seric #endif
157058778Seric 
157158778Seric 
157258778Seric /*
157356852Seric **  Arrange to use either varargs or stdargs
157456852Seric */
157556852Seric 
157656852Seric # ifdef __STDC__
157756852Seric 
157856852Seric # include <stdarg.h>
157956852Seric 
158056852Seric # define VA_LOCAL_DECL	va_list ap;
158156852Seric # define VA_START(f)	va_start(ap, f)
158256852Seric # define VA_END		va_end(ap)
158356852Seric 
158456852Seric # else
158556852Seric 
158656852Seric # include <varargs.h>
158756852Seric 
158856852Seric # define VA_LOCAL_DECL	va_list ap;
158956852Seric # define VA_START(f)	va_start(ap)
159056852Seric # define VA_END		va_end(ap)
159156852Seric 
159256852Seric # endif
159357631Seric 
159457943Seric #ifdef HASUNAME
159557631Seric # include <sys/utsname.h>
159657631Seric # ifdef newstr
159757631Seric #  undef newstr
159857631Seric # endif
159957943Seric #else /* ! HASUNAME */
160057631Seric # define NODE_LENGTH 32
160157631Seric struct utsname
160257631Seric {
160357631Seric 	char nodename[NODE_LENGTH+1];
160457631Seric };
160557943Seric #endif /* HASUNAME */
160657642Seric 
160768040Seric #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
160863838Seric # define MAXHOSTNAMELEN	256
160957735Seric #endif
161058153Seric 
161158153Seric #if !defined(SIGCHLD) && defined(SIGCLD)
161258153Seric # define SIGCHLD	SIGCLD
161358153Seric #endif
161458153Seric 
161558153Seric #ifndef STDIN_FILENO
161668742Seric # define STDIN_FILENO	0
161758153Seric #endif
161858153Seric 
161958153Seric #ifndef STDOUT_FILENO
162068742Seric # define STDOUT_FILENO	1
162158153Seric #endif
162258153Seric 
162358153Seric #ifndef STDERR_FILENO
162468742Seric # define STDERR_FILENO	2
162558153Seric #endif
162658689Seric 
162764072Seric #ifndef LOCK_SH
162864035Seric # define LOCK_SH	0x01	/* shared lock */
162964035Seric # define LOCK_EX	0x02	/* exclusive lock */
163064035Seric # define LOCK_NB	0x04	/* non-blocking lock */
163164035Seric # define LOCK_UN	0x08	/* unlock */
163264035Seric #endif
163358692Seric 
163468742Seric #ifndef SEEK_SET
163568742Seric # define SEEK_SET	0
163668742Seric # define SEEK_CUR	1
163768742Seric # define SEEK_END	2
163868742Seric #endif
163968742Seric 
164064035Seric #ifndef SIG_ERR
164164035Seric # define SIG_ERR	((void (*)()) -1)
164258689Seric #endif
164358702Seric 
164464500Seric #ifndef WEXITSTATUS
164564500Seric # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
164664500Seric #endif
164764500Seric #ifndef WIFEXITED
164864500Seric # define WIFEXITED(st)		(((st) & 0377) == 0)
164964500Seric #endif
165064500Seric 
165164561Seric #ifndef SIGFUNC_DEFINED
165264561Seric typedef void		(*sigfunc_t) __P((int));
165364561Seric #endif
165464561Seric 
165565053Seric /* size of syslog buffer */
165665053Seric #ifndef SYSLOG_BUFSIZE
165765053Seric # define SYSLOG_BUFSIZE	1024
165865053Seric #endif
165965053Seric 
166058702Seric /*
166158702Seric **  Size of tobuf (deliver.c)
166258702Seric **	Tweak this to match your syslog implementation.  It will have to
166358702Seric **	allow for the extra information printed.
166458702Seric */
166558702Seric 
166658702Seric #ifndef TOBUFSIZE
166765053Seric # if (SYSLOG_BUFSIZE) > 512
166865053Seric #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
166965053Seric # else
167065053Seric #  define TOBUFSIZE	256
167165053Seric # endif
167258702Seric #endif
167360219Seric 
167465015Seric /*
167565015Seric **  Size of prescan buffer.
167665015Seric **	Despite comments in the _sendmail_ book, this probably should
167765015Seric **	not be changed; there are some hard-to-define dependencies.
167865015Seric */
167965015Seric 
168065015Seric # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
168160219Seric /* fork routine -- set above using #ifdef _osname_ or in Makefile */
168260219Seric # ifndef FORK
168360219Seric # define FORK		vfork		/* function to call to fork mailer */
168460219Seric # endif
168565955Seric 
168665955Seric /*
168765955Seric **  If we are going to link scanf anyway, use it in readcf
168865955Seric */
168965955Seric 
169065955Seric #if !defined(HASUNAME) && !defined(SCANF)
169165955Seric # define SCANF		1
169265955Seric #endif
1693