xref: /freebsd/contrib/sendmail/include/sm/conf.h (revision 13d882686343bf9a76ffdfa83854043d808703dd)
140266059SGregory Neil Shapiro /*
213d88268SGregory Neil Shapiro  * Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
340266059SGregory Neil Shapiro  *	All rights reserved.
440266059SGregory Neil Shapiro  * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
540266059SGregory Neil Shapiro  * Copyright (c) 1988, 1993
640266059SGregory Neil Shapiro  *	The Regents of the University of California.  All rights reserved.
740266059SGregory Neil Shapiro  *
840266059SGregory Neil Shapiro  * By using this file, you agree to the terms and conditions set
940266059SGregory Neil Shapiro  * forth in the LICENSE file which can be found at the top level of
1040266059SGregory Neil Shapiro  * the sendmail distribution.
1140266059SGregory Neil Shapiro  *
1240266059SGregory Neil Shapiro  *
1313d88268SGregory Neil Shapiro  *	$Id: conf.h,v 1.120 2005/03/22 22:07:53 ca Exp $
1440266059SGregory Neil Shapiro  */
1540266059SGregory Neil Shapiro 
1640266059SGregory Neil Shapiro /*
1740266059SGregory Neil Shapiro **  CONF.H -- All user-configurable parameters for sendmail
1840266059SGregory Neil Shapiro **
1940266059SGregory Neil Shapiro **	Send updates to sendmail@Sendmail.ORG so they will be
2040266059SGregory Neil Shapiro **	included in the next release.
2140266059SGregory Neil Shapiro */
2240266059SGregory Neil Shapiro 
2340266059SGregory Neil Shapiro #ifndef SM_CONF_H
2440266059SGregory Neil Shapiro # define SM_CONF_H 1
2540266059SGregory Neil Shapiro 
2640266059SGregory Neil Shapiro 
2740266059SGregory Neil Shapiro # include <sm/config.h>
2840266059SGregory Neil Shapiro # include <sm/varargs.h>
2940266059SGregory Neil Shapiro 
3040266059SGregory Neil Shapiro /*
3140266059SGregory Neil Shapiro **  General "standard C" defines.
3240266059SGregory Neil Shapiro **
3340266059SGregory Neil Shapiro **	These may be undone later, to cope with systems that claim to
3440266059SGregory Neil Shapiro **	be Standard C but aren't.  Gcc is the biggest offender -- it
3540266059SGregory Neil Shapiro **	doesn't realize that the library is part of the language.
3640266059SGregory Neil Shapiro **
3740266059SGregory Neil Shapiro **	Life would be much easier if we could get rid of this sort
3840266059SGregory Neil Shapiro **	of bozo problems.
3940266059SGregory Neil Shapiro */
4040266059SGregory Neil Shapiro 
4140266059SGregory Neil Shapiro # ifdef __STDC__
4240266059SGregory Neil Shapiro #  define HASSETVBUF	1	/* we have setvbuf(3) in libc */
4340266059SGregory Neil Shapiro # endif /* __STDC__ */
4440266059SGregory Neil Shapiro 
4540266059SGregory Neil Shapiro /*
4640266059SGregory Neil Shapiro **  Assume you have standard calls; can be #undefed below if necessary.
4740266059SGregory Neil Shapiro */
4840266059SGregory Neil Shapiro 
4940266059SGregory Neil Shapiro # ifndef HASLSTAT
5040266059SGregory Neil Shapiro #  define HASLSTAT	1	/* has lstat(2) call */
5140266059SGregory Neil Shapiro # endif /* ! HASLSTAT */
5240266059SGregory Neil Shapiro 
5340266059SGregory Neil Shapiro # ifndef HASNICE
5440266059SGregory Neil Shapiro #  define HASNICE	1	/* has nice(2) call */
5540266059SGregory Neil Shapiro # endif /* ! HASNICE */
5640266059SGregory Neil Shapiro 
5740266059SGregory Neil Shapiro # ifndef HASRRESVPORT
5840266059SGregory Neil Shapiro #  define HASRRESVPORT	1	/* has rrsevport(3) call */
5940266059SGregory Neil Shapiro # endif /* ! HASRRESVPORT */
6040266059SGregory Neil Shapiro 
6140266059SGregory Neil Shapiro /**********************************************************************
6240266059SGregory Neil Shapiro **  "Hard" compilation options.
6340266059SGregory Neil Shapiro **	#define these if they are available; comment them out otherwise.
6440266059SGregory Neil Shapiro **  These cannot be overridden from the Makefile, and should really not
6540266059SGregory Neil Shapiro **  be turned off unless absolutely necessary.
6640266059SGregory Neil Shapiro **********************************************************************/
6740266059SGregory Neil Shapiro 
6840266059SGregory Neil Shapiro #define LOG		1	/* enable logging -- don't turn off */
6940266059SGregory Neil Shapiro 
7040266059SGregory Neil Shapiro /**********************************************************************
7140266059SGregory Neil Shapiro **  Operating system configuration.
7240266059SGregory Neil Shapiro **
7340266059SGregory Neil Shapiro **	Unless you are porting to a new OS, you shouldn't have to
7440266059SGregory Neil Shapiro **	change these.
7540266059SGregory Neil Shapiro **********************************************************************/
7640266059SGregory Neil Shapiro 
7740266059SGregory Neil Shapiro /*
7840266059SGregory Neil Shapiro **  HP-UX -- tested for 8.07, 9.00, and 9.01.
7940266059SGregory Neil Shapiro **
8040266059SGregory Neil Shapiro **	If V4FS is defined, compile for HP-UX 10.0.
8140266059SGregory Neil Shapiro **	11.x support from Richard Allen <ra@hp.is>.
8240266059SGregory Neil Shapiro */
8340266059SGregory Neil Shapiro 
8440266059SGregory Neil Shapiro # ifdef __hpux
8540266059SGregory Neil Shapiro 		/* common definitions for HP-UX 9.x and 10.x */
8640266059SGregory Neil Shapiro #  undef m_flags		/* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */
8740266059SGregory Neil Shapiro #  define SYSTEM5	1	/* include all the System V defines */
8840266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
8940266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
9040266059SGregory Neil Shapiro #  define USESETEUID	1	/* has usable seteuid(2) call */
9140266059SGregory Neil Shapiro #  define HASSETRESGID	1	/* use setresgid(2) to set saved gid */
9240266059SGregory Neil Shapiro #  define BOGUS_O_EXCL	1	/* exclusive open follows symlinks */
9340266059SGregory Neil Shapiro #  define seteuid(e)	setresuid(-1, e, -1)
9440266059SGregory Neil Shapiro #  define IP_SRCROUTE	1	/* can check IP source routing */
9540266059SGregory Neil Shapiro #  define LA_TYPE	LA_HPUX
9640266059SGregory Neil Shapiro #  define SPT_TYPE	SPT_PSTAT
9740266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
9840266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
9940266059SGregory Neil Shapiro #  define LDA_USE_LOCKF	1
10040266059SGregory Neil Shapiro #  ifndef HASGETUSERSHELL
10140266059SGregory Neil Shapiro #   define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
10240266059SGregory Neil Shapiro #  endif /* ! HASGETUSERSHELL */
10340266059SGregory Neil Shapiro #  ifdef HPUX10
10440266059SGregory Neil Shapiro #   define _PATH_SENDMAIL	"/usr/sbin/sendmail"
105a7ec597cSGregory Neil Shapiro #   ifndef SMRSH_CMDDIR
10640266059SGregory Neil Shapiro #    define SMRSH_CMDDIR	"/var/adm/sm.bin"
107a7ec597cSGregory Neil Shapiro #   endif /* ! SMRSH_CMDDIR */
10840266059SGregory Neil Shapiro #  endif /* HPUX10 */
10940266059SGregory Neil Shapiro #  ifdef HPUX11
110605302a5SGregory Neil Shapiro #   define HASSETREUID	1	/* setreuid(2) works on HP-UX 11.x */
11140266059SGregory Neil Shapiro #   define HASFCHOWN	1	/* has fchown(2) */
11240266059SGregory Neil Shapiro #   ifndef BROKEN_RES_SEARCH
11340266059SGregory Neil Shapiro #    define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
11440266059SGregory Neil Shapiro #   endif /* ! BROKEN_RES_SEARCH */
115a7ec597cSGregory Neil Shapiro #   ifndef SMRSH_CMDDIR
11640266059SGregory Neil Shapiro #    define SMRSH_CMDDIR	"/var/adm/sm.bin"
117a7ec597cSGregory Neil Shapiro #   endif /* ! SMRSH_CMDDIR */
11840266059SGregory Neil Shapiro #   define _PATH_SENDMAIL	"/usr/sbin/sendmail"
11940266059SGregory Neil Shapiro #  else /* HPUX11 */
12040266059SGregory Neil Shapiro #   ifndef NOT_SENDMAIL
12140266059SGregory Neil Shapiro #    define syslog	hard_syslog
12240266059SGregory Neil Shapiro #   endif /* ! NOT_SENDMAIL */
12340266059SGregory Neil Shapiro #  endif /* HPUX11 */
12440266059SGregory Neil Shapiro #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
12540266059SGregory Neil Shapiro 
12640266059SGregory Neil Shapiro #  ifdef V4FS
12740266059SGregory Neil Shapiro 		/* HP-UX 10.x */
12840266059SGregory Neil Shapiro #   define _PATH_UNIX		"/stand/vmunix"
12940266059SGregory Neil Shapiro #   ifndef _PATH_VENDOR_CF
13040266059SGregory Neil Shapiro #    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
13140266059SGregory Neil Shapiro #   endif /* ! _PATH_VENDOR_CF */
13240266059SGregory Neil Shapiro #   ifndef _PATH_SENDMAILPID
13340266059SGregory Neil Shapiro #    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
13440266059SGregory Neil Shapiro #   endif /* ! _PATH_SENDMAILPID */
13540266059SGregory Neil Shapiro #   ifndef IDENTPROTO
13640266059SGregory Neil Shapiro #    define IDENTPROTO	1	/* TCP/IP implementation fixed in 10.0 */
13740266059SGregory Neil Shapiro #   endif /* ! IDENTPROTO */
13840266059SGregory Neil Shapiro #   include <sys/mpctl.h>	/* for mpctl() in get_num_procs_online() */
13940266059SGregory Neil Shapiro #  else /* V4FS */
14040266059SGregory Neil Shapiro 		/* HP-UX 9.x */
14140266059SGregory Neil Shapiro #   define _PATH_UNIX		"/hp-ux"
14240266059SGregory Neil Shapiro #   ifndef _PATH_VENDOR_CF
14340266059SGregory Neil Shapiro #    define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
14440266059SGregory Neil Shapiro #   endif /* ! _PATH_VENDOR_CF */
14540266059SGregory Neil Shapiro #   ifndef IDENTPROTO
14640266059SGregory Neil Shapiro #    define IDENTPROTO	0	/* TCP/IP implementation is broken */
14740266059SGregory Neil Shapiro #   endif /* ! IDENTPROTO */
14840266059SGregory Neil Shapiro #   ifdef __STDC__
14940266059SGregory Neil Shapiro extern void	hard_syslog(int, char *, ...);
15040266059SGregory Neil Shapiro #   else /* __STDC__ */
15140266059SGregory Neil Shapiro extern void	hard_syslog();
15240266059SGregory Neil Shapiro #   endif /* __STDC__ */
15340266059SGregory Neil Shapiro #   define FDSET_CAST	(int *)	/* cast for fd_set parameters to select */
15440266059SGregory Neil Shapiro #  endif /* V4FS */
15540266059SGregory Neil Shapiro 
15640266059SGregory Neil Shapiro # endif /* __hpux */
15740266059SGregory Neil Shapiro 
15840266059SGregory Neil Shapiro /*
15940266059SGregory Neil Shapiro **  IBM AIX 5.x
16040266059SGregory Neil Shapiro */
16140266059SGregory Neil Shapiro 
16240266059SGregory Neil Shapiro # ifdef _AIX5
16340266059SGregory Neil Shapiro #  define _AIX4		40300
16413d88268SGregory Neil Shapiro #  define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */
16513d88268SGregory Neil Shapiro #  define SOCKOPT_LEN_T	socklen_t /* arg#5 to getsockopt */
166a7ec597cSGregory Neil Shapiro #  if _AIX5 >= 50200
167a7ec597cSGregory Neil Shapiro #   define HASUNSETENV	1	/* has unsetenv(3) call */
168a7ec597cSGregory Neil Shapiro #  endif /* _AIX5 >= 50200 */
16940266059SGregory Neil Shapiro # endif /* _AIX5 */
17040266059SGregory Neil Shapiro 
17140266059SGregory Neil Shapiro /*
17240266059SGregory Neil Shapiro **  IBM AIX 4.x
17340266059SGregory Neil Shapiro */
17440266059SGregory Neil Shapiro 
17540266059SGregory Neil Shapiro # ifdef _AIX4
17640266059SGregory Neil Shapiro #  define _AIX3		1	/* pull in AIX3 stuff */
17740266059SGregory Neil Shapiro #  define BSD4_4_SOCKADDR	/* has sa_len */
17840266059SGregory Neil Shapiro #  define USESETEUID	1	/* seteuid(2) works */
17940266059SGregory Neil Shapiro #  define TZ_TYPE	TZ_NAME	/* use tzname[] vector */
18013d88268SGregory Neil Shapiro #  ifndef SOCKOPT_LEN_T
18140266059SGregory Neil Shapiro #   define SOCKOPT_LEN_T	size_t	/* arg#5 to getsockopt */
18213d88268SGregory Neil Shapiro #  endif /* SOCKOPT_LEN_T */
18340266059SGregory Neil Shapiro #  if _AIX4 >= 40200
18440266059SGregory Neil Shapiro #   define HASSETREUID	1	/* setreuid(2) works as of AIX 4.2 */
18513d88268SGregory Neil Shapiro #   ifndef SOCKADDR_LEN_T
18640266059SGregory Neil Shapiro #    define SOCKADDR_LEN_T	size_t	/* e.g., arg#3 to accept, getsockname */
18713d88268SGregory Neil Shapiro #   endif /* SOCKADDR_LEN_T */
18840266059SGregory Neil Shapiro #  endif /* _AIX4 >= 40200 */
18940266059SGregory Neil Shapiro #  if defined(_ILS_MACROS)	/* IBM versions aren't side-effect clean */
19040266059SGregory Neil Shapiro #   undef isascii
19140266059SGregory Neil Shapiro #   define isascii(c)		!(c & ~0177)
19240266059SGregory Neil Shapiro #   undef isdigit
19340266059SGregory Neil Shapiro #   define isdigit(__a)		(_IS(__a,_ISDIGIT))
19440266059SGregory Neil Shapiro #   undef isspace
19540266059SGregory Neil Shapiro #   define isspace(__a)		(_IS(__a,_ISSPACE))
19640266059SGregory Neil Shapiro #  endif /* defined(_ILS_MACROS) */
19740266059SGregory Neil Shapiro # endif /* _AIX4 */
19840266059SGregory Neil Shapiro 
19940266059SGregory Neil Shapiro 
20040266059SGregory Neil Shapiro /*
20140266059SGregory Neil Shapiro **  IBM AIX 3.x -- actually tested for 3.2.3
20240266059SGregory Neil Shapiro */
20340266059SGregory Neil Shapiro 
20440266059SGregory Neil Shapiro # ifdef _AIX3
20540266059SGregory Neil Shapiro #  include <paths.h>
20640266059SGregory Neil Shapiro #  include <sys/machine.h>	/* to get byte order */
20740266059SGregory Neil Shapiro #  include <sys/select.h>
20840266059SGregory Neil Shapiro #  define HASFCHOWN	1	/* has fchown(2) */
20940266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
21040266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
21140266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
21240266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
21340266059SGregory Neil Shapiro #  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
21440266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
21540266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
21640266059SGregory Neil Shapiro #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
21713d88268SGregory Neil Shapiro #  ifndef LA_TYPE
21840266059SGregory Neil Shapiro #   define LA_TYPE	LA_INT
21913d88268SGregory Neil Shapiro #  endif /* LA_TYPE */
22040266059SGregory Neil Shapiro #  define FSHIFT	16
22140266059SGregory Neil Shapiro #  define LA_AVENRUN	"avenrun"
22240266059SGregory Neil Shapiro #  if !defined(_AIX4) || _AIX4 < 40300
22340266059SGregory Neil Shapiro #   ifndef __BIT_TYPES_DEFINED__
22440266059SGregory Neil Shapiro #    define SM_INT32	int
22540266059SGregory Neil Shapiro #   endif /* __BIT_TYPES_DEFINED__ */
22640266059SGregory Neil Shapiro #  endif /* !defined(_AIX4) || _AIX4 < 40300 */
22740266059SGregory Neil Shapiro #  if !defined(_AIX4) || _AIX4 < 40200
22840266059SGregory Neil Shapiro #   define SM_CONF_SYSLOG	0
22940266059SGregory Neil Shapiro #  endif /* !defined(_AIX4) || _AIX4 < 40200 */
23040266059SGregory Neil Shapiro # endif /* _AIX3 */
23140266059SGregory Neil Shapiro 
23240266059SGregory Neil Shapiro 
23340266059SGregory Neil Shapiro /*
23440266059SGregory Neil Shapiro **  IBM AIX 2.2.1 -- actually tested for osupdate level 2706+1773
23540266059SGregory Neil Shapiro **
23640266059SGregory Neil Shapiro **	From Mark Whetzel <markw@wg.waii.com>.
23740266059SGregory Neil Shapiro */
23840266059SGregory Neil Shapiro 
23940266059SGregory Neil Shapiro # ifdef AIX			/* AIX/RT compiler pre-defines this */
24040266059SGregory Neil Shapiro #  include <paths.h>
24140266059SGregory Neil Shapiro #  include <sys/time.h>		/* AIX/RT resource.h does NOT include this */
24240266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
24340266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
24440266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
24540266059SGregory Neil Shapiro #  define HASFCHMOD	0	/* does not have fchmod(2) syscall */
24640266059SGregory Neil Shapiro #  define HASSETREUID	1	/* use setreuid(2) -lbsd system call */
24740266059SGregory Neil Shapiro #  define HASSETVBUF	1	/* use setvbuf(2) system call */
24840266059SGregory Neil Shapiro #  define HASSETRLIMIT	0	/* does not have setrlimit call */
24940266059SGregory Neil Shapiro #  define HASFLOCK	0	/* does not have flock call - use fcntl */
25040266059SGregory Neil Shapiro #  define HASULIMIT	1	/* use ulimit instead of setrlimit call */
25140266059SGregory Neil Shapiro #  define SM_CONF_GETOPT	0	/* Do we need theirs or ours */
25240266059SGregory Neil Shapiro #  define SYS5SETPGRP	1	/* don't have setpgid on AIX/RT */
25340266059SGregory Neil Shapiro #  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
25440266059SGregory Neil Shapiro #  define BSD4_3		1	/* NOT bsd 4.4 or posix signals */
25540266059SGregory Neil Shapiro #  define GIDSET_T	int
25640266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
25740266059SGregory Neil Shapiro #  define SPT_PADCHAR	'\0'		/* pad process title with nulls */
25840266059SGregory Neil Shapiro #  define LA_TYPE	LA_SUBR		/* use our ported loadavgd daemon */
25940266059SGregory Neil Shapiro #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
26040266059SGregory Neil Shapiro #  define ARBPTR_T	int *
26140266059SGregory Neil Shapiro #  define void		int
26240266059SGregory Neil Shapiro typedef int		pid_t;
26340266059SGregory Neil Shapiro /* RTisms for BSD compatibility, specified in the Makefile
26440266059SGregory Neil Shapiro   define BSD		1
26540266059SGregory Neil Shapiro   define BSD_INCLUDES		1
26640266059SGregory Neil Shapiro   define BSD_REMAP_SIGNAL_TO_SIGVEC
26740266059SGregory Neil Shapiro     RTisms needed above */
26840266059SGregory Neil Shapiro /* make this sendmail in a completely different place */
26940266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
27040266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/local/newmail/sendmail.cf"
27140266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
27240266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
27340266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/usr/local/newmail/sendmail.pid"
27440266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
27540266059SGregory Neil Shapiro # endif /* AIX */
27640266059SGregory Neil Shapiro 
27740266059SGregory Neil Shapiro # if defined(_AIX)
27840266059SGregory Neil Shapiro #  define LDA_USE_LOCKF		1
27940266059SGregory Neil Shapiro #  define LDA_USE_SETEUID	1
28040266059SGregory Neil Shapiro # endif /* defined(_AIX) */
28140266059SGregory Neil Shapiro 
28240266059SGregory Neil Shapiro /*
28340266059SGregory Neil Shapiro **  Silicon Graphics IRIX
28440266059SGregory Neil Shapiro **
28540266059SGregory Neil Shapiro **	Compiles on 4.0.1.
28640266059SGregory Neil Shapiro **
28740266059SGregory Neil Shapiro **	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
28840266059SGregory Neil Shapiro **	Use IRIX5 instead of IRIX for IRIX 5.x.
28940266059SGregory Neil Shapiro **
29040266059SGregory Neil Shapiro **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
29140266059SGregory Neil Shapiro **	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
29240266059SGregory Neil Shapiro */
29340266059SGregory Neil Shapiro 
29440266059SGregory Neil Shapiro # ifdef IRIX
29540266059SGregory Neil Shapiro #  define SYSTEM5	1	/* this is a System-V derived system */
29640266059SGregory Neil Shapiro #  define HASSETREUID	1	/* has setreuid(2) call */
29740266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
29840266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
29940266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
30040266059SGregory Neil Shapiro #  define IP_SRCROUTE	1	/* can check IP source routing */
30140266059SGregory Neil Shapiro #  define setpgid	BSDsetpgrp
30240266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
30340266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
30440266059SGregory Neil Shapiro #  define SFS_BAVAIL	f_bfree		/* alternate field name */
30540266059SGregory Neil Shapiro #  define SYSLOG_BUFSIZE 512
30613bd1963SGregory Neil Shapiro #  if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
30713bd1963SGregory Neil Shapiro     /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */
30813bd1963SGregory Neil Shapiro #   define _SC_NPROCESSORS_ONLN	_SC_NPROC_ONLN
30913bd1963SGregory Neil Shapiro #  endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */
31040266059SGregory Neil Shapiro #  ifdef IRIX6
31140266059SGregory Neil Shapiro #   define STAT64	1
31240266059SGregory Neil Shapiro #   define QUAD_T	unsigned long long
31340266059SGregory Neil Shapiro #   define LA_TYPE	LA_IRIX6	/* figure out at run time */
31440266059SGregory Neil Shapiro #   define SAFENFSPATHCONF 0	/* pathconf(2) lies on NFS filesystems */
31540266059SGregory Neil Shapiro #  else /* IRIX6 */
31640266059SGregory Neil Shapiro #   define LA_TYPE	LA_INT
31740266059SGregory Neil Shapiro 
31840266059SGregory Neil Shapiro #   ifdef IRIX64
31940266059SGregory Neil Shapiro #    define STAT64	1
32040266059SGregory Neil Shapiro #    define QUAD_T	unsigned long long
32140266059SGregory Neil Shapiro #    define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
32240266059SGregory Neil Shapiro #   else /* IRIX64 */
32340266059SGregory Neil Shapiro #    define STAT64	0
32440266059SGregory Neil Shapiro #    define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
32540266059SGregory Neil Shapiro #   endif /* IRIX64 */
32640266059SGregory Neil Shapiro #  endif /* IRIX6 */
32740266059SGregory Neil Shapiro #  if defined(IRIX64) || defined(IRIX5) || defined(IRIX6)
32840266059SGregory Neil Shapiro #   include <sys/cdefs.h>
32940266059SGregory Neil Shapiro #   include <paths.h>
33040266059SGregory Neil Shapiro #   define ARGV_T	char *const *
33140266059SGregory Neil Shapiro #   define HASFCHOWN	1	/* has fchown(2) */
33240266059SGregory Neil Shapiro #   define HASSETRLIMIT	1	/* has setrlimit(2) syscall */
33340266059SGregory Neil Shapiro #   define HASGETDTABLESIZE 1	/* has getdtablesize(2) syscall */
33440266059SGregory Neil Shapiro #   define HASSTRERROR	1	/* has strerror(3) */
33540266059SGregory Neil Shapiro #  else /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
33640266059SGregory Neil Shapiro #   define ARGV_T	const char **
33740266059SGregory Neil Shapiro #   define WAITUNION	1	/* use "union wait" as wait argument type */
33840266059SGregory Neil Shapiro #  endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
33940266059SGregory Neil Shapiro # endif /* IRIX */
34040266059SGregory Neil Shapiro 
34140266059SGregory Neil Shapiro 
34240266059SGregory Neil Shapiro /*
34340266059SGregory Neil Shapiro **  SunOS and Solaris
34440266059SGregory Neil Shapiro **
34540266059SGregory Neil Shapiro **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
34640266059SGregory Neil Shapiro **	Solaris 2.4 (a.k.a. SunOS 5.4).
34740266059SGregory Neil Shapiro */
34840266059SGregory Neil Shapiro 
34940266059SGregory Neil Shapiro # if defined(sun) && !defined(BSD)
35040266059SGregory Neil Shapiro 
35140266059SGregory Neil Shapiro #  include <sys/time.h>
35240266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
35340266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
35440266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
35540266059SGregory Neil Shapiro #  define IP_SRCROUTE	1	/* can check IP source routing */
35640266059SGregory Neil Shapiro #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
35740266059SGregory Neil Shapiro #  ifndef HASFCHOWN
35840266059SGregory Neil Shapiro #   define HASFCHOWN	1	/* fchown(2) */
35940266059SGregory Neil Shapiro #  endif /* ! HASFCHOWN */
36040266059SGregory Neil Shapiro 
36140266059SGregory Neil Shapiro #  ifdef __svr4__
36240266059SGregory Neil Shapiro #   define LDA_USE_LOCKF		1
36340266059SGregory Neil Shapiro #   define LDA_USE_SETEUID	1
36440266059SGregory Neil Shapiro #   define _PATH_MAILDIR		"/var/mail"
36540266059SGregory Neil Shapiro #  endif /* __svr4__ */
36640266059SGregory Neil Shapiro 
36740266059SGregory Neil Shapiro #  ifdef SOLARIS_2_3
36840266059SGregory Neil Shapiro #   define SOLARIS	20300	/* for back compat only -- use -DSOLARIS=20300 */
36940266059SGregory Neil Shapiro #  endif /* SOLARIS_2_3 */
37040266059SGregory Neil Shapiro 
37140266059SGregory Neil Shapiro #  if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4))
37240266059SGregory Neil Shapiro #   define SOLARIS	1	/* unknown Solaris version */
37340266059SGregory Neil Shapiro #  endif /* defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) */
37440266059SGregory Neil Shapiro 
37540266059SGregory Neil Shapiro #  ifdef SOLARIS
37640266059SGregory Neil Shapiro 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
37740266059SGregory Neil Shapiro #   ifndef __svr4__
37840266059SGregory Neil Shapiro #    define __svr4__		/* use all System V Release 4 defines below */
37940266059SGregory Neil Shapiro #   endif /* ! __svr4__ */
38040266059SGregory Neil Shapiro #   define GIDSET_T	gid_t
38140266059SGregory Neil Shapiro #   define USE_SA_SIGACTION	1	/* use sa_sigaction field */
38240266059SGregory Neil Shapiro #   define BROKEN_PTHREAD_SLEEP	1	/* sleep after pthread_create() fails */
38340266059SGregory Neil Shapiro #   define HASSTRERROR	1	/* has strerror(3) */
38440266059SGregory Neil Shapiro #   ifndef _PATH_UNIX
38540266059SGregory Neil Shapiro #    define _PATH_UNIX		"/dev/ksyms"
38640266059SGregory Neil Shapiro #   endif /* ! _PATH_UNIX */
38740266059SGregory Neil Shapiro #   ifndef _PATH_VENDOR_CF
38840266059SGregory Neil Shapiro #    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
38940266059SGregory Neil Shapiro #   endif /* ! _PATH_VENDOR_CF */
39040266059SGregory Neil Shapiro #   ifndef _PATH_SENDMAILPID
39140266059SGregory Neil Shapiro #    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
39240266059SGregory Neil Shapiro #   endif /* ! _PATH_SENDMAILPID */
39340266059SGregory Neil Shapiro #   ifndef _PATH_HOSTS
39440266059SGregory Neil Shapiro #    define _PATH_HOSTS		"/etc/inet/hosts"
39540266059SGregory Neil Shapiro #   endif /* ! _PATH_HOSTS */
39640266059SGregory Neil Shapiro #   ifndef SYSLOG_BUFSIZE
39740266059SGregory Neil Shapiro #    define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
39840266059SGregory Neil Shapiro #   endif /* ! SYSLOG_BUFSIZE */
39940266059SGregory Neil Shapiro #   ifndef TZ_TYPE
40040266059SGregory Neil Shapiro #    define TZ_TYPE	TZ_TZNAME
40140266059SGregory Neil Shapiro #   endif /* ! TZ_TYPE */
40240266059SGregory Neil Shapiro #   if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203)
40340266059SGregory Neil Shapiro #    define USESETEUID		1	/* seteuid works as of 2.3 */
40440266059SGregory Neil Shapiro #    define LDA_CONTENTLENGTH	1	/* Needs the Content-Length header */
40540266059SGregory Neil Shapiro #   endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */
40640266059SGregory Neil Shapiro #   if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205)
40740266059SGregory Neil Shapiro #    define HASSETREUID	1		/* setreuid works as of 2.5 */
40840266059SGregory Neil Shapiro #    define HASSETREGID	1	/* use setregid(2) to set saved gid */
40940266059SGregory Neil Shapiro #    if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700)
41040266059SGregory Neil Shapiro #     ifndef LA_TYPE
41140266059SGregory Neil Shapiro #      define LA_TYPE	LA_KSTAT	/* use kstat(3k) -- may work in < 2.5 */
41240266059SGregory Neil Shapiro #     endif /* ! LA_TYPE */
41340266059SGregory Neil Shapiro #     ifndef RANDOMSHIFT		/* random() doesn't work well (sometimes) */
41440266059SGregory Neil Shapiro #      define RANDOMSHIFT	8
41540266059SGregory Neil Shapiro #     endif /* ! RANDOMSHIFT */
41640266059SGregory Neil Shapiro #    endif /* SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) */
41740266059SGregory Neil Shapiro #   else /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */
41840266059SGregory Neil Shapiro #    ifndef HASRANDOM
41940266059SGregory Neil Shapiro #     define HASRANDOM	0		/* doesn't have random(3) */
42040266059SGregory Neil Shapiro #    endif /* ! HASRANDOM */
42140266059SGregory Neil Shapiro #   endif /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */
42240266059SGregory Neil Shapiro #   if (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206
42340266059SGregory Neil Shapiro #    define SM_INT32	int	/* 32bit integer */
42440266059SGregory Neil Shapiro #   endif /* (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206 */
42540266059SGregory Neil Shapiro #   if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207)
42640266059SGregory Neil Shapiro #    ifndef LA_TYPE
42740266059SGregory Neil Shapiro #     include <sys/loadavg.h>
42840266059SGregory Neil Shapiro #     if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
42940266059SGregory Neil Shapiro #      include <sys/pset.h>
43040266059SGregory Neil Shapiro #      define LA_TYPE	LA_PSET	/* pset_getloadavg(3c) appears in 2.9 */
43140266059SGregory Neil Shapiro #     else /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
43240266059SGregory Neil Shapiro #      define LA_TYPE	LA_SUBR	/* getloadavg(3c) appears in 2.7 */
43340266059SGregory Neil Shapiro #     endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
43440266059SGregory Neil Shapiro #    endif /* ! LA_TYPE */
43540266059SGregory Neil Shapiro #    define HASGETUSERSHELL 1	/* getusershell(3c) bug fixed in 2.7 */
43640266059SGregory Neil Shapiro #   endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */
43740266059SGregory Neil Shapiro #   if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208)
43840266059SGregory Neil Shapiro #    undef _PATH_SENDMAILPID	/* tmpfs /var/run added in 2.8 */
43940266059SGregory Neil Shapiro #    define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
440a7ec597cSGregory Neil Shapiro #    ifndef SMRSH_CMDDIR
44140266059SGregory Neil Shapiro #     define SMRSH_CMDDIR	"/var/adm/sm.bin"
442a7ec597cSGregory Neil Shapiro #    endif /* ! SMRSH_CMDDIR */
44340266059SGregory Neil Shapiro #    define SL_FUDGE	34	/* fudge offset for SyslogPrefixLen */
44440266059SGregory Neil Shapiro #   endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */
44540266059SGregory Neil Shapiro #   if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
44640266059SGregory Neil Shapiro #    define HASURANDOMDEV	1	/* /dev/[u]random added in S9 */
447e92d3f3fSGregory Neil Shapiro #    define HASCLOSEFROM	1	/* closefrom(3c) added in S9 */
448e92d3f3fSGregory Neil Shapiro #    define HASFDWALK		1	/* fdwalk(3c) added in S9 */
44940266059SGregory Neil Shapiro #   endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
450323f6dcbSGregory Neil Shapiro #   if SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210)
451323f6dcbSGregory Neil Shapiro #    define HASUNSETENV 1       /* unsetenv() added in S10 */
452323f6dcbSGregory Neil Shapiro #   endif /* SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) */
45340266059SGregory Neil Shapiro #   ifndef HASGETUSERSHELL
45440266059SGregory Neil Shapiro #    define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps pre-2.7 */
45540266059SGregory Neil Shapiro #   endif /* ! HASGETUSERSHELL */
45640266059SGregory Neil Shapiro 
45740266059SGregory Neil Shapiro #  else /* SOLARIS */
45840266059SGregory Neil Shapiro 			/* SunOS 4.0.3 or 4.1.x */
45940266059SGregory Neil Shapiro #   define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
46040266059SGregory Neil Shapiro #   define HASSETREUID	1	/* has setreuid(2) call */
46140266059SGregory Neil Shapiro #   ifndef HASFLOCK
46240266059SGregory Neil Shapiro #    define HASFLOCK	1	/* has flock(2) call */
46340266059SGregory Neil Shapiro #   endif /* ! HASFLOCK */
46440266059SGregory Neil Shapiro #   define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
46540266059SGregory Neil Shapiro #   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
46640266059SGregory Neil Shapiro #   include <memory.h>
46740266059SGregory Neil Shapiro #   include <vfork.h>
46840266059SGregory Neil Shapiro #   ifdef __GNUC__
46940266059SGregory Neil Shapiro #    define strtoul	strtol	/* gcc library bogosity */
47040266059SGregory Neil Shapiro #   endif /* __GNUC__ */
47140266059SGregory Neil Shapiro #   define memmove(d, s, l)	(bcopy((s), (d), (l)))
47240266059SGregory Neil Shapiro #   define atexit(f)	on_exit((f), 0)	/* ugly hack for SunOS */
47340266059SGregory Neil Shapiro #   define SM_INT32	int	/* 32bit integer */
47440266059SGregory Neil Shapiro #   define SM_ALIGN_SIZE (sizeof(long))
47540266059SGregory Neil Shapiro #   define GIDSET_T	int
47640266059SGregory Neil Shapiro #   define SM_CONF_SYSLOG	0
47740266059SGregory Neil Shapiro 
47840266059SGregory Neil Shapiro #   ifdef SUNOS403
47940266059SGregory Neil Shapiro 			/* special tweaking for SunOS 4.0.3 */
48040266059SGregory Neil Shapiro #    include <malloc.h>
48140266059SGregory Neil Shapiro #    define BSD4_3	1	/* 4.3 BSD-based */
48240266059SGregory Neil Shapiro #    define NEEDSTRSTR	1	/* need emulation of strstr(3) routine */
48340266059SGregory Neil Shapiro #    define WAITUNION	1	/* use "union wait" as wait argument type */
48440266059SGregory Neil Shapiro #    undef WIFEXITED
48540266059SGregory Neil Shapiro #    undef WEXITSTATUS
48640266059SGregory Neil Shapiro #    undef HASUNAME
48740266059SGregory Neil Shapiro #    define setpgid	setpgrp
48840266059SGregory Neil Shapiro #    define MODE_T	int
48940266059SGregory Neil Shapiro typedef int		pid_t;
49040266059SGregory Neil Shapiro extern char		*getenv();
49140266059SGregory Neil Shapiro 
49240266059SGregory Neil Shapiro #   else /* SUNOS403 */
49340266059SGregory Neil Shapiro 			/* 4.1.x specifics */
494e92d3f3fSGregory Neil Shapiro #    define HASSETSID	1	/* has POSIX setsid(2) call */
49540266059SGregory Neil Shapiro #    define HASSETVBUF	1	/* we have setvbuf(3) in libc */
49640266059SGregory Neil Shapiro 
49740266059SGregory Neil Shapiro #   endif /* SUNOS403 */
49840266059SGregory Neil Shapiro #  endif /* SOLARIS */
49940266059SGregory Neil Shapiro 
50040266059SGregory Neil Shapiro #  ifndef LA_TYPE
50140266059SGregory Neil Shapiro #   define LA_TYPE	LA_INT
50240266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
50340266059SGregory Neil Shapiro 
50440266059SGregory Neil Shapiro # endif /* defined(sun) && !defined(BSD) */
50540266059SGregory Neil Shapiro 
50640266059SGregory Neil Shapiro /*
50740266059SGregory Neil Shapiro **  DG/UX
50840266059SGregory Neil Shapiro **
50940266059SGregory Neil Shapiro **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
51040266059SGregory Neil Shapiro **	older support.
51140266059SGregory Neil Shapiro **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
51240266059SGregory Neil Shapiro */
51340266059SGregory Neil Shapiro 
51440266059SGregory Neil Shapiro # ifdef DGUX_5_4_2
51540266059SGregory Neil Shapiro #  define DGUX		1
51640266059SGregory Neil Shapiro # endif /* DGUX_5_4_2 */
51740266059SGregory Neil Shapiro 
51840266059SGregory Neil Shapiro # ifdef DGUX
51940266059SGregory Neil Shapiro #  define SYSTEM5	1
52040266059SGregory Neil Shapiro #  define LA_TYPE	LA_DGUX
52140266059SGregory Neil Shapiro #  define HASSETREUID	1	/* has setreuid(2) call */
52240266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
523e92d3f3fSGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
52440266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
52540266059SGregory Neil Shapiro #  define IP_SRCROUTE	0	/* does not have <netinet/ip_var.h> */
52640266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0	/* does not have getusershell(3) */
52740266059SGregory Neil Shapiro #  ifndef IDENTPROTO
52840266059SGregory Neil Shapiro #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
52940266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
53040266059SGregory Neil Shapiro #  define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
53140266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
53240266059SGregory Neil Shapiro #  define LDA_USE_LOCKF		1
53340266059SGregory Neil Shapiro 
53440266059SGregory Neil Shapiro /* these include files must be included early on DG/UX */
53540266059SGregory Neil Shapiro #  include <netinet/in.h>
53640266059SGregory Neil Shapiro #  include <arpa/inet.h>
53740266059SGregory Neil Shapiro 
53840266059SGregory Neil Shapiro /* compiler doesn't understand const? */
53940266059SGregory Neil Shapiro #  define const
54040266059SGregory Neil Shapiro 
54140266059SGregory Neil Shapiro #  ifdef DGUX_5_4_2
54240266059SGregory Neil Shapiro #   define inet_addr	dgux_inet_addr
54340266059SGregory Neil Shapiro extern long	dgux_inet_addr();
54440266059SGregory Neil Shapiro #  endif /* DGUX_5_4_2 */
54540266059SGregory Neil Shapiro # endif /* DGUX */
54640266059SGregory Neil Shapiro 
54740266059SGregory Neil Shapiro 
54840266059SGregory Neil Shapiro /*
54940266059SGregory Neil Shapiro **  Digital Ultrix 4.2 - 4.5
55040266059SGregory Neil Shapiro **
55140266059SGregory Neil Shapiro **	Apparently, fcntl locking is broken on 4.2A, in that locks are
55240266059SGregory Neil Shapiro **	not dropped when the process exits.  This causes major problems,
55340266059SGregory Neil Shapiro **	so flock is the only alternative.
55440266059SGregory Neil Shapiro */
55540266059SGregory Neil Shapiro 
55640266059SGregory Neil Shapiro # ifdef ultrix
55740266059SGregory Neil Shapiro #  define HASSETREUID	1	/* has setreuid(2) call */
55840266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(3) call */
55940266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
56040266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
56140266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
56240266059SGregory Neil Shapiro #  define HASFCHOWN	1	/* has fchown(2) syscall */
56340266059SGregory Neil Shapiro #  ifndef HASFLOCK
56440266059SGregory Neil Shapiro #   define HASFLOCK	1	/* has flock(2) call */
56540266059SGregory Neil Shapiro #  endif /* ! HASFLOCK */
56640266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
56740266059SGregory Neil Shapiro #  ifndef BROKEN_RES_SEARCH
56840266059SGregory Neil Shapiro #   define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
56940266059SGregory Neil Shapiro #  endif /* ! BROKEN_RES_SEARCH */
57040266059SGregory Neil Shapiro #  if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621
57140266059SGregory Neil Shapiro #   define NEEDLOCAL_HOSTNAME_LENGTH	1	/* see sendmail/README */
57240266059SGregory Neil Shapiro #  endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */
57340266059SGregory Neil Shapiro #  ifdef vax
57440266059SGregory Neil Shapiro #   define LA_TYPE	LA_FLOAT
57540266059SGregory Neil Shapiro #  else /* vax */
57640266059SGregory Neil Shapiro #   define LA_TYPE	LA_INT
57740266059SGregory Neil Shapiro #   define LA_AVENRUN	"avenrun"
57840266059SGregory Neil Shapiro #  endif /* vax */
57940266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
58040266059SGregory Neil Shapiro #  ifndef IDENTPROTO
58140266059SGregory Neil Shapiro #   define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
58240266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
58340266059SGregory Neil Shapiro #  define SYSLOG_BUFSIZE	256
58440266059SGregory Neil Shapiro #  define SM_CONF_SYSLOG	0
58540266059SGregory Neil Shapiro # endif /* ultrix */
58640266059SGregory Neil Shapiro 
58740266059SGregory Neil Shapiro 
58840266059SGregory Neil Shapiro /*
58940266059SGregory Neil Shapiro **  OSF/1 for KSR.
59040266059SGregory Neil Shapiro **
59140266059SGregory Neil Shapiro **	Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu>
59240266059SGregory Neil Shapiro */
59340266059SGregory Neil Shapiro 
59440266059SGregory Neil Shapiro # ifdef __ksr__
59540266059SGregory Neil Shapiro #  define __osf__	1	/* get OSF/1 defines below */
59640266059SGregory Neil Shapiro #  ifndef TZ_TYPE
59740266059SGregory Neil Shapiro #   define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
59840266059SGregory Neil Shapiro #  endif /* ! TZ_TYPE */
59940266059SGregory Neil Shapiro # endif /* __ksr__ */
60040266059SGregory Neil Shapiro 
60140266059SGregory Neil Shapiro 
60240266059SGregory Neil Shapiro /*
60340266059SGregory Neil Shapiro **  OSF/1 for Intel Paragon.
60440266059SGregory Neil Shapiro **
60540266059SGregory Neil Shapiro **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
60640266059SGregory Neil Shapiro **	of Intel Scalable Systems Divison.
60740266059SGregory Neil Shapiro */
60840266059SGregory Neil Shapiro 
60940266059SGregory Neil Shapiro # ifdef __PARAGON__
61040266059SGregory Neil Shapiro #  define __osf__	1	/* get OSF/1 defines below */
61140266059SGregory Neil Shapiro #  ifndef TZ_TYPE
61240266059SGregory Neil Shapiro #   define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
61340266059SGregory Neil Shapiro #  endif /* ! TZ_TYPE */
61440266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
61540266059SGregory Neil Shapiro #  define MAXNAMLEN	NAME_MAX
61640266059SGregory Neil Shapiro # endif /* __PARAGON__ */
61740266059SGregory Neil Shapiro 
61840266059SGregory Neil Shapiro 
61940266059SGregory Neil Shapiro /*
62040266059SGregory Neil Shapiro **  Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1
62140266059SGregory Neil Shapiro **
62240266059SGregory Neil Shapiro **	Tested for 3.2 and 4.0.
62340266059SGregory Neil Shapiro */
62440266059SGregory Neil Shapiro 
62540266059SGregory Neil Shapiro # ifdef __osf__
62640266059SGregory Neil Shapiro #  define HASUNAME	1	/* has uname(2) call */
62740266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(3) call */
62840266059SGregory Neil Shapiro #  define USESETEUID	1	/* has usable seteuid(2) call */
62940266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
63040266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
63140266059SGregory Neil Shapiro #  define HASFCHOWN	1	/* has fchown(2) syscall */
63240266059SGregory Neil Shapiro #  define HASSETLOGIN	1	/* has setlogin(2) */
63340266059SGregory Neil Shapiro #  define IP_SRCROUTE	1	/* can check IP source routing */
63440266059SGregory Neil Shapiro #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
63540266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
63640266059SGregory Neil Shapiro #  define SM_INT32	int	/* 32bit integer */
63740266059SGregory Neil Shapiro #  ifndef HASFLOCK
63894c01205SGregory Neil Shapiro #   include <standards.h>
63994c01205SGregory Neil Shapiro #   if _XOPEN_SOURCE+0 >= 400
64094c01205SGregory Neil Shapiro #    define HASFLOCK	0	/* 5.0 and later has bad flock(2) call */
64194c01205SGregory Neil Shapiro #   else /* _XOPEN_SOURCE+0 >= 400 */
64240266059SGregory Neil Shapiro #    define HASFLOCK	1	/* has flock(2) call */
64394c01205SGregory Neil Shapiro #   endif /* _XOPEN_SOURCE+0 >= 400 */
64440266059SGregory Neil Shapiro #  endif /* ! HASFLOCK */
64540266059SGregory Neil Shapiro #  define LA_TYPE	LA_ALPHAOSF
64640266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_STATVFS	/* use <sys/statvfs.h> statfs() impl */
64740266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
64840266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/var/adm/sendmail/sendmail.cf"
64940266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
65040266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
65140266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
65240266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
653605302a5SGregory Neil Shapiro #  if _FFR_DIGUNIX_SAFECHOWN
654605302a5SGregory Neil Shapiro /*
655605302a5SGregory Neil Shapiro **  Testing on a Digital UNIX 4.0a system showed this to be the correct
656605302a5SGregory Neil Shapiro **  setting but given the security consequences, more testing and
657605302a5SGregory Neil Shapiro **  verification is needed.  Unfortunately, the man page offers no
658605302a5SGregory Neil Shapiro **  assistance.
659605302a5SGregory Neil Shapiro */
660605302a5SGregory Neil Shapiro #   define IS_SAFE_CHOWN >= 0
661605302a5SGregory Neil Shapiro #  endif /* _FFR_DIGUNIX_SAFECHOWN */
66240266059SGregory Neil Shapiro # endif /* __osf__ */
66340266059SGregory Neil Shapiro 
66440266059SGregory Neil Shapiro 
66540266059SGregory Neil Shapiro /*
66640266059SGregory Neil Shapiro **  NeXTstep
66740266059SGregory Neil Shapiro */
66840266059SGregory Neil Shapiro 
66940266059SGregory Neil Shapiro # ifdef NeXT
67040266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
67140266059SGregory Neil Shapiro #  define NEEDPUTENV	2	/* need putenv(3) call; no setenv(3) call */
67240266059SGregory Neil Shapiro #  ifndef HASFLOCK
67340266059SGregory Neil Shapiro #   define HASFLOCK	1	/* has flock(2) call */
67440266059SGregory Neil Shapiro #  endif /* ! HASFLOCK */
67540266059SGregory Neil Shapiro #  define UID_T		int	/* compiler gripes on uid_t */
67640266059SGregory Neil Shapiro #  define GID_T		int	/* ditto for gid_t */
67740266059SGregory Neil Shapiro #  define MODE_T	int	/* and mode_t */
67840266059SGregory Neil Shapiro #  define setpgid	setpgrp
67940266059SGregory Neil Shapiro #  ifndef NOT_SENDMAIL
68040266059SGregory Neil Shapiro #   define sleep		sleepX
68140266059SGregory Neil Shapiro #  endif /* ! NOT_SENDMAIL */
68240266059SGregory Neil Shapiro #  ifndef LA_TYPE
68340266059SGregory Neil Shapiro #   define LA_TYPE	LA_MACH
68440266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
68540266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
68640266059SGregory Neil Shapiro #  ifdef _POSIX_SOURCE
68740266059SGregory Neil Shapiro extern struct passwd	*getpwent();
68840266059SGregory Neil Shapiro #  else /* _POSIX_SOURCE */
68940266059SGregory Neil Shapiro #   define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
69040266059SGregory Neil Shapiro #   define WAITUNION	1	/* use "union wait" as wait argument type */
69140266059SGregory Neil Shapiro typedef int		pid_t;
69240266059SGregory Neil Shapiro #   undef WEXITSTATUS
69340266059SGregory Neil Shapiro #   undef WIFEXITED
69440266059SGregory Neil Shapiro #   undef WIFSTOPPED
69540266059SGregory Neil Shapiro #   undef WTERMSIG
69640266059SGregory Neil Shapiro #  endif /* _POSIX_SOURCE */
69740266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
69840266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/etc/sendmail/sendmail.cf"
69940266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
70040266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
70140266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
70240266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
70340266059SGregory Neil Shapiro #  define SM_INT32	int	/* 32bit integer */
70440266059SGregory Neil Shapiro 
70540266059SGregory Neil Shapiro #  ifdef TCPWRAPPERS
70640266059SGregory Neil Shapiro #   ifndef HASUNSETENV
70740266059SGregory Neil Shapiro #    define HASUNSETENV	1
70840266059SGregory Neil Shapiro #   endif /* ! HASUNSETENV */
70940266059SGregory Neil Shapiro #   undef NEEDPUTENV
71040266059SGregory Neil Shapiro #  endif /* TCPWRAPPERS */
71140266059SGregory Neil Shapiro #  ifndef __APPLE__
71240266059SGregory Neil Shapiro #   include <libc.h>
71340266059SGregory Neil Shapiro #   ifndef S_IRUSR
71440266059SGregory Neil Shapiro #    define S_IRUSR	S_IREAD
71540266059SGregory Neil Shapiro #   endif /* ! S_IRUSR */
71640266059SGregory Neil Shapiro #   ifndef S_IWUSR
71740266059SGregory Neil Shapiro #    define S_IWUSR	S_IWRITE
71840266059SGregory Neil Shapiro #   endif /* ! S_IWUSR */
71940266059SGregory Neil Shapiro #   define _PATH_MAILDIR	"/usr/spool/mail"
72040266059SGregory Neil Shapiro #  endif /* ! __APPLE__ */
72140266059SGregory Neil Shapiro #  ifndef isascii
72240266059SGregory Neil Shapiro #   define isascii(c)	((unsigned)(c) <= 0177)
72340266059SGregory Neil Shapiro #  endif /* ! isascii */
72440266059SGregory Neil Shapiro # endif /* NeXT */
72540266059SGregory Neil Shapiro 
72640266059SGregory Neil Shapiro /*
727e92d3f3fSGregory Neil Shapiro **  Apple Darwin
72813bd1963SGregory Neil Shapiro **      Contributed by Wilfredo Sanchez <wsanchez@mit.edu>
72940266059SGregory Neil Shapiro */
73040266059SGregory Neil Shapiro 
73140266059SGregory Neil Shapiro # if defined(DARWIN)
73213bd1963SGregory Neil Shapiro #  define HASFCHMOD		1	/* has fchmod(2) */
73313bd1963SGregory Neil Shapiro #  define HASFCHOWN		1	/* has fchown(2) */
73413bd1963SGregory Neil Shapiro #  define HASFLOCK		1	/* has flock(2) */
73513bd1963SGregory Neil Shapiro #  define HASUNAME		1	/* has uname(2) */
73613bd1963SGregory Neil Shapiro #  define HASUNSETENV		1	/* has unsetenv(3) */
737e92d3f3fSGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
73813bd1963SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) */
73913bd1963SGregory Neil Shapiro #  define HASSETVBUF		1	/* has setvbuf (3) */
74013bd1963SGregory Neil Shapiro #  define HASSETREUID		0	/* setreuid(2) unusable */
74113bd1963SGregory Neil Shapiro #  define HASSETEUID		1	/* has seteuid(2) */
74213bd1963SGregory Neil Shapiro #  define USESETEUID		1	/* has seteuid(2) */
74313bd1963SGregory Neil Shapiro #  define HASSETEGID		1	/* has setegid(2) */
74413bd1963SGregory Neil Shapiro #  define HASSETREGID		1	/* has setregid(2) */
74513bd1963SGregory Neil Shapiro #  define HASSETRESGID		0	/* no setresgid(2) */
74613bd1963SGregory Neil Shapiro #  define HASLSTAT		1	/* has lstat(2) */
74713bd1963SGregory Neil Shapiro #  define HASSETRLIMIT		1	/* has setrlimit(2) */
74813bd1963SGregory Neil Shapiro #  define HASWAITPID		1	/* has waitpid(2) */
74913bd1963SGregory Neil Shapiro #  define HASGETDTABLESIZE	1	/* has getdtablesize(2) */
75013bd1963SGregory Neil Shapiro #  define HAS_ST_GEN		1	/* has st_gen field in struct stat */
75113bd1963SGregory Neil Shapiro #  define HASURANDOMDEV	1	/* has urandom(4) */
75240266059SGregory Neil Shapiro #  define HASSTRERROR		1	/* has strerror(3) */
75313bd1963SGregory Neil Shapiro #  define HASGETUSERSHELL	1	/* had getusershell(3) */
75413bd1963SGregory Neil Shapiro #  define GIDSET_T		gid_t	/* getgroups(2) takes gid_t */
75540266059SGregory Neil Shapiro #  define LA_TYPE		LA_SUBR	/* use getloadavg(3) */
75640266059SGregory Neil Shapiro #  define SFS_TYPE		SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
75713bd1963SGregory Neil Shapiro #  define SPT_TYPE		SPT_PSSTRINGS	/* use magic PS_STRINGS pointer for setproctitle */
75840266059SGregory Neil Shapiro #  define ERRLIST_PREDEFINED		/* don't declare sys_errlist */
75913bd1963SGregory Neil Shapiro #  define BSD4_4_SOCKADDR		/* struct sockaddr has sa_len */
76013bd1963SGregory Neil Shapiro #  define SAFENFSPATHCONF	0	/* unverified: pathconf(2) doesn't work on NFS */
76113bd1963SGregory Neil Shapiro #  define HAS_IN_H		1
76213bd1963SGregory Neil Shapiro #  define NETLINK		1	/* supports AF_LINK */
763605302a5SGregory Neil Shapiro #  ifndef NOT_SENDMAIL
764605302a5SGregory Neil Shapiro #   define sleep sleepX
765959366dcSGregory Neil Shapiro extern unsigned int sleepX __P((unsigned int seconds));
766605302a5SGregory Neil Shapiro #  endif /* ! NOT_SENDMAIL */
76740266059SGregory Neil Shapiro # endif /* defined(DARWIN) */
76840266059SGregory Neil Shapiro 
76940266059SGregory Neil Shapiro 
77040266059SGregory Neil Shapiro /*
77140266059SGregory Neil Shapiro **  4.4 BSD
77240266059SGregory Neil Shapiro **
77340266059SGregory Neil Shapiro **	See also BSD defines.
77440266059SGregory Neil Shapiro */
77540266059SGregory Neil Shapiro 
77640266059SGregory Neil Shapiro # if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__)
77740266059SGregory Neil Shapiro #  include <paths.h>
77840266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(3) call */
77940266059SGregory Neil Shapiro #  define USESETEUID	1	/* has usable seteuid(2) call */
78040266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
78140266059SGregory Neil Shapiro #  define HASFCHOWN	1	/* has fchown(2) syscall */
78240266059SGregory Neil Shapiro #  define HASSTRERROR	1	/* has strerror(3) */
78340266059SGregory Neil Shapiro #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
78440266059SGregory Neil Shapiro #  include <sys/cdefs.h>
78540266059SGregory Neil Shapiro #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
78640266059SGregory Neil Shapiro #  define BSD4_4_SOCKADDR	/* has sa_len */
78740266059SGregory Neil Shapiro #  define NEED_PRINTF_PERCENTQ	1	/* doesn't have %lld */
78840266059SGregory Neil Shapiro #  define NETLINK	1	/* supports AF_LINK */
78940266059SGregory Neil Shapiro #  ifndef LA_TYPE
79040266059SGregory Neil Shapiro #   define LA_TYPE	LA_SUBR
79140266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
79240266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
79340266059SGregory Neil Shapiro #  define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
79440266059SGregory Neil Shapiro # endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) */
79540266059SGregory Neil Shapiro 
79640266059SGregory Neil Shapiro 
79740266059SGregory Neil Shapiro /*
79840266059SGregory Neil Shapiro **  BSD/OS (was BSD/386) (all versions)
79940266059SGregory Neil Shapiro **	From Tony Sanders, BSDI
80040266059SGregory Neil Shapiro */
80140266059SGregory Neil Shapiro 
80240266059SGregory Neil Shapiro # ifdef __bsdi__
80340266059SGregory Neil Shapiro #  include <paths.h>
80440266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has the unsetenv(3) call */
80540266059SGregory Neil Shapiro #  define HASSETREUID	0	/* BSD-OS has broken setreuid(2) emulation */
806e92d3f3fSGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
80740266059SGregory Neil Shapiro #  define USESETEUID	1	/* has usable seteuid(2) call */
80840266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
80940266059SGregory Neil Shapiro #  define HASSETLOGIN	1	/* has setlogin(2) */
81040266059SGregory Neil Shapiro #  define HASUNAME	1	/* has uname(2) syscall */
81140266059SGregory Neil Shapiro #  define HASSTRERROR	1	/* has strerror(3) */
81240266059SGregory Neil Shapiro #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
81340266059SGregory Neil Shapiro #  include <sys/cdefs.h>
81440266059SGregory Neil Shapiro #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
81540266059SGregory Neil Shapiro #  define BSD4_4_SOCKADDR	/* has sa_len */
81640266059SGregory Neil Shapiro #  define NETLINK	1	/* supports AF_LINK */
81740266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
81840266059SGregory Neil Shapiro #  ifndef LA_TYPE
81940266059SGregory Neil Shapiro #   define LA_TYPE	LA_SUBR
82040266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
82140266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
82240266059SGregory Neil Shapiro #  define QUAD_T		quad_t
82340266059SGregory Neil Shapiro #  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
82440266059SGregory Neil Shapiro 			/* version 1.1 or later */
82540266059SGregory Neil Shapiro #   undef SPT_TYPE
82640266059SGregory Neil Shapiro #   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
82740266059SGregory Neil Shapiro #  else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
82840266059SGregory Neil Shapiro 			/* version 1.0 or earlier */
82940266059SGregory Neil Shapiro #   define SPT_PADCHAR	'\0'	/* pad process title with nulls */
83040266059SGregory Neil Shapiro #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
83140266059SGregory Neil Shapiro #  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701	/* on 3.x */
83240266059SGregory Neil Shapiro #   define HASSETUSERCONTEXT 1	/* has setusercontext */
83340266059SGregory Neil Shapiro #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */
83440266059SGregory Neil Shapiro #  if defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701	/* 3.1 and earlier */
83540266059SGregory Neil Shapiro #   define MODE_T	int	/* va_arg() can't handle less than int */
83640266059SGregory Neil Shapiro #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 */
83740266059SGregory Neil Shapiro #  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910	/* on 4.x */
83840266059SGregory Neil Shapiro #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
83940266059SGregory Neil Shapiro #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 */
84040266059SGregory Neil Shapiro # endif /* __bsdi__ */
84140266059SGregory Neil Shapiro 
84240266059SGregory Neil Shapiro 
84340266059SGregory Neil Shapiro /*
84440266059SGregory Neil Shapiro **  QNX 4.2x
84540266059SGregory Neil Shapiro **	Contributed by Glen McCready <glen@qnx.com>.
84640266059SGregory Neil Shapiro **
84740266059SGregory Neil Shapiro **	Should work with all versions of QNX.
84840266059SGregory Neil Shapiro */
84940266059SGregory Neil Shapiro 
85040266059SGregory Neil Shapiro # if defined(__QNX__)
85140266059SGregory Neil Shapiro #  include <unix.h>
85240266059SGregory Neil Shapiro #  include <sys/select.h>
85340266059SGregory Neil Shapiro #  undef NGROUPS_MAX
854e92d3f3fSGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
85540266059SGregory Neil Shapiro #  define USESETEUID	1	/* has usable seteuid(2) call */
85640266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
85740266059SGregory Neil Shapiro #  define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
85840266059SGregory Neil Shapiro #  define HASSETREUID	1	/* has setreuid(2) call */
85940266059SGregory Neil Shapiro #  define HASSTRERROR	1	/* has strerror(3) */
86040266059SGregory Neil Shapiro #  define HASFLOCK	0
86140266059SGregory Neil Shapiro #  undef HASINITGROUPS		/* has initgroups(3) call */
86240266059SGregory Neil Shapiro #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
86340266059SGregory Neil Shapiro #  define IP_SRCROUTE	1	/* can check IP source routing */
86440266059SGregory Neil Shapiro #  define TZ_TYPE	TZ_TMNAME	/* use tmname variable */
86540266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
86640266059SGregory Neil Shapiro #  define LA_TYPE	LA_ZERO
86740266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_NONE
86840266059SGregory Neil Shapiro #  define SPT_TYPE	SPT_REUSEARGV
86940266059SGregory Neil Shapiro #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
87040266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0
87140266059SGregory Neil Shapiro #  define E_PSEUDOBASE	512
87240266059SGregory Neil Shapiro #  define _FILE_H_INCLUDED
87340266059SGregory Neil Shapiro # endif /* defined(__QNX__) */
87440266059SGregory Neil Shapiro 
87540266059SGregory Neil Shapiro 
87640266059SGregory Neil Shapiro /*
877b6bacd31SGregory Neil Shapiro **  DragonFly BSD/ FreeBSD / NetBSD / OpenBSD (all architectures, all versions)
87840266059SGregory Neil Shapiro **
87940266059SGregory Neil Shapiro **  4.3BSD clone, closer to 4.4BSD	for FreeBSD 1.x and NetBSD 0.9x
88040266059SGregory Neil Shapiro **  4.4BSD-Lite based			for FreeBSD 2.x and NetBSD 1.x
88140266059SGregory Neil Shapiro **
88240266059SGregory Neil Shapiro **	See also BSD defines.
88340266059SGregory Neil Shapiro */
88440266059SGregory Neil Shapiro 
885b6bacd31SGregory Neil Shapiro # if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
88640266059SGregory Neil Shapiro #  include <paths.h>
88740266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(3) call */
888e92d3f3fSGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
88940266059SGregory Neil Shapiro #  define USESETEUID	1	/* has usable seteuid(2) call */
89040266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
891e92d3f3fSGregory Neil Shapiro #  define HASFCHOWN	1	/* has fchown(2) syscall */
89240266059SGregory Neil Shapiro #  define HASUNAME	1	/* has uname(2) syscall */
89340266059SGregory Neil Shapiro #  define HASSTRERROR	1	/* has strerror(3) */
89440266059SGregory Neil Shapiro #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
89540266059SGregory Neil Shapiro #  define NEED_PRINTF_PERCENTQ	1	/* doesn't have %lld */
89640266059SGregory Neil Shapiro #  include <sys/cdefs.h>
89740266059SGregory Neil Shapiro #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
89840266059SGregory Neil Shapiro #  define BSD4_4_SOCKADDR	/* has sa_len */
89940266059SGregory Neil Shapiro #  define NETLINK	1	/* supports AF_LINK */
90040266059SGregory Neil Shapiro #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
90140266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
90240266059SGregory Neil Shapiro #  define QUAD_T		unsigned long long
90340266059SGregory Neil Shapiro #  ifndef LA_TYPE
90440266059SGregory Neil Shapiro #   define LA_TYPE	LA_SUBR
90540266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
906e92d3f3fSGregory Neil Shapiro #  if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 200040000
907e92d3f3fSGregory Neil Shapiro #   undef SFS_TYPE
908e92d3f3fSGregory Neil Shapiro #   define SFS_TYPE	SFS_STATVFS
909e92d3f3fSGregory Neil Shapiro #  else
91040266059SGregory Neil Shapiro #   define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
911e92d3f3fSGregory Neil Shapiro #  endif
91240266059SGregory Neil Shapiro #  if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1)
91340266059SGregory Neil Shapiro #   undef SPT_TYPE
91440266059SGregory Neil Shapiro #   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
91540266059SGregory Neil Shapiro #  endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */
91640266059SGregory Neil Shapiro #  if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3))
91740266059SGregory Neil Shapiro #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
91840266059SGregory Neil Shapiro #  endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */
919e92d3f3fSGregory Neil Shapiro #  if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104170000
920e92d3f3fSGregory Neil Shapiro #   define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
921e92d3f3fSGregory Neil Shapiro #  endif
922e92d3f3fSGregory Neil Shapiro #  if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 200060000
923e92d3f3fSGregory Neil Shapiro #   define HASCLOSEFROM	1	/* closefrom(3) added in 2.0F */
924e92d3f3fSGregory Neil Shapiro #  endif
925e92d3f3fSGregory Neil Shapiro #  if defined(__NetBSD__)
926e92d3f3fSGregory Neil Shapiro #   define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
927e92d3f3fSGregory Neil Shapiro #   include <sys/param.h>
928e92d3f3fSGregory Neil Shapiro #   include <sys/sysctl.h>
929e92d3f3fSGregory Neil Shapiro #  endif
930b6bacd31SGregory Neil Shapiro #  if defined(__DragonFly__)
931b6bacd31SGregory Neil Shapiro #   define HASSETLOGIN		1	/* has setlogin(2) */
932b6bacd31SGregory Neil Shapiro #   define HASSRANDOMDEV	1	/* has srandomdev(3) */
933b6bacd31SGregory Neil Shapiro #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
934b6bacd31SGregory Neil Shapiro #   undef SPT_TYPE
935b6bacd31SGregory Neil Shapiro #   include <libutil.h>
936b6bacd31SGregory Neil Shapiro #   define SPT_TYPE		SPT_BUILTIN
937b6bacd31SGregory Neil Shapiro #   define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
938b6bacd31SGregory Neil Shapiro #   ifndef SMRSH_CMDDIR
939b6bacd31SGregory Neil Shapiro #    define SMRSH_CMDDIR	"/usr/libexec/sm.bin"
940b6bacd31SGregory Neil Shapiro #   endif /* ! SMRSH_CMDDIR */
941b6bacd31SGregory Neil Shapiro #   ifndef SMRSH_PATH
942b6bacd31SGregory Neil Shapiro #    define SMRSH_PATH		"/bin:/usr/bin"
943b6bacd31SGregory Neil Shapiro #   endif /* ! SMRSH_PATH */
944b6bacd31SGregory Neil Shapiro #  define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
945b6bacd31SGregory Neil Shapiro #  include <sys/sysctl.h>
946b6bacd31SGregory Neil Shapiro #  endif /* defined(__DragonFly__) */
94740266059SGregory Neil Shapiro #  if defined(__FreeBSD__)
94840266059SGregory Neil Shapiro #   define HASSETLOGIN	1	/* has setlogin(2) */
94940266059SGregory Neil Shapiro #   if __FreeBSD_version >= 227001
95040266059SGregory Neil Shapiro #    define HASSRANDOMDEV	1	/* has srandomdev(3) */
95140266059SGregory Neil Shapiro #    define HASURANDOMDEV	1	/* has /dev/urandom(4) */
95240266059SGregory Neil Shapiro #   endif /* __FreeBSD_version >= 227001 */
95340266059SGregory Neil Shapiro #   undef SPT_TYPE
95440266059SGregory Neil Shapiro #   if __FreeBSD__ >= 2
95540266059SGregory Neil Shapiro #    include <osreldate.h>
95640266059SGregory Neil Shapiro #    if __FreeBSD_version >= 199512	/* 2.2-current when it appeared */
95740266059SGregory Neil Shapiro #     include <libutil.h>
95840266059SGregory Neil Shapiro #     define SPT_TYPE	SPT_BUILTIN
95940266059SGregory Neil Shapiro #    endif /* __FreeBSD_version >= 199512 */
96040266059SGregory Neil Shapiro #    if __FreeBSD_version >= 222000	/* 2.2.2-release and later */
96140266059SGregory Neil Shapiro #     define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
96240266059SGregory Neil Shapiro #    endif /* __FreeBSD_version >= 222000 */
96340266059SGregory Neil Shapiro #    if __FreeBSD_version >= 330000	/* 3.3.0-release and later */
964a7ec597cSGregory Neil Shapiro #     ifndef SMRSH_CMDDIR
96540266059SGregory Neil Shapiro #      define SMRSH_CMDDIR	"/usr/libexec/sm.bin"
966a7ec597cSGregory Neil Shapiro #     endif /* ! SMRSH_CMDDIR */
967a7ec597cSGregory Neil Shapiro #     ifndef SMRSH_PATH
96840266059SGregory Neil Shapiro #      define SMRSH_PATH	"/bin:/usr/bin"
969a7ec597cSGregory Neil Shapiro #     endif /* ! SMRSH_PATH */
97040266059SGregory Neil Shapiro #    endif /* __FreeBSD_version >= 330000 */
97140266059SGregory Neil Shapiro #    define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
97240266059SGregory Neil Shapiro #    include <sys/sysctl.h>
97340266059SGregory Neil Shapiro #   endif /* __FreeBSD__ >= 2 */
97440266059SGregory Neil Shapiro #   ifndef SPT_TYPE
97540266059SGregory Neil Shapiro #    define SPT_TYPE	SPT_REUSEARGV
97640266059SGregory Neil Shapiro #    define SPT_PADCHAR	'\0'		/* pad process title with nulls */
97740266059SGregory Neil Shapiro #   endif /* ! SPT_TYPE */
97840266059SGregory Neil Shapiro #  endif /* defined(__FreeBSD__) */
97940266059SGregory Neil Shapiro #  if defined(__OpenBSD__)
98040266059SGregory Neil Shapiro #   undef SPT_TYPE
98140266059SGregory Neil Shapiro #   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
98240266059SGregory Neil Shapiro #   define HASSETLOGIN	1	/* has setlogin(2) */
983a7ec597cSGregory Neil Shapiro #   if OpenBSD < 200305
984a7ec597cSGregory Neil Shapiro #    define HASSETREUID	0	/* setreuid(2) broken in OpenBSD < 3.3 */
985a7ec597cSGregory Neil Shapiro #   endif /* OpenBSD < 200305 */
98640266059SGregory Neil Shapiro #   define HASSETEGID	1	/* use setegid(2) to set saved gid */
98740266059SGregory Neil Shapiro #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
98840266059SGregory Neil Shapiro #   if OpenBSD >= 200006
98940266059SGregory Neil Shapiro #    define HASSRANDOMDEV	1	/* has srandomdev(3) */
99040266059SGregory Neil Shapiro #   endif /* OpenBSD >= 200006 */
99140266059SGregory Neil Shapiro #   if OpenBSD >= 200012
99240266059SGregory Neil Shapiro #    define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
99340266059SGregory Neil Shapiro #   endif /* OpenBSD >= 200012 */
994e92d3f3fSGregory Neil Shapiro #   if OpenBSD >= 200405
995e92d3f3fSGregory Neil Shapiro #    define HASCLOSEFROM	1	/* closefrom(3) added in 3.5 */
996e92d3f3fSGregory Neil Shapiro #   endif /* OpenBSD >= 200405 */
99740266059SGregory Neil Shapiro #  endif /* defined(__OpenBSD__) */
998b6bacd31SGregory Neil Shapiro # endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */
99940266059SGregory Neil Shapiro 
100040266059SGregory Neil Shapiro 
100140266059SGregory Neil Shapiro /*
100240266059SGregory Neil Shapiro **  Mach386
100340266059SGregory Neil Shapiro **
100440266059SGregory Neil Shapiro **	For mt Xinu's Mach386 system.
100540266059SGregory Neil Shapiro */
100640266059SGregory Neil Shapiro 
100740266059SGregory Neil Shapiro # if defined(MACH) && defined(i386) && !defined(__GNU__)
100840266059SGregory Neil Shapiro #  define MACH386	1
100940266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(3) call */
101040266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
101140266059SGregory Neil Shapiro #  ifndef HASFLOCK
101240266059SGregory Neil Shapiro #   define HASFLOCK	1	/* has flock(2) call */
101340266059SGregory Neil Shapiro #  endif /* ! HASFLOCK */
101440266059SGregory Neil Shapiro #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
101540266059SGregory Neil Shapiro #  define NEEDSTRTOL	1	/* need the strtol() function */
101640266059SGregory Neil Shapiro #  define setpgid	setpgrp
101740266059SGregory Neil Shapiro #  ifndef LA_TYPE
101840266059SGregory Neil Shapiro #   define LA_TYPE	LA_FLOAT
101940266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
102040266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
102140266059SGregory Neil Shapiro #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
102240266059SGregory Neil Shapiro #  undef WEXITSTATUS
102340266059SGregory Neil Shapiro #  undef WIFEXITED
102440266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
102540266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
102640266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
102740266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
102840266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
102940266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
103040266059SGregory Neil Shapiro # endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */
103140266059SGregory Neil Shapiro 
103240266059SGregory Neil Shapiro 
103340266059SGregory Neil Shapiro 
103440266059SGregory Neil Shapiro /*
103540266059SGregory Neil Shapiro **  GNU OS (hurd)
103640266059SGregory Neil Shapiro **	Largely BSD & posix compatible.
103740266059SGregory Neil Shapiro **	Port contributed by Miles Bader <miles@gnu.ai.mit.edu>.
103840266059SGregory Neil Shapiro **	Updated by Mark Kettenis <kettenis@wins.uva.nl>.
103940266059SGregory Neil Shapiro */
104040266059SGregory Neil Shapiro 
104140266059SGregory Neil Shapiro # if defined(__GNU__) && !defined(NeXT)
104240266059SGregory Neil Shapiro #  include <paths.h>
104340266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) call */
104440266059SGregory Neil Shapiro #  define HASFCHOWN	1	/* has fchown(2) call */
104540266059SGregory Neil Shapiro #  define HASUNAME	1	/* has uname(2) call */
104640266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(3) call */
104740266059SGregory Neil Shapiro #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
104840266059SGregory Neil Shapiro #  define HASSTRERROR	1	/* has strerror(3) */
104940266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
105040266059SGregory Neil Shapiro #  define SOCKADDR_LEN_T	socklen_t
105140266059SGregory Neil Shapiro #  define SOCKOPT_LEN_T	socklen_t
105240266059SGregory Neil Shapiro #  if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2
105340266059SGregory Neil Shapiro #   define LA_TYPE	LA_SUBR
105440266059SGregory Neil Shapiro #  else /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
105540266059SGregory Neil Shapiro #   define LA_TYPE	LA_MACH
105640266059SGregory Neil Shapiro    /* GNU uses mach[34], which renames some rpcs from mach2.x. */
105740266059SGregory Neil Shapiro #   define host_self	mach_host_self
105840266059SGregory Neil Shapiro #  endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
105940266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_STATFS
106040266059SGregory Neil Shapiro #  define SPT_TYPE	SPT_CHANGEARGV
106140266059SGregory Neil Shapiro #  define ERRLIST_PREDEFINED	1	/* don't declare sys_errlist */
106240266059SGregory Neil Shapiro #  define BSD4_4_SOCKADDR	1	/* has sa_len */
106340266059SGregory Neil Shapiro #  define SIOCGIFCONF_IS_BROKEN  1	/* SIOCGFCONF doesn't work */
106440266059SGregory Neil Shapiro #  define HAS_IN_H	1	/* GNU has netinet/in.h. */
106540266059SGregory Neil Shapiro /* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */
106640266059SGregory Neil Shapiro #  define MAXPATHLEN	2048
106740266059SGregory Neil Shapiro # endif /* defined(__GNU__) && !defined(NeXT) */
106840266059SGregory Neil Shapiro 
106940266059SGregory Neil Shapiro /*
107040266059SGregory Neil Shapiro **  4.3 BSD -- this is for very old systems
107140266059SGregory Neil Shapiro **
107240266059SGregory Neil Shapiro **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
107340266059SGregory Neil Shapiro **
107440266059SGregory Neil Shapiro **	You'll also have to install a new resolver library.
107540266059SGregory Neil Shapiro **	I don't guarantee that support for this environment is complete.
107640266059SGregory Neil Shapiro */
107740266059SGregory Neil Shapiro 
107840266059SGregory Neil Shapiro # if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
107940266059SGregory Neil Shapiro #  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
108040266059SGregory Neil Shapiro #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
108140266059SGregory Neil Shapiro #  define ARBPTR_T	char *
108240266059SGregory Neil Shapiro #  define setpgid	setpgrp
108340266059SGregory Neil Shapiro #  ifndef LA_TYPE
108440266059SGregory Neil Shapiro #   define LA_TYPE	LA_FLOAT
108540266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
108640266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
108740266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
108840266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
108940266059SGregory Neil Shapiro #  ifndef IDENTPROTO
109040266059SGregory Neil Shapiro #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
109140266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
109240266059SGregory Neil Shapiro #  undef WEXITSTATUS
109340266059SGregory Neil Shapiro #  undef WIFEXITED
109440266059SGregory Neil Shapiro typedef short		pid_t;
109540266059SGregory Neil Shapiro # endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */
109640266059SGregory Neil Shapiro 
109740266059SGregory Neil Shapiro 
109840266059SGregory Neil Shapiro /*
109940266059SGregory Neil Shapiro **  SCO Unix
110040266059SGregory Neil Shapiro **
110140266059SGregory Neil Shapiro **	This includes three parts:
110240266059SGregory Neil Shapiro **
110340266059SGregory Neil Shapiro **	The first is for SCO OpenServer 5.
110440266059SGregory Neil Shapiro **	(Contributed by Keith Reynolds <keithr@sco.COM>).
110540266059SGregory Neil Shapiro **
110640266059SGregory Neil Shapiro **		SCO OpenServer 5 has a compiler version number macro,
110740266059SGregory Neil Shapiro **		which we can use to figure out what version we're on.
110840266059SGregory Neil Shapiro **		This may have to change in future releases.
110940266059SGregory Neil Shapiro **
111040266059SGregory Neil Shapiro **	The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0.
111140266059SGregory Neil Shapiro **	(Contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
111240266059SGregory Neil Shapiro **
111340266059SGregory Neil Shapiro **	The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier.
111440266059SGregory Neil Shapiro */
111540266059SGregory Neil Shapiro 
111640266059SGregory Neil Shapiro /* SCO OpenServer 5 */
111740266059SGregory Neil Shapiro # if _SCO_DS >= 1
111840266059SGregory Neil Shapiro #  include <paths.h>
111940266059SGregory Neil Shapiro #  define SIOCGIFNUM_IS_BROKEN 1	/* SIOCGIFNUM returns bogus value */
112040266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) call */
112140266059SGregory Neil Shapiro #  define HASFCHOWN	1	/* has fchown(2) call */
112240266059SGregory Neil Shapiro #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
112340266059SGregory Neil Shapiro #  define USESETEUID	1	/* has seteuid(2) call */
112440266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
112540266059SGregory Neil Shapiro #  define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
112640266059SGregory Neil Shapiro #  define RLIMIT_NEEDS_SYS_TIME_H	1
112740266059SGregory Neil Shapiro #  define LDA_USE_LOCKF	1
112840266059SGregory Neil Shapiro #  ifndef LA_TYPE
112940266059SGregory Neil Shapiro #   define LA_TYPE	LA_DEVSHORT
113040266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
113140266059SGregory Neil Shapiro #  define _PATH_AVENRUN	"/dev/table/avenrun"
113240266059SGregory Neil Shapiro #  ifndef _SCO_unix_4_2
113340266059SGregory Neil Shapiro #   define _SCO_unix_4_2
113440266059SGregory Neil Shapiro #  else /* ! _SCO_unix_4_2 */
113540266059SGregory Neil Shapiro #   define SOCKADDR_LEN_T	size_t	/* e.g., arg#3 to accept, getsockname */
113640266059SGregory Neil Shapiro #   define SOCKOPT_LEN_T	size_t	/* arg#5 to getsockopt */
113740266059SGregory Neil Shapiro #  endif /* ! _SCO_unix_4_2 */
113840266059SGregory Neil Shapiro # endif /* _SCO_DS >= 1 */
113940266059SGregory Neil Shapiro 
114040266059SGregory Neil Shapiro /* SCO UNIX 3.2v4.2/Open Desktop 3.0 */
114140266059SGregory Neil Shapiro # ifdef _SCO_unix_4_2
114240266059SGregory Neil Shapiro #  define _SCO_unix_
114340266059SGregory Neil Shapiro #  define HASSETREUID	1	/* has setreuid(2) call */
114440266059SGregory Neil Shapiro # endif /* _SCO_unix_4_2 */
114540266059SGregory Neil Shapiro 
114640266059SGregory Neil Shapiro /* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */
114740266059SGregory Neil Shapiro # ifdef _SCO_unix_
114840266059SGregory Neil Shapiro #  include <sys/stream.h>	/* needed for IP_SRCROUTE */
114940266059SGregory Neil Shapiro #  define SYSTEM5	1	/* include all the System V defines */
115040266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
115140266059SGregory Neil Shapiro #  define NOFTRUNCATE	0	/* has (simulated) ftruncate call */
115240266059SGregory Neil Shapiro #  ifndef USE_SIGLONGJMP
115340266059SGregory Neil Shapiro #   define USE_SIGLONGJMP	1 /* sigsetjmp needed for signal handling */
115440266059SGregory Neil Shapiro #  endif /* ! USE_SIGLONGJMP */
115540266059SGregory Neil Shapiro #  define MAXPATHLEN	PATHSIZE
115640266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
115740266059SGregory Neil Shapiro #  define SFS_BAVAIL	f_bfree		/* alternate field name */
115840266059SGregory Neil Shapiro #  define SPT_TYPE	SPT_SCO		/* write kernel u. area */
115940266059SGregory Neil Shapiro #  define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
116040266059SGregory Neil Shapiro #  define UID_T		uid_t
116140266059SGregory Neil Shapiro #  define GID_T		gid_t
116240266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
116340266059SGregory Neil Shapiro #  define _PATH_UNIX		"/unix"
116440266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
116540266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
116640266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
116740266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
116840266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
116940266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
117040266059SGregory Neil Shapiro 
117140266059SGregory Neil Shapiro /* stuff fixed in later releases */
117240266059SGregory Neil Shapiro #  ifndef _SCO_unix_4_2
117340266059SGregory Neil Shapiro #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
117440266059SGregory Neil Shapiro #  endif /* ! _SCO_unix_4_2 */
117540266059SGregory Neil Shapiro 
117640266059SGregory Neil Shapiro #  ifndef _SCO_DS
117740266059SGregory Neil Shapiro #   define ftruncate	chsize	/* use chsize(2) to emulate ftruncate */
117840266059SGregory Neil Shapiro #   define NEEDFSYNC	1	/* needs the fsync(2) call stub */
117940266059SGregory Neil Shapiro #   define NETUNIX	0	/* no unix domain socket support */
118040266059SGregory Neil Shapiro #   define LA_TYPE	LA_SHORT
118140266059SGregory Neil Shapiro #  endif /* ! _SCO_DS */
118240266059SGregory Neil Shapiro 
118340266059SGregory Neil Shapiro # endif /* _SCO_unix_ */
118440266059SGregory Neil Shapiro 
118540266059SGregory Neil Shapiro /*
118640266059SGregory Neil Shapiro **  ISC (SunSoft) Unix.
118740266059SGregory Neil Shapiro **
118840266059SGregory Neil Shapiro **	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
118940266059SGregory Neil Shapiro */
119040266059SGregory Neil Shapiro 
119140266059SGregory Neil Shapiro # ifdef ISC_UNIX
119240266059SGregory Neil Shapiro #  include <net/errno.h>
119340266059SGregory Neil Shapiro #  include <sys/stream.h>	/* needed for IP_SRCROUTE */
119440266059SGregory Neil Shapiro #  include <sys/bsdtypes.h>
119540266059SGregory Neil Shapiro #  define SYSTEM5	1	/* include all the System V defines */
119640266059SGregory Neil Shapiro #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
119740266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
119840266059SGregory Neil Shapiro #  define HASSETREUID	1	/* has setreuid(2) call */
119940266059SGregory Neil Shapiro #  define NEEDFSYNC	1	/* needs the fsync(2) call stub */
120040266059SGregory Neil Shapiro #  define NETUNIX	0	/* no unix domain socket support */
120140266059SGregory Neil Shapiro #  define MAXPATHLEN	1024
120240266059SGregory Neil Shapiro #  define LA_TYPE	LA_SHORT
120340266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
120440266059SGregory Neil Shapiro #  define SFS_BAVAIL	f_bfree		/* alternate field name */
120540266059SGregory Neil Shapiro #  define _PATH_UNIX		"/unix"
120640266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
120740266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
120840266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
120940266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
121040266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
121140266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
121240266059SGregory Neil Shapiro # endif /* ISC_UNIX */
121340266059SGregory Neil Shapiro 
121440266059SGregory Neil Shapiro 
121540266059SGregory Neil Shapiro /*
121640266059SGregory Neil Shapiro **  Altos System V (5.3.1)
121740266059SGregory Neil Shapiro **	Contributed by Tim Rice <tim@trr.metro.net>.
121840266059SGregory Neil Shapiro */
121940266059SGregory Neil Shapiro 
122040266059SGregory Neil Shapiro # ifdef ALTOS_SYSTEM_V
122140266059SGregory Neil Shapiro #  include <sys/stream.h>
122240266059SGregory Neil Shapiro #  include <limits.h>
122340266059SGregory Neil Shapiro #  define SYSTEM5	1	/* include all the System V defines */
122440266059SGregory Neil Shapiro #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
122540266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
122640266059SGregory Neil Shapiro #  define WAITUNION	1	/* use "union wait" as wait argument type */
122740266059SGregory Neil Shapiro #  define NEEDFSYNC	1	/* no fsync(2) in system library */
122840266059SGregory Neil Shapiro #  define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
122940266059SGregory Neil Shapiro #  define NOFTRUNCATE	1	/* do not have ftruncate(2) */
123040266059SGregory Neil Shapiro #  define MAXPATHLEN	PATH_MAX
123140266059SGregory Neil Shapiro #  define LA_TYPE	LA_SHORT
123240266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
123340266059SGregory Neil Shapiro #  define SFS_BAVAIL	f_bfree		/* alternate field name */
123440266059SGregory Neil Shapiro #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
123540266059SGregory Neil Shapiro #  define NETUNIX	0	/* no unix domain socket support */
123640266059SGregory Neil Shapiro #  undef WIFEXITED
123740266059SGregory Neil Shapiro #  undef WEXITSTATUS
123840266059SGregory Neil Shapiro #  define strtoul	strtol	/* gcc library bogosity */
123940266059SGregory Neil Shapiro 
124040266059SGregory Neil Shapiro typedef unsigned short	uid_t;
124140266059SGregory Neil Shapiro typedef unsigned short	gid_t;
124240266059SGregory Neil Shapiro typedef short		pid_t;
124340266059SGregory Neil Shapiro typedef unsigned long	mode_t;
124440266059SGregory Neil Shapiro 
124540266059SGregory Neil Shapiro /* some stuff that should have been in the include files */
124640266059SGregory Neil Shapiro extern char		*malloc();
124740266059SGregory Neil Shapiro extern struct passwd	*getpwent();
124840266059SGregory Neil Shapiro extern struct passwd	*getpwnam();
124940266059SGregory Neil Shapiro extern struct passwd	*getpwuid();
125040266059SGregory Neil Shapiro extern char		*getenv();
125140266059SGregory Neil Shapiro extern struct group	*getgrgid();
125240266059SGregory Neil Shapiro extern struct group	*getgrnam();
125340266059SGregory Neil Shapiro 
125440266059SGregory Neil Shapiro # endif /* ALTOS_SYSTEM_V */
125540266059SGregory Neil Shapiro 
125640266059SGregory Neil Shapiro 
125740266059SGregory Neil Shapiro /*
125840266059SGregory Neil Shapiro **  ConvexOS 11.0 and later
125940266059SGregory Neil Shapiro **
126040266059SGregory Neil Shapiro **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
126140266059SGregory Neil Shapiro **	works on 9.1 as well.
126240266059SGregory Neil Shapiro **
126340266059SGregory Neil Shapiro **  ConvexOS 11.5 and later, should work on 11.0 as defined.
126440266059SGregory Neil Shapiro **  For pre-ConvexOOS 11.0, define SM_CONF_GETOPT=0, undef IDENTPROTO
126540266059SGregory Neil Shapiro **
126640266059SGregory Neil Shapiro **	Eric Schnoebelen (eric@cirr.com) For CONVEX Computer Corp.
126740266059SGregory Neil Shapiro **		(now the CONVEX Technologies Center of Hewlett Packard)
126840266059SGregory Neil Shapiro */
126940266059SGregory Neil Shapiro 
127040266059SGregory Neil Shapiro # ifdef _CONVEX_SOURCE
127140266059SGregory Neil Shapiro #  define HASGETDTABLESIZE	1	/* has getdtablesize(2) */
127240266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) */
127340266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
127440266059SGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
127540266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(3) */
127640266059SGregory Neil Shapiro #  define HASFLOCK	1	/* has flock(2) */
127740266059SGregory Neil Shapiro #  define HASSETRLIMIT	1	/* has setrlimit(2) */
127840266059SGregory Neil Shapiro #  define HASSETREUID	1	/* has setreuid(2) */
127940266059SGregory Neil Shapiro #  define BROKEN_RES_SEARCH	1	/* res_search(unknown) returns h_error=0 */
128040266059SGregory Neil Shapiro #  define NEEDPUTENV	1	/* needs putenv (written in terms of setenv) */
128140266059SGregory Neil Shapiro #  define SM_CONF_GETOPT	1	/* need a replacement for getopt(3) */
128240266059SGregory Neil Shapiro #  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
128340266059SGregory Neil Shapiro #  define LA_TYPE	LA_FLOAT
128440266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
128540266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
128640266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
128740266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
128840266059SGregory Neil Shapiro #  ifndef S_IREAD
128940266059SGregory Neil Shapiro #   define S_IREAD	_S_IREAD
129040266059SGregory Neil Shapiro #   define S_IWRITE	_S_IWRITE
129140266059SGregory Neil Shapiro #   define S_IEXEC	_S_IEXEC
129240266059SGregory Neil Shapiro #   define S_IFMT	_S_IFMT
129340266059SGregory Neil Shapiro #   define S_IFCHR	_S_IFCHR
129440266059SGregory Neil Shapiro #   define S_IFBLK	_S_IFBLK
129540266059SGregory Neil Shapiro #  endif /* ! S_IREAD */
129640266059SGregory Neil Shapiro #  ifndef TZ_TYPE
129740266059SGregory Neil Shapiro #   define TZ_TYPE	TZ_TIMEZONE
129840266059SGregory Neil Shapiro #  endif /* ! TZ_TYPE */
129940266059SGregory Neil Shapiro #  ifndef IDENTPROTO
130040266059SGregory Neil Shapiro #   define IDENTPROTO	1
130140266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
130240266059SGregory Neil Shapiro #  ifndef SHARE_V1
130340266059SGregory Neil Shapiro #   define SHARE_V1	1	/* version 1 of the fair share scheduler */
130440266059SGregory Neil Shapiro #  endif /* ! SHARE_V1 */
130540266059SGregory Neil Shapiro #  if !defined(__GNUC__ )
130640266059SGregory Neil Shapiro #   define UID_T	int		/* GNUC gets it right, ConvexC botches */
130740266059SGregory Neil Shapiro #   define GID_T	int		/* GNUC gets it right, ConvexC botches */
130840266059SGregory Neil Shapiro #  endif /* !defined(__GNUC__ ) */
130940266059SGregory Neil Shapiro #  if SECUREWARE
131040266059SGregory Neil Shapiro #   define FORK	fork		/* SecureWare wants the real fork! */
131140266059SGregory Neil Shapiro #  else /* SECUREWARE */
131240266059SGregory Neil Shapiro #   define FORK	vfork		/* the rest of the OS versions don't care */
131340266059SGregory Neil Shapiro #  endif /* SECUREWARE */
131440266059SGregory Neil Shapiro # endif /* _CONVEX_SOURCE */
131540266059SGregory Neil Shapiro 
131640266059SGregory Neil Shapiro 
131740266059SGregory Neil Shapiro /*
131840266059SGregory Neil Shapiro **  RISC/os 4.52
131940266059SGregory Neil Shapiro **
132040266059SGregory Neil Shapiro **	Gives a ton of warning messages, but otherwise compiles.
132140266059SGregory Neil Shapiro */
132240266059SGregory Neil Shapiro 
132340266059SGregory Neil Shapiro # ifdef RISCOS
132440266059SGregory Neil Shapiro 
132540266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(3) call */
132640266059SGregory Neil Shapiro #  ifndef HASFLOCK
132740266059SGregory Neil Shapiro #   define HASFLOCK	1	/* has flock(2) call */
132840266059SGregory Neil Shapiro #  endif /* ! HASFLOCK */
132940266059SGregory Neil Shapiro #  define WAITUNION	1	/* use "union wait" as wait argument type */
133040266059SGregory Neil Shapiro #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
133140266059SGregory Neil Shapiro #  define NEEDPUTENV	1	/* need putenv(3) call */
133240266059SGregory Neil Shapiro #  define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
133340266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
133440266059SGregory Neil Shapiro #  define LA_TYPE	LA_INT
133540266059SGregory Neil Shapiro #  define LA_AVENRUN	"avenrun"
133640266059SGregory Neil Shapiro #  define _PATH_UNIX	"/unix"
133740266059SGregory Neil Shapiro #  undef WIFEXITED
133840266059SGregory Neil Shapiro 
133940266059SGregory Neil Shapiro #  define setpgid	setpgrp
134040266059SGregory Neil Shapiro 
134140266059SGregory Neil Shapiro typedef int		pid_t;
134240266059SGregory Neil Shapiro #  define SIGFUNC_DEFINED
134340266059SGregory Neil Shapiro #  define SIGFUNC_RETURN	(0)
134440266059SGregory Neil Shapiro #  define SIGFUNC_DECL	int
134540266059SGregory Neil Shapiro typedef int		(*sigfunc_t)();
134640266059SGregory Neil Shapiro extern char		*getenv();
134740266059SGregory Neil Shapiro extern void		*malloc();
134840266059SGregory Neil Shapiro 
134940266059SGregory Neil Shapiro /* added for RISC/os 4.01...which is dumber than 4.50 */
135040266059SGregory Neil Shapiro #  ifdef RISCOS_4_0
135140266059SGregory Neil Shapiro #   ifndef ARBPTR_T
135240266059SGregory Neil Shapiro #    define ARBPTR_T	char *
135340266059SGregory Neil Shapiro #   endif /* ! ARBPTR_T */
135440266059SGregory Neil Shapiro #   undef HASFLOCK
135540266059SGregory Neil Shapiro #   define HASFLOCK	0
135640266059SGregory Neil Shapiro #  endif /* RISCOS_4_0 */
135740266059SGregory Neil Shapiro 
135840266059SGregory Neil Shapiro #  include <sys/time.h>
135940266059SGregory Neil Shapiro 
136040266059SGregory Neil Shapiro # endif /* RISCOS */
136140266059SGregory Neil Shapiro 
136240266059SGregory Neil Shapiro 
136340266059SGregory Neil Shapiro /*
136440266059SGregory Neil Shapiro **  Linux 0.99pl10 and above...
136540266059SGregory Neil Shapiro **
136640266059SGregory Neil Shapiro **  Thanks to, in reverse order of contact:
136740266059SGregory Neil Shapiro **
136840266059SGregory Neil Shapiro **	John Kennedy <warlock@csuchico.edu>
136940266059SGregory Neil Shapiro **	Andrew Pam <avatar@aus.xanadu.com>
137040266059SGregory Neil Shapiro **	Florian La Roche <rzsfl@rz.uni-sb.de>
137140266059SGregory Neil Shapiro **	Karl London <karl@borg.demon.co.uk>
137240266059SGregory Neil Shapiro **
137340266059SGregory Neil Shapiro **  NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style
137440266059SGregory Neil Shapiro **	file locking is no longer allowed.  In particular, make sure
137540266059SGregory Neil Shapiro **	your DBM library and sendmail are both using either flock(2)
137640266059SGregory Neil Shapiro **	*or* fcntl(2) file locking, but not both.
137740266059SGregory Neil Shapiro */
137840266059SGregory Neil Shapiro 
137940266059SGregory Neil Shapiro # ifdef __linux__
138040266059SGregory Neil Shapiro #  include <linux/version.h>
138140266059SGregory Neil Shapiro #  if !defined(KERNEL_VERSION)	/* not defined in 2.0.x kernel series */
138240266059SGregory Neil Shapiro #   define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
138340266059SGregory Neil Shapiro #  endif /* !defined(KERNEL_VERSION) */
138440266059SGregory Neil Shapiro #  define BSD		1	/* include BSD defines */
138540266059SGregory Neil Shapiro #  define HASSETREGID	1	/* use setregid(2) to set saved gid */
138640266059SGregory Neil Shapiro #  ifndef REQUIRES_DIR_FSYNC
138740266059SGregory Neil Shapiro #   define REQUIRES_DIR_FSYNC	1	/* requires fsync() on directory */
138840266059SGregory Neil Shapiro #  endif /* REQUIRES_DIR_FSYNC */
138940266059SGregory Neil Shapiro #  ifndef USESETEUID
139040266059SGregory Neil Shapiro #   define USESETEUID	0	/* has it due to POSIX, but doesn't work */
139140266059SGregory Neil Shapiro #  endif /* USESETEUID */
13925ef517c0SGregory Neil Shapiro #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
139340266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
139440266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(3) call */
139540266059SGregory Neil Shapiro #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
139640266059SGregory Neil Shapiro #  define GIDSET_T	gid_t	/* from <linux/types.h> */
139740266059SGregory Neil Shapiro #  ifndef HASGETUSERSHELL
139840266059SGregory Neil Shapiro #   define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
139940266059SGregory Neil Shapiro #  endif /* HASGETUSERSHELL */
140040266059SGregory Neil Shapiro #  ifndef IP_SRCROUTE
140140266059SGregory Neil Shapiro #   define IP_SRCROUTE	0	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
140240266059SGregory Neil Shapiro #  endif /* ! IP_SRCROUTE */
140340266059SGregory Neil Shapiro #  ifndef HAS_IN_H
140440266059SGregory Neil Shapiro #   define HAS_IN_H	1	/* use netinet/in.h */
140540266059SGregory Neil Shapiro #  endif /* ! HAS_IN_H */
140640266059SGregory Neil Shapiro #  ifndef USE_SIGLONGJMP
140740266059SGregory Neil Shapiro #   define USE_SIGLONGJMP	1 /* sigsetjmp needed for signal handling */
140840266059SGregory Neil Shapiro #  endif /* ! USE_SIGLONGJMP */
140940266059SGregory Neil Shapiro #  ifndef HASFLOCK
141040266059SGregory Neil Shapiro #   if LINUX_VERSION_CODE < 66399
141140266059SGregory Neil Shapiro #    define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
141240266059SGregory Neil Shapiro #   else /* LINUX_VERSION_CODE < 66399 */
1413e92d3f3fSGregory Neil Shapiro #     if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
141440266059SGregory Neil Shapiro #      define HASFLOCK	1	/* flock(2) fixed after 1.3.95 */
1415e92d3f3fSGregory Neil Shapiro #     else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
1416e92d3f3fSGregory Neil Shapiro #      define HASFLOCK	0	/* flock(2) is broken (again) after 2.4.0 */
1417e92d3f3fSGregory Neil Shapiro #     endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
141840266059SGregory Neil Shapiro #   endif /* LINUX_VERSION_CODE < 66399 */
141940266059SGregory Neil Shapiro #  endif /* ! HASFLOCK */
142040266059SGregory Neil Shapiro #  ifndef LA_TYPE
142140266059SGregory Neil Shapiro #   define LA_TYPE	LA_PROCSTR
142240266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
142340266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
142440266059SGregory Neil Shapiro #  define SPT_PADCHAR	'\0'		/* pad process title with nulls */
142540266059SGregory Neil Shapiro #  if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0))
142640266059SGregory Neil Shapiro #   ifndef HASURANDOMDEV
142740266059SGregory Neil Shapiro #    define HASURANDOMDEV 1	/* 2.0 (at least) has linux/drivers/char/random.c */
142840266059SGregory Neil Shapiro #   endif /* ! HASURANDOMDEV */
142940266059SGregory Neil Shapiro #  endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) */
1430a7ec597cSGregory Neil Shapiro #  if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1431a7ec597cSGregory Neil Shapiro #   define HASSTRERROR	1	/* has strerror(3) */
1432a7ec597cSGregory Neil Shapiro #  endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
143340266059SGregory Neil Shapiro #  ifndef TZ_TYPE
143440266059SGregory Neil Shapiro #   define TZ_TYPE	TZ_NONE		/* no standard for Linux */
143540266059SGregory Neil Shapiro #  endif /* ! TZ_TYPE */
1436739ac4d4SGregory Neil Shapiro #  if (__GLIBC__ >= 2)
1437739ac4d4SGregory Neil Shapiro #   include <paths.h>
1438739ac4d4SGregory Neil Shapiro #  endif /* (__GLIBC__ >= 2) */
143940266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
144040266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
144140266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
144240266059SGregory Neil Shapiro #  include <sys/sysmacros.h>
144340266059SGregory Neil Shapiro #  undef atol			/* wounded in <stdlib.h> */
144440266059SGregory Neil Shapiro #  if NETINET6
144540266059SGregory Neil Shapiro    /*
144640266059SGregory Neil Shapiro    **  Linux doesn't have a good way to tell userland what interfaces are
144740266059SGregory Neil Shapiro    **  IPv6-capable.  Therefore, the BIND resolver can not determine if there
144840266059SGregory Neil Shapiro    **  are IPv6 interfaces to honor AI_ADDRCONFIG.  Unfortunately, it assumes
144940266059SGregory Neil Shapiro    **  that none are present.  (Excuse the macro name ADDRCONFIG_IS_BROKEN.)
145040266059SGregory Neil Shapiro    */
145140266059SGregory Neil Shapiro #   define ADDRCONFIG_IS_BROKEN	1
145240266059SGregory Neil Shapiro 
145340266059SGregory Neil Shapiro    /*
145440266059SGregory Neil Shapiro    **  Indirectly included from glibc's <feature.h>.  IPv6 support is native
145540266059SGregory Neil Shapiro    **  in 2.1 and later, but the APIs appear before the functions.
145640266059SGregory Neil Shapiro    */
145740266059SGregory Neil Shapiro #   if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
145840266059SGregory Neil Shapiro #    define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__)
145940266059SGregory Neil Shapiro #    if (GLIBC_VERSION >= 0x201)
146040266059SGregory Neil Shapiro #     undef IPPROTO_ICMPV6	/* linux #defines, glibc enums */
146140266059SGregory Neil Shapiro #    else /* (GLIBC_VERSION >= 0x201) */
146240266059SGregory Neil Shapiro #     include <linux/in6.h>	/* IPv6 support */
146340266059SGregory Neil Shapiro #    endif /* (GLIBC_VERSION >= 0x201) */
146440266059SGregory Neil Shapiro #    if (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE))
146540266059SGregory Neil Shapiro      /* Have APIs in <netdb.h>, but no support in glibc */
146640266059SGregory Neil Shapiro #     define NEEDSGETIPNODE	1
146740266059SGregory Neil Shapiro #    endif /* (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) */
146840266059SGregory Neil Shapiro #    undef GLIBC_VERSION
146940266059SGregory Neil Shapiro #   endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
147040266059SGregory Neil Shapiro #  endif /* NETINET6 */
147140266059SGregory Neil Shapiro #  ifndef HASFCHOWN
147240266059SGregory Neil Shapiro #   define HASFCHOWN	1	/* fchown(2) */
147340266059SGregory Neil Shapiro #  endif /* ! HASFCHOWN */
147440266059SGregory Neil Shapiro #  if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD)
147540266059SGregory Neil Shapiro #    define HASFCHMOD	1	/* fchmod(2) */
147640266059SGregory Neil Shapiro #  endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) */
147740266059SGregory Neil Shapiro # endif /* __linux__ */
147840266059SGregory Neil Shapiro 
147940266059SGregory Neil Shapiro 
148040266059SGregory Neil Shapiro /*
148140266059SGregory Neil Shapiro **  DELL SVR4 Issue 2.2, and others
148240266059SGregory Neil Shapiro **	From Kimmo Suominen <kim@grendel.lut.fi>
148340266059SGregory Neil Shapiro **
148440266059SGregory Neil Shapiro **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
148540266059SGregory Neil Shapiro **	defined, and the definitions conflict.
148640266059SGregory Neil Shapiro **
148740266059SGregory Neil Shapiro **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
148840266059SGregory Neil Shapiro **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
148940266059SGregory Neil Shapiro **	(SVR4.0/386 version 3.0).
149040266059SGregory Neil Shapiro */
149140266059SGregory Neil Shapiro 
149240266059SGregory Neil Shapiro # ifdef DELL_SVR4
149340266059SGregory Neil Shapiro 				/* no changes necessary */
149440266059SGregory Neil Shapiro 				/* see general __svr4__ defines below */
149540266059SGregory Neil Shapiro # endif /* DELL_SVR4 */
149640266059SGregory Neil Shapiro 
149740266059SGregory Neil Shapiro 
149840266059SGregory Neil Shapiro /*
149940266059SGregory Neil Shapiro **  Apple A/UX 3.0
150040266059SGregory Neil Shapiro */
150140266059SGregory Neil Shapiro 
150240266059SGregory Neil Shapiro # ifdef _AUX_SOURCE
150340266059SGregory Neil Shapiro #  include <sys/sysmacros.h>
150440266059SGregory Neil Shapiro #  define BSD			/* has BSD routines */
150540266059SGregory Neil Shapiro #  define HASSETRLIMIT	0	/* ... but not setrlimit(2) */
150640266059SGregory Neil Shapiro #  define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
150740266059SGregory Neil Shapiro #  define BOGUS_O_EXCL	1	/* exclusive open follows symlinks */
150840266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
150940266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
151040266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
151140266059SGregory Neil Shapiro #  define HASSETVBUF	1	/* has setvbuf(3) in libc */
151240266059SGregory Neil Shapiro #  define HASSTRERROR	1	/* has strerror(3) */
151340266059SGregory Neil Shapiro #  define SIGFUNC_DEFINED	/* sigfunc_t already defined */
151440266059SGregory Neil Shapiro #  define SIGFUNC_RETURN		/* POSIX-mode */
151540266059SGregory Neil Shapiro #  define SIGFUNC_DECL	void	/* POSIX-mode */
151640266059SGregory Neil Shapiro #  define ERRLIST_PREDEFINED	1
151740266059SGregory Neil Shapiro #  ifndef IDENTPROTO
151840266059SGregory Neil Shapiro #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
151940266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
152040266059SGregory Neil Shapiro #  ifndef LA_TYPE
152140266059SGregory Neil Shapiro #   define LA_TYPE	LA_INT
152240266059SGregory Neil Shapiro #   define FSHIFT	16
152340266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
152440266059SGregory Neil Shapiro #  define LA_AVENRUN	"avenrun"
152540266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
152640266059SGregory Neil Shapiro #  define TZ_TYPE	TZ_TZNAME
152740266059SGregory Neil Shapiro #  ifndef _PATH_UNIX
152840266059SGregory Neil Shapiro #   define _PATH_UNIX		"/unix"		/* should be in <paths.h> */
152940266059SGregory Neil Shapiro #  endif /* ! _PATH_UNIX */
153040266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
153140266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
153240266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
153340266059SGregory Neil Shapiro #  undef WIFEXITED
153440266059SGregory Neil Shapiro #  undef WEXITSTATUS
153540266059SGregory Neil Shapiro # endif /* _AUX_SOURCE */
153640266059SGregory Neil Shapiro 
153740266059SGregory Neil Shapiro 
153840266059SGregory Neil Shapiro /*
153940266059SGregory Neil Shapiro **  Encore UMAX V
154040266059SGregory Neil Shapiro **
154140266059SGregory Neil Shapiro **	Not extensively tested.
154240266059SGregory Neil Shapiro */
154340266059SGregory Neil Shapiro 
154440266059SGregory Neil Shapiro # ifdef UMAXV
154540266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
154640266059SGregory Neil Shapiro #  define HASSETVBUF	1	/* we have setvbuf(3) in libc */
154740266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
154840266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
154940266059SGregory Neil Shapiro #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
155040266059SGregory Neil Shapiro #  define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
155140266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
155240266059SGregory Neil Shapiro #  define MAXPATHLEN	PATH_MAX
155340266059SGregory Neil Shapiro extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
155440266059SGregory Neil Shapiro extern struct group	*getgrent(), *getgrnam(), *getgrgid();
155540266059SGregory Neil Shapiro #  undef WIFEXITED
155640266059SGregory Neil Shapiro #  undef WEXITSTATUS
155740266059SGregory Neil Shapiro # endif /* UMAXV */
155840266059SGregory Neil Shapiro 
155940266059SGregory Neil Shapiro 
156040266059SGregory Neil Shapiro /*
156140266059SGregory Neil Shapiro **  Stardent Titan 3000 running TitanOS 4.2.
156240266059SGregory Neil Shapiro **
156340266059SGregory Neil Shapiro **	Must be compiled in "cc -43" mode.
156440266059SGregory Neil Shapiro **
156540266059SGregory Neil Shapiro **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
156640266059SGregory Neil Shapiro **
156740266059SGregory Neil Shapiro **	Note the tweaking below after the BSD defines are set.
156840266059SGregory Neil Shapiro */
156940266059SGregory Neil Shapiro 
157040266059SGregory Neil Shapiro # ifdef titan
157140266059SGregory Neil Shapiro #  define setpgid	setpgrp
157240266059SGregory Neil Shapiro typedef int		pid_t;
157340266059SGregory Neil Shapiro #  undef WIFEXITED
157440266059SGregory Neil Shapiro #  undef WEXITSTATUS
157540266059SGregory Neil Shapiro # endif /* titan */
157640266059SGregory Neil Shapiro 
157740266059SGregory Neil Shapiro 
157840266059SGregory Neil Shapiro /*
157940266059SGregory Neil Shapiro **  Sequent DYNIX 3.2.0
158040266059SGregory Neil Shapiro **
158140266059SGregory Neil Shapiro **	From Jim Davis <jdavis@cs.arizona.edu>.
158240266059SGregory Neil Shapiro */
158340266059SGregory Neil Shapiro 
158440266059SGregory Neil Shapiro # ifdef sequent
158540266059SGregory Neil Shapiro 
158640266059SGregory Neil Shapiro #  define BSD		1
158740266059SGregory Neil Shapiro #  define HASUNSETENV	1
158840266059SGregory Neil Shapiro #  define BSD4_3		1	/* to get signal() in conf.c */
158940266059SGregory Neil Shapiro #  define WAITUNION	1
159040266059SGregory Neil Shapiro #  define LA_TYPE	LA_FLOAT
159140266059SGregory Neil Shapiro #  ifdef _POSIX_VERSION
159240266059SGregory Neil Shapiro #   undef _POSIX_VERSION		/* set in <unistd.h> */
159340266059SGregory Neil Shapiro #  endif /* _POSIX_VERSION */
159440266059SGregory Neil Shapiro #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
159540266059SGregory Neil Shapiro #  define setpgid	setpgrp
159640266059SGregory Neil Shapiro 
159740266059SGregory Neil Shapiro /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
159840266059SGregory Neil Shapiro #  undef	WIFEXITED
159940266059SGregory Neil Shapiro #  define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
160040266059SGregory Neil Shapiro 			 ((union wait*)&(s))->w_termsig == 0)
160140266059SGregory Neil Shapiro #  define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
160240266059SGregory Neil Shapiro typedef int		pid_t;
160340266059SGregory Neil Shapiro #  define isgraph(c)	(isprint(c) && (c != ' '))
160440266059SGregory Neil Shapiro 
160540266059SGregory Neil Shapiro #  ifndef IDENTPROTO
160640266059SGregory Neil Shapiro #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
160740266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
160840266059SGregory Neil Shapiro 
160940266059SGregory Neil Shapiro #  ifndef _PATH_UNIX
161040266059SGregory Neil Shapiro #   define _PATH_UNIX		"/dynix"
161140266059SGregory Neil Shapiro #  endif /* ! _PATH_UNIX */
161240266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
161340266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
161440266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
161540266059SGregory Neil Shapiro # endif /* sequent */
161640266059SGregory Neil Shapiro 
161740266059SGregory Neil Shapiro 
161840266059SGregory Neil Shapiro /*
161940266059SGregory Neil Shapiro **  Sequent DYNIX/ptx v2.0 (and higher)
162040266059SGregory Neil Shapiro **
162140266059SGregory Neil Shapiro **	For DYNIX/ptx v1.x, undefine HASSETREUID.
162240266059SGregory Neil Shapiro **
162340266059SGregory Neil Shapiro **	From Tim Wright <timw@sequent.com>.
162440266059SGregory Neil Shapiro **	Update from Jack Woolley <jwoolley@sctcorp.com>, 26 Dec 1995,
162540266059SGregory Neil Shapiro **		for DYNIX/ptx 4.0.2.
162640266059SGregory Neil Shapiro */
162740266059SGregory Neil Shapiro 
162840266059SGregory Neil Shapiro # ifdef _SEQUENT_
162940266059SGregory Neil Shapiro #  include <sys/stream.h>
163040266059SGregory Neil Shapiro #  define SYSTEM5	1	/* include all the System V defines */
163140266059SGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
163240266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
163340266059SGregory Neil Shapiro #  define HASSETREUID	1	/* has setreuid(2) call */
163440266059SGregory Neil Shapiro #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
163540266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
163640266059SGregory Neil Shapiro #  define LA_TYPE	LA_INT
163740266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
163840266059SGregory Neil Shapiro #  define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
163940266059SGregory Neil Shapiro #  ifndef IDENTPROTO
164040266059SGregory Neil Shapiro #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
164140266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
164240266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
164340266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
164440266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
164540266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
164640266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
164740266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
164840266059SGregory Neil Shapiro # endif /* _SEQUENT_ */
164940266059SGregory Neil Shapiro 
165040266059SGregory Neil Shapiro /*
1651e92d3f3fSGregory Neil Shapiro **  Cray UNICOS, UNICOS/mk, and UNICOS/mp
165240266059SGregory Neil Shapiro **
1653e92d3f3fSGregory Neil Shapiro **    UNICOS:
165440266059SGregory Neil Shapiro **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
1655e92d3f3fSGregory Neil Shapiro **	Update Brian Ginsbach <ginsbach@cray.com>
1656e92d3f3fSGregory Neil Shapiro **    UNICOS/mk (Cray T3E):
1657e92d3f3fSGregory Neil Shapiro **	Contributed by Manu Mahonen <mailadm@csc.fi>
1658e92d3f3fSGregory Neil Shapiro **	of Center for Scientific Computing.
1659e92d3f3fSGregory Neil Shapiro **	Update Brian Ginsbach <ginsbach@cray.com>
1660e92d3f3fSGregory Neil Shapiro **    UNICOS/mp:
1661e92d3f3fSGregory Neil Shapiro **	From Aaron Davis <awd@cray.com> & Brian Ginsbach <ginsbach@cray.com>
166240266059SGregory Neil Shapiro */
166340266059SGregory Neil Shapiro 
1664e92d3f3fSGregory Neil Shapiro # if defined(_CRAY) || defined(UNICOS) || defined(_UNICOSMP)
166540266059SGregory Neil Shapiro #  define SYSTEM5	1	/* include all the System V defines */
1666e92d3f3fSGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
1667e92d3f3fSGregory Neil Shapiro #  define HASFCHOWN	1	/* has fchown(2) */
1668e92d3f3fSGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(3) call */
1669e92d3f3fSGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
1670e92d3f3fSGregory Neil Shapiro #  define HASSETREUID	1	/* has setreuid(2) call */
1671e92d3f3fSGregory Neil Shapiro #  define USESETEUID	1	/* has usable seteuid(2) call */
1672e92d3f3fSGregory Neil Shapiro #  define HASGETDTABLESIZE 1	/* has getdtablesize(2) syscall */
1673e92d3f3fSGregory Neil Shapiro #  define HASSTRERROR	1	/* has strerror(3) */
1674e92d3f3fSGregory Neil Shapiro #  define GIDSET_T	gid_t
167540266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
167640266059SGregory Neil Shapiro #  define SFS_BAVAIL	f_bfree	/* alternate field name */
1677e92d3f3fSGregory Neil Shapiro #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
1678e92d3f3fSGregory Neil Shapiro #  ifdef UNICOS
1679e92d3f3fSGregory Neil Shapiro #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1680e92d3f3fSGregory Neil Shapiro #   define LA_TYPE	LA_ZERO
1681e92d3f3fSGregory Neil Shapiro #   define _PATH_MAILDIR	"/usr/spool/mail"
1682e92d3f3fSGregory Neil Shapiro #   define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst)
1683e92d3f3fSGregory Neil Shapiro #   ifndef MAXPATHLEN
1684e92d3f3fSGregory Neil Shapiro #    define MAXPATHLEN PATHSIZE
1685e92d3f3fSGregory Neil Shapiro #   endif /* ! MAXPATHLEN */
1686e92d3f3fSGregory Neil Shapiro #   ifndef _PATH_UNIX
1687e92d3f3fSGregory Neil Shapiro #    ifdef UNICOSMK
1688e92d3f3fSGregory Neil Shapiro #     define _PATH_UNIX		"/unicosmk.ar"
1689e92d3f3fSGregory Neil Shapiro #    else
1690e92d3f3fSGregory Neil Shapiro #     define _PATH_UNIX		"/unicos"
1691e92d3f3fSGregory Neil Shapiro #    endif /* UNICOSMK */
1692e92d3f3fSGregory Neil Shapiro #   endif /* ! _PATH_UNIX */
1693e92d3f3fSGregory Neil Shapiro #   ifndef _PATH_VENDOR_CF
1694e92d3f3fSGregory Neil Shapiro #    define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1695e92d3f3fSGregory Neil Shapiro #   endif /* ! _PATH_VENDOR_CF */
169640266059SGregory Neil Shapiro #  endif /* UNICOS */
1697e92d3f3fSGregory Neil Shapiro #  ifdef _UNICOSMP
1698e92d3f3fSGregory Neil Shapiro #  if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
1699e92d3f3fSGregory Neil Shapiro     /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */
1700e92d3f3fSGregory Neil Shapiro #   define _SC_NPROCESSORS_ONLN  _SC_NPROC_ONLN
1701e92d3f3fSGregory Neil Shapiro #  endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */
1702e92d3f3fSGregory Neil Shapiro #   define HASGETUSERSHELL 0		/* does not have getusershell(3) call */
1703e92d3f3fSGregory Neil Shapiro #   define HASSETRLIMIT	   1		/* has setrlimit(2) syscall */
1704e92d3f3fSGregory Neil Shapiro #   define LA_TYPE	LA_IRIX6	/* figure out at run time */
1705e92d3f3fSGregory Neil Shapiro #   include <sys/cdefs.h>
1706e92d3f3fSGregory Neil Shapiro #   include <paths.h>
1707e92d3f3fSGregory Neil Shapiro #   define ARGV_T char *const *
1708e92d3f3fSGregory Neil Shapiro #  endif /* _UNICOSMP */
1709e92d3f3fSGregory Neil Shapiro # endif /* _CRAY */
171040266059SGregory Neil Shapiro 
171140266059SGregory Neil Shapiro /*
171240266059SGregory Neil Shapiro **  Apollo DomainOS
171340266059SGregory Neil Shapiro **
171440266059SGregory Neil Shapiro **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
171540266059SGregory Neil Shapiro **
171640266059SGregory Neil Shapiro **  15 Jan 1994; updated 2 Aug 1995
171740266059SGregory Neil Shapiro **
171840266059SGregory Neil Shapiro */
171940266059SGregory Neil Shapiro 
172040266059SGregory Neil Shapiro # ifdef apollo
172140266059SGregory Neil Shapiro #  define HASSETREUID	1	/* has setreuid(2) call */
172240266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(2) call */
172340266059SGregory Neil Shapiro #  define IP_SRCROUTE	0	/* does not have <netinet/ip_var.h> */
172440266059SGregory Neil Shapiro #  define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
172540266059SGregory Neil Shapiro #  define LA_TYPE	LA_SUBR		/* use getloadavg.c */
172640266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
172740266059SGregory Neil Shapiro #  define SFS_BAVAIL	f_bfree		/* alternate field name */
172840266059SGregory Neil Shapiro #  define TZ_TYPE	TZ_TZNAME
172940266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
173040266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
173140266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
173240266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
173340266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
173440266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
173540266059SGregory Neil Shapiro #  undef	 S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
173640266059SGregory Neil Shapiro #  undef	 S_IFIFO
173740266059SGregory Neil Shapiro #  define S_IFIFO	0010000
173840266059SGregory Neil Shapiro #  ifndef IDENTPROTO
173940266059SGregory Neil Shapiro #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
174040266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
174140266059SGregory Neil Shapiro #  define RLIMIT_NEEDS_SYS_TIME_H	1
174240266059SGregory Neil Shapiro #  if defined(NGROUPS_MAX) && !NGROUPS_MAX
174340266059SGregory Neil Shapiro #   undef NGROUPS_MAX
174440266059SGregory Neil Shapiro #  endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */
174540266059SGregory Neil Shapiro # endif /* apollo */
174640266059SGregory Neil Shapiro 
174740266059SGregory Neil Shapiro /*
174840266059SGregory Neil Shapiro **  MPE-iX
174940266059SGregory Neil Shapiro **
175040266059SGregory Neil Shapiro **	Requires MPE 6.0 or greater.  See sendmail/README for more info.
175140266059SGregory Neil Shapiro **
175240266059SGregory Neil Shapiro **	From Mark Bixby <mark_bixby@hp.com> or <mark@bixby.org>.
175340266059SGregory Neil Shapiro */
175440266059SGregory Neil Shapiro 
175540266059SGregory Neil Shapiro # ifdef MPE
175640266059SGregory Neil Shapiro 
175740266059SGregory Neil Shapiro #  include <sys/sysmacros.h>
175840266059SGregory Neil Shapiro #  include <fcntl.h>
175940266059SGregory Neil Shapiro 
176040266059SGregory Neil Shapiro /* Sendmail stuff */
176140266059SGregory Neil Shapiro #  define HASFCHOWN		0	/* lacks fchown() */
176240266059SGregory Neil Shapiro #  define HASGETUSERSHELL	0	/* lacks getusershell() */
176340266059SGregory Neil Shapiro #  ifdef HASNICE
176440266059SGregory Neil Shapiro #   undef  HASNICE
176540266059SGregory Neil Shapiro #  endif /* HASNICE */
176640266059SGregory Neil Shapiro #  define HASNICE		0	/* lacks nice() */
176740266059SGregory Neil Shapiro #  define HASRANDOM		0	/* lacks random() */
176840266059SGregory Neil Shapiro #  ifdef HASRRESVPORT
176940266059SGregory Neil Shapiro #   undef HASRRESVPORT
177040266059SGregory Neil Shapiro #  endif /* HASRRESVPORT */
177140266059SGregory Neil Shapiro #  define HASRRESVPORT		0	/* lacks rresvport() */
177240266059SGregory Neil Shapiro #  define IP_SRCROUTE		0	/* lacks IP source routing fields */
177340266059SGregory Neil Shapiro #  ifdef MATCHGECOS
177440266059SGregory Neil Shapiro #   undef MATCHGECOS
177540266059SGregory Neil Shapiro #  endif /* MATCHGECOS */
177640266059SGregory Neil Shapiro #  define MATCHGECOS		0	/* lacks an initialized GECOS field */
177740266059SGregory Neil Shapiro #  define NEEDFSYNC		1	/* use sendmail's fsync() */
177840266059SGregory Neil Shapiro #  define NEEDLINK		1	/* use sendmail's link() */
177940266059SGregory Neil Shapiro #  define NOFTRUNCATE		1	/* lacks ftruncate() */
178040266059SGregory Neil Shapiro #  define SFS_TYPE		SFS_NONE /* can't determine disk space */
178140266059SGregory Neil Shapiro #  define SM_CONF_SYSLOG	0	/* use sendmail decl of syslog() */
178240266059SGregory Neil Shapiro #  define USE_DOUBLE_FORK	0	/* don't fork an intermediate zombie */
178340266059SGregory Neil Shapiro #  define USE_ENVIRON		1	/* use environ instead of envp */
178440266059SGregory Neil Shapiro 
178540266059SGregory Neil Shapiro /* Missing header stuff */
178640266059SGregory Neil Shapiro #  define AF_UNSPEC		0
178740266059SGregory Neil Shapiro #  define AF_MAX		AF_INET
178840266059SGregory Neil Shapiro #  define IFF_LOOPBACK		0x8
178940266059SGregory Neil Shapiro #  define IN_LOOPBACKNET	127
179040266059SGregory Neil Shapiro #  define MAXNAMLEN		NAME_MAX
179140266059SGregory Neil Shapiro #  define S_IEXEC		S_IXUSR
179240266059SGregory Neil Shapiro #  define S_IREAD		S_IRUSR
179340266059SGregory Neil Shapiro #  define S_IWRITE		S_IWUSR
179440266059SGregory Neil Shapiro 
179540266059SGregory Neil Shapiro /* Present header stuff that needs to be missing */
179640266059SGregory Neil Shapiro #  undef NGROUPS_MAX
179740266059SGregory Neil Shapiro 
179840266059SGregory Neil Shapiro /* Shadow functions */
179940266059SGregory Neil Shapiro #  define bind		sendmail_mpe_bind
180040266059SGregory Neil Shapiro #  define _exit		sendmail_mpe__exit
180140266059SGregory Neil Shapiro #  define exit		sendmail_mpe_exit
180240266059SGregory Neil Shapiro #  define fcntl		sendmail_mpe_fcntl
180340266059SGregory Neil Shapiro #  define getegid	sendmail_mpe_getegid
180440266059SGregory Neil Shapiro #  define geteuid	sendmail_mpe_geteuid
180540266059SGregory Neil Shapiro #  define getpwnam	sendmail_mpe_getpwnam
180640266059SGregory Neil Shapiro #  define getpwuid	sendmail_mpe_getpwuid
180740266059SGregory Neil Shapiro #  define setgid	sendmail_mpe_setgid
180840266059SGregory Neil Shapiro #  define setuid	sendmail_mpe_setuid
180940266059SGregory Neil Shapiro extern int		sendmail_mpe_fcntl __P((int, int, ...));
181040266059SGregory Neil Shapiro extern struct passwd *	sendmail_mpe_getpwnam __P((const char *));
181140266059SGregory Neil Shapiro extern struct passwd *	sendmail_mpe_getpwuid __P((uid_t));
181240266059SGregory Neil Shapiro # endif /* MPE */
181340266059SGregory Neil Shapiro 
181440266059SGregory Neil Shapiro /*
181540266059SGregory Neil Shapiro **  System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native)
181640266059SGregory Neil Shapiro **
181740266059SGregory Neil Shapiro **	Contributed by Paul Gampe <paulg@apnic.net>
181840266059SGregory Neil Shapiro */
181940266059SGregory Neil Shapiro 
182040266059SGregory Neil Shapiro # ifdef __svr5__
182140266059SGregory Neil Shapiro #  include <sys/mkdev.h>
182240266059SGregory Neil Shapiro #  define __svr4__
182340266059SGregory Neil Shapiro #  define SYS5SIGNALS		1
182440266059SGregory Neil Shapiro #  define HASFCHOWN		1	/* has fchown(2) call */
1825e92d3f3fSGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
182640266059SGregory Neil Shapiro #  define HASSETREUID		1
182740266059SGregory Neil Shapiro #  define HASWAITPID		1
182840266059SGregory Neil Shapiro #  define HASGETDTABLESIZE	1
182940266059SGregory Neil Shapiro #  define GIDSET_T		gid_t
183040266059SGregory Neil Shapiro #  define SOCKADDR_LEN_T	size_t
183140266059SGregory Neil Shapiro #  define SOCKOPT_LEN_T		size_t
183240266059SGregory Neil Shapiro #  ifndef _PATH_UNIX
183340266059SGregory Neil Shapiro #   define _PATH_UNIX		"/stand/unix"
183440266059SGregory Neil Shapiro #  endif /* ! _PATH_UNIX */
183540266059SGregory Neil Shapiro #  define SPT_PADCHAR		'\0'	/* pad process title with nulls */
183640266059SGregory Neil Shapiro #  ifndef SYSLOG_BUFSIZE
183740266059SGregory Neil Shapiro #   define SYSLOG_BUFSIZE	1024	/* unsure */
183840266059SGregory Neil Shapiro #  endif /* ! SYSLOG_BUFSIZE */
183940266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
184040266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/etc/sendmail.cf"
184140266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
184240266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
184340266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
184440266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
184540266059SGregory Neil Shapiro #  undef offsetof		/* avoid stddefs.h, sys/sysmacros.h conflict */
184640266059SGregory Neil Shapiro #if !defined(SM_SET_H_ERRNO) && defined(_REENTRANT)
184740266059SGregory Neil Shapiro # define SM_SET_H_ERRNO(err)	set_h_errno((err))
184840266059SGregory Neil Shapiro #endif /* ! SM_SET_H_ERRNO && _REENTRANT */
184940266059SGregory Neil Shapiro # endif /* __svr5__ */
185040266059SGregory Neil Shapiro 
185140266059SGregory Neil Shapiro /* ###################################################################### */
185240266059SGregory Neil Shapiro 
185340266059SGregory Neil Shapiro /*
185440266059SGregory Neil Shapiro **  UnixWare 2.x
185540266059SGregory Neil Shapiro */
185640266059SGregory Neil Shapiro 
185740266059SGregory Neil Shapiro # ifdef UNIXWARE2
185840266059SGregory Neil Shapiro #  define UNIXWARE	1
185940266059SGregory Neil Shapiro #  undef offsetof		/* avoid stddefs.h, sys/sysmacros.h conflict */
186040266059SGregory Neil Shapiro # endif /* UNIXWARE2 */
186140266059SGregory Neil Shapiro 
186240266059SGregory Neil Shapiro 
186340266059SGregory Neil Shapiro /*
186440266059SGregory Neil Shapiro **  UnixWare 1.1.2.
186540266059SGregory Neil Shapiro **
186640266059SGregory Neil Shapiro **	Updated by Petr Lampa <lampa@fee.vutbr.cz>.
186740266059SGregory Neil Shapiro **	From Evan Champion <evanc@spatial.synapse.org>.
186840266059SGregory Neil Shapiro */
186940266059SGregory Neil Shapiro 
187040266059SGregory Neil Shapiro # ifdef UNIXWARE
187140266059SGregory Neil Shapiro #  include <sys/mkdev.h>
187240266059SGregory Neil Shapiro #  define SYSTEM5		1
187340266059SGregory Neil Shapiro #  define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
187440266059SGregory Neil Shapiro #  define HASSETREUID		1
1875e92d3f3fSGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
187640266059SGregory Neil Shapiro #  define HASINITGROUPS		1
187740266059SGregory Neil Shapiro #  define GIDSET_T		gid_t
187840266059SGregory Neil Shapiro #  define SLEEP_T		unsigned
187940266059SGregory Neil Shapiro #  define SFS_TYPE		SFS_STATVFS
188040266059SGregory Neil Shapiro #  define LA_TYPE		LA_ZERO
188140266059SGregory Neil Shapiro #  undef WIFEXITED
188240266059SGregory Neil Shapiro #  undef WEXITSTATUS
188340266059SGregory Neil Shapiro #  ifndef _PATH_UNIX
188440266059SGregory Neil Shapiro #   define _PATH_UNIX		"/unix"
188540266059SGregory Neil Shapiro #  endif /* ! _PATH_UNIX */
188640266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
188740266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
188840266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
188940266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
189040266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
189140266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
189240266059SGregory Neil Shapiro #  define SYSLOG_BUFSIZE	128
189340266059SGregory Neil Shapiro # endif /* UNIXWARE */
189440266059SGregory Neil Shapiro 
189540266059SGregory Neil Shapiro 
189640266059SGregory Neil Shapiro /*
189740266059SGregory Neil Shapiro **  Intergraph CLIX 3.1
189840266059SGregory Neil Shapiro **
189940266059SGregory Neil Shapiro **	From Paul Southworth <pauls@locust.cic.net>
190040266059SGregory Neil Shapiro */
190140266059SGregory Neil Shapiro 
190240266059SGregory Neil Shapiro # ifdef CLIX
190340266059SGregory Neil Shapiro #  define SYSTEM5	1	/* looks like System V */
190440266059SGregory Neil Shapiro #  ifndef HASGETUSERSHELL
190540266059SGregory Neil Shapiro #   define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
190640266059SGregory Neil Shapiro #  endif /* ! HASGETUSERSHELL */
190740266059SGregory Neil Shapiro #  define DEV_BSIZE	512	/* device block size not defined */
190840266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
190940266059SGregory Neil Shapiro #  undef LOG			/* syslog not available */
191040266059SGregory Neil Shapiro #  define NEEDFSYNC	1	/* no fsync in system library */
191140266059SGregory Neil Shapiro #  define GETSHORT	_getshort
191240266059SGregory Neil Shapiro # endif /* CLIX */
191340266059SGregory Neil Shapiro 
191440266059SGregory Neil Shapiro 
191540266059SGregory Neil Shapiro /*
191640266059SGregory Neil Shapiro **  NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP
191740266059SGregory Neil Shapiro **
191840266059SGregory Neil Shapiro **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
191940266059SGregory Neil Shapiro */
192040266059SGregory Neil Shapiro 
192140266059SGregory Neil Shapiro # ifdef NCR_MP_RAS2
192240266059SGregory Neil Shapiro #  include <sys/sockio.h>
192340266059SGregory Neil Shapiro #  define __svr4__
192440266059SGregory Neil Shapiro #  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
192540266059SGregory Neil Shapiro #  define SYSLOG_BUFSIZE	1024
192640266059SGregory Neil Shapiro #  define SPT_TYPE  SPT_NONE
192740266059SGregory Neil Shapiro # endif /* NCR_MP_RAS2 */
192840266059SGregory Neil Shapiro 
192940266059SGregory Neil Shapiro 
193040266059SGregory Neil Shapiro /*
193140266059SGregory Neil Shapiro **  NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP
193240266059SGregory Neil Shapiro **
193340266059SGregory Neil Shapiro **	From Tom Moore <Tom.Moore@DaytonOH.NCR.COM>
193440266059SGregory Neil Shapiro */
193540266059SGregory Neil Shapiro 
193640266059SGregory Neil Shapiro # ifdef NCR_MP_RAS3
193740266059SGregory Neil Shapiro #  define __svr4__
193840266059SGregory Neil Shapiro #  define HASFCHOWN		1	/* has fchown(2) call */
193940266059SGregory Neil Shapiro #  define LDA_USE_LOCKF		1
194040266059SGregory Neil Shapiro #  define SIOCGIFNUM_IS_BROKEN	1	/* SIOCGIFNUM has non-std interface */
194140266059SGregory Neil Shapiro #  define SO_REUSEADDR_IS_BROKEN	1	/* doesn't work if accept() fails */
194240266059SGregory Neil Shapiro #  define SYSLOG_BUFSIZE	1024
194340266059SGregory Neil Shapiro #  define SPT_TYPE	SPT_NONE
194440266059SGregory Neil Shapiro #  define _PATH_MAILDIR	"/var/mail"
194540266059SGregory Neil Shapiro #  ifndef _XOPEN_SOURCE
194640266059SGregory Neil Shapiro #   define _XOPEN_SOURCE
194740266059SGregory Neil Shapiro #   define _XOPEN_SOURCE_EXTENDED 1
194840266059SGregory Neil Shapiro #   include <sys/resource.h>
194940266059SGregory Neil Shapiro #   undef _XOPEN_SOURCE
195040266059SGregory Neil Shapiro #   undef _XOPEN_SOURCE_EXTENDED
195140266059SGregory Neil Shapiro #  endif /* ! _XOPEN_SOURCE */
195240266059SGregory Neil Shapiro # endif /* NCR_MP_RAS3 */
195340266059SGregory Neil Shapiro 
195440266059SGregory Neil Shapiro 
195540266059SGregory Neil Shapiro /*
195640266059SGregory Neil Shapiro **  Tandem NonStop-UX SVR4
195740266059SGregory Neil Shapiro **
195840266059SGregory Neil Shapiro **	From Rick McCarty <mccarty@mpd.tandem.com>.
195940266059SGregory Neil Shapiro */
196040266059SGregory Neil Shapiro 
196140266059SGregory Neil Shapiro # ifdef NonStop_UX_BXX
196240266059SGregory Neil Shapiro #  define __svr4__
196340266059SGregory Neil Shapiro # endif /* NonStop_UX_BXX */
196440266059SGregory Neil Shapiro 
196540266059SGregory Neil Shapiro 
196640266059SGregory Neil Shapiro /*
196740266059SGregory Neil Shapiro **  Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2.
196840266059SGregory Neil Shapiro **
196940266059SGregory Neil Shapiro **	Tested for 1.04, 1.03
197040266059SGregory Neil Shapiro **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
197140266059SGregory Neil Shapiro **
197240266059SGregory Neil Shapiro **	Tested for 4.02, 6.10 and 7.10
197340266059SGregory Neil Shapiro **	From Motonori NAKAMURA <motonori@media.kyoto-u.ac.jp>.
197440266059SGregory Neil Shapiro */
197540266059SGregory Neil Shapiro 
197640266059SGregory Neil Shapiro # if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE))
197740266059SGregory Neil Shapiro #  define SYSTEM5	1	/* include all the System V defines */
197840266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
197940266059SGregory Neil Shapiro #  define HASFCHMOD	1	/* has fchmod(2) syscall */
198040266059SGregory Neil Shapiro #  define setreuid(r, e)	setresuid(r, e, -1)
198140266059SGregory Neil Shapiro #  define LA_TYPE	LA_FLOAT
198240266059SGregory Neil Shapiro #  define SPT_TYPE	SPT_PSTAT
198340266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
198440266059SGregory Neil Shapiro #  ifndef HASSETVBUF
198540266059SGregory Neil Shapiro #   define HASSETVBUF	/* HI-UX has no setlinebuf */
198640266059SGregory Neil Shapiro #  endif /* ! HASSETVBUF */
198740266059SGregory Neil Shapiro #  ifndef GIDSET_T
198840266059SGregory Neil Shapiro #   define GIDSET_T	gid_t
198940266059SGregory Neil Shapiro #  endif /* ! GIDSET_T */
199040266059SGregory Neil Shapiro #  ifndef _PATH_UNIX
199140266059SGregory Neil Shapiro #   define _PATH_UNIX		"/HI-UX"
199240266059SGregory Neil Shapiro #  endif /* ! _PATH_UNIX */
199340266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
199440266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
199540266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
199640266059SGregory Neil Shapiro #  ifndef IDENTPROTO
199740266059SGregory Neil Shapiro #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
199840266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
199940266059SGregory Neil Shapiro #  ifndef HASGETUSERSHELL
200040266059SGregory Neil Shapiro #   define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
200140266059SGregory Neil Shapiro #  endif /* ! HASGETUSERSHELL */
200240266059SGregory Neil Shapiro #  define FDSET_CAST	(int *)	/* cast for fd_set parameters to select */
200340266059SGregory Neil Shapiro 
200440266059SGregory Neil Shapiro /*
200540266059SGregory Neil Shapiro **  avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h
200640266059SGregory Neil Shapiro **  on HIUX 3050
200740266059SGregory Neil Shapiro */
200840266059SGregory Neil Shapiro #  undef m_flags
200940266059SGregory Neil Shapiro 
201040266059SGregory Neil Shapiro #  define SM_CONF_SYSLOG	0
201140266059SGregory Neil Shapiro 
201240266059SGregory Neil Shapiro # endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */
201340266059SGregory Neil Shapiro 
201440266059SGregory Neil Shapiro 
201540266059SGregory Neil Shapiro /*
201640266059SGregory Neil Shapiro **  Amdahl UTS System V 2.1.5 (SVr3-based)
201740266059SGregory Neil Shapiro **
201840266059SGregory Neil Shapiro **    From: Janet Jackson <janet@dialix.oz.au>.
201940266059SGregory Neil Shapiro */
202040266059SGregory Neil Shapiro 
202140266059SGregory Neil Shapiro # ifdef _UTS
202240266059SGregory Neil Shapiro #  include <sys/sysmacros.h>
202340266059SGregory Neil Shapiro #  undef HASLSTAT		/* has symlinks, but they cause problems */
202440266059SGregory Neil Shapiro #  define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
202540266059SGregory Neil Shapiro #  define SYS5SIGNALS	1	/* System V signal semantics */
202640266059SGregory Neil Shapiro #  define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
202740266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
202840266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) function */
202940266059SGregory Neil Shapiro #  define HASSETVBUF	1	/* has setvbuf(3) function */
203040266059SGregory Neil Shapiro #  ifndef HASGETUSERSHELL
203140266059SGregory Neil Shapiro #   define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
203240266059SGregory Neil Shapiro #  endif /* ! HASGETUSERSHELL */
203340266059SGregory Neil Shapiro #  define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
203440266059SGregory Neil Shapiro #  define LA_TYPE	LA_ZERO		/* doesn't have load average */
203540266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
203640266059SGregory Neil Shapiro #  define SFS_BAVAIL	f_bfree		/* alternate field name */
203740266059SGregory Neil Shapiro #  define _PATH_UNIX		"/unix"
203840266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
203940266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
204040266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
204140266059SGregory Neil Shapiro # endif /* _UTS */
204240266059SGregory Neil Shapiro 
204340266059SGregory Neil Shapiro /*
204440266059SGregory Neil Shapiro **  Cray Computer Corporation's CSOS
204540266059SGregory Neil Shapiro **
204640266059SGregory Neil Shapiro **	From Scott Bolte <scott@craycos.com>.
204740266059SGregory Neil Shapiro */
204840266059SGregory Neil Shapiro 
204940266059SGregory Neil Shapiro # ifdef _CRAYCOM
205040266059SGregory Neil Shapiro #  define SYSTEM5	1	/* include all the System V defines */
205140266059SGregory Neil Shapiro #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
205240266059SGregory Neil Shapiro #  define NEEDFSYNC	1	/* no fsync in system library */
205340266059SGregory Neil Shapiro #  define MAXPATHLEN	PATHSIZE
205440266059SGregory Neil Shapiro #  define LA_TYPE	LA_ZERO
205540266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
205640266059SGregory Neil Shapiro #  define SFS_BAVAIL	f_bfree		/* alternate field name */
205740266059SGregory Neil Shapiro #  define _POSIX_CHOWN_RESTRICTED	-1
205840266059SGregory Neil Shapiro extern struct group	*getgrent(), *getgrnam(), *getgrgid();
205940266059SGregory Neil Shapiro # endif /* _CRAYCOM */
206040266059SGregory Neil Shapiro 
206140266059SGregory Neil Shapiro 
206240266059SGregory Neil Shapiro /*
206340266059SGregory Neil Shapiro **  Sony NEWS-OS 4.2.1R and 6.0.3
206440266059SGregory Neil Shapiro **
206540266059SGregory Neil Shapiro **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
206640266059SGregory Neil Shapiro */
206740266059SGregory Neil Shapiro 
206840266059SGregory Neil Shapiro # ifdef sony_news
206940266059SGregory Neil Shapiro #  ifndef __svr4
207040266059SGregory Neil Shapiro 			/* NEWS-OS 4.2.1R */
207140266059SGregory Neil Shapiro #   ifndef BSD
207240266059SGregory Neil Shapiro #    define BSD			/* has BSD routines */
207340266059SGregory Neil Shapiro #   endif /* ! BSD */
207440266059SGregory Neil Shapiro #   define HASUNSETENV	1	/* has unsetenv(2) call */
207540266059SGregory Neil Shapiro #   undef HASSETVBUF		/* don't actually have setvbuf(3) */
207640266059SGregory Neil Shapiro #   define WAITUNION	1	/* use "union wait" as wait argument type */
207740266059SGregory Neil Shapiro #   define LA_TYPE	LA_INT
207840266059SGregory Neil Shapiro #   define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
207940266059SGregory Neil Shapiro #   ifndef HASFLOCK
208040266059SGregory Neil Shapiro #    define HASFLOCK	1	/* has flock(2) call */
208140266059SGregory Neil Shapiro #   endif /* ! HASFLOCK */
208240266059SGregory Neil Shapiro #   define setpgid	setpgrp
208340266059SGregory Neil Shapiro #   undef WIFEXITED
208440266059SGregory Neil Shapiro #   undef WEXITSTATUS
208540266059SGregory Neil Shapiro #   define MODE_T	int	/* system include files have no mode_t */
208640266059SGregory Neil Shapiro typedef int		pid_t;
208740266059SGregory Neil Shapiro typedef int		(*sigfunc_t)();
208840266059SGregory Neil Shapiro #   define SIGFUNC_DEFINED
208940266059SGregory Neil Shapiro #   define SIGFUNC_RETURN	(0)
209040266059SGregory Neil Shapiro #   define SIGFUNC_DECL		int
209140266059SGregory Neil Shapiro 
209240266059SGregory Neil Shapiro #  else /* ! __svr4 */
209340266059SGregory Neil Shapiro 			/* NEWS-OS 6.0.3 with /bin/cc */
209440266059SGregory Neil Shapiro #   ifndef __svr4__
209540266059SGregory Neil Shapiro #    define __svr4__		/* use all System V Release 4 defines below */
209640266059SGregory Neil Shapiro #   endif /* ! __svr4__ */
2097e92d3f3fSGregory Neil Shapiro #   define HASSETSID	1	/* has POSIX setsid(2) call */
209840266059SGregory Neil Shapiro #   define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
209940266059SGregory Neil Shapiro #   define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
210040266059SGregory Neil Shapiro #   ifndef SPT_TYPE
210140266059SGregory Neil Shapiro #    define SPT_TYPE	SPT_SYSMIPS	/* use sysmips() (OS 6.0.2 or later) */
210240266059SGregory Neil Shapiro #   endif /* ! SPT_TYPE */
210340266059SGregory Neil Shapiro #   define GIDSET_T	gid_t
210440266059SGregory Neil Shapiro #   undef WIFEXITED
210540266059SGregory Neil Shapiro #   undef WEXITSTATUS
210640266059SGregory Neil Shapiro #   ifndef SYSLOG_BUFSIZE
210740266059SGregory Neil Shapiro #    define SYSLOG_BUFSIZE	256
210840266059SGregory Neil Shapiro #   endif /* ! SYSLOG_BUFSIZE */
210940266059SGregory Neil Shapiro #   define _PATH_UNIX		"/stand/unix"
211040266059SGregory Neil Shapiro #   ifndef _PATH_VENDOR_CF
211140266059SGregory Neil Shapiro #    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
211240266059SGregory Neil Shapiro #   endif /* ! _PATH_VENDOR_CF */
211340266059SGregory Neil Shapiro #   ifndef _PATH_SENDMAILPID
211440266059SGregory Neil Shapiro #    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
211540266059SGregory Neil Shapiro #   endif /* ! _PATH_SENDMAILPID */
211640266059SGregory Neil Shapiro 
211740266059SGregory Neil Shapiro #  endif /* ! __svr4 */
211840266059SGregory Neil Shapiro # endif /* sony_news */
211940266059SGregory Neil Shapiro 
212040266059SGregory Neil Shapiro 
212140266059SGregory Neil Shapiro /*
212240266059SGregory Neil Shapiro **  Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
212340266059SGregory Neil Shapiro **
212440266059SGregory Neil Shapiro **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
212540266059SGregory Neil Shapiro */
212640266059SGregory Neil Shapiro 
212740266059SGregory Neil Shapiro # ifdef luna
212840266059SGregory Neil Shapiro #  ifndef IDENTPROTO
212940266059SGregory Neil Shapiro #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
213040266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
213140266059SGregory Neil Shapiro #  define HASUNSETENV	1	/* has unsetenv(2) call */
213240266059SGregory Neil Shapiro #  define NEEDPUTENV	1	/* need putenv(3) call */
213340266059SGregory Neil Shapiro #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
213440266059SGregory Neil Shapiro #  define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
213540266059SGregory Neil Shapiro #  define WAITUNION	1	/* use "union wait" as wait argument type */
213640266059SGregory Neil Shapiro #  ifdef uniosb
213740266059SGregory Neil Shapiro #   include <sys/time.h>
213840266059SGregory Neil Shapiro #   define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
213940266059SGregory Neil Shapiro #   define LA_TYPE	LA_INT
214040266059SGregory Neil Shapiro #   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
214140266059SGregory Neil Shapiro #  endif /* uniosb */
214240266059SGregory Neil Shapiro #  ifdef luna2
214340266059SGregory Neil Shapiro #   define LA_TYPE	LA_SUBR
214440266059SGregory Neil Shapiro #   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
214540266059SGregory Neil Shapiro #  endif /* luna2 */
214640266059SGregory Neil Shapiro #  ifdef luna88k
214740266059SGregory Neil Shapiro #   define LA_TYPE	LA_INT
214840266059SGregory Neil Shapiro #  endif /* luna88k */
214940266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
215040266059SGregory Neil Shapiro #  define setpgid	setpgrp
215140266059SGregory Neil Shapiro #  undef WIFEXITED
215240266059SGregory Neil Shapiro #  undef WEXITSTATUS
215340266059SGregory Neil Shapiro typedef int		pid_t;
215440266059SGregory Neil Shapiro typedef int		(*sigfunc_t)();
215540266059SGregory Neil Shapiro #  define SIGFUNC_DEFINED
215640266059SGregory Neil Shapiro #  define SIGFUNC_RETURN	(0)
215740266059SGregory Neil Shapiro #  define SIGFUNC_DECL	int
215840266059SGregory Neil Shapiro extern char	*getenv();
215940266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
216040266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
216140266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
216240266059SGregory Neil Shapiro # endif /* luna */
216340266059SGregory Neil Shapiro 
216440266059SGregory Neil Shapiro 
216540266059SGregory Neil Shapiro /*
216640266059SGregory Neil Shapiro **  NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
216740266059SGregory Neil Shapiro **
216840266059SGregory Neil Shapiro **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
216940266059SGregory Neil Shapiro */
217040266059SGregory Neil Shapiro 
217140266059SGregory Neil Shapiro # if defined(nec_ews_svr4) || defined(_nec_ews_svr4)
217240266059SGregory Neil Shapiro #  ifndef __svr4__
217340266059SGregory Neil Shapiro #   define __svr4__		/* use all System V Release 4 defines below */
217440266059SGregory Neil Shapiro #  endif /* ! __svr4__ */
217540266059SGregory Neil Shapiro #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
2176e92d3f3fSGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
217740266059SGregory Neil Shapiro #  define LA_TYPE	LA_READKSYM	/* use MIOC_READSYM ioctl */
217840266059SGregory Neil Shapiro #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
217940266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
218040266059SGregory Neil Shapiro #  undef WIFEXITED
218140266059SGregory Neil Shapiro #  undef WEXITSTATUS
218240266059SGregory Neil Shapiro #  define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
218340266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
218440266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
218540266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
218640266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
218740266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
218840266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
218940266059SGregory Neil Shapiro #  ifndef SYSLOG_BUFSIZE
219040266059SGregory Neil Shapiro #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
219140266059SGregory Neil Shapiro #  endif /* ! SYSLOG_BUFSIZE */
219240266059SGregory Neil Shapiro # endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */
219340266059SGregory Neil Shapiro 
219440266059SGregory Neil Shapiro 
219540266059SGregory Neil Shapiro /*
219640266059SGregory Neil Shapiro **  Fujitsu/ICL UXP/DS (For the DS/90 Series)
219740266059SGregory Neil Shapiro **
219840266059SGregory Neil Shapiro **	From Diego R. Lopez <drlopez@cica.es>.
219940266059SGregory Neil Shapiro **	Additional changes from Fumio Moriya and Toshiaki Nomura of the
220040266059SGregory Neil Shapiro **		Fujitsu Fresoftware group <dsfrsoft@oai6.yk.fujitsu.co.jp>.
220140266059SGregory Neil Shapiro */
220240266059SGregory Neil Shapiro 
220340266059SGregory Neil Shapiro # ifdef __uxp__
220440266059SGregory Neil Shapiro #  include <arpa/nameser.h>
220540266059SGregory Neil Shapiro #  include <sys/sysmacros.h>
220640266059SGregory Neil Shapiro #  include <sys/mkdev.h>
220740266059SGregory Neil Shapiro #  define __svr4__
220840266059SGregory Neil Shapiro #  define HASGETUSERSHELL	0
220940266059SGregory Neil Shapiro #  define HASFLOCK		0
221040266059SGregory Neil Shapiro #  define _PATH_UNIX		"/stand/unix"
221140266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
221240266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
221340266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
221440266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
221540266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
221640266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
221740266059SGregory Neil Shapiro # endif /* __uxp__ */
221840266059SGregory Neil Shapiro 
221940266059SGregory Neil Shapiro /*
222040266059SGregory Neil Shapiro **  Pyramid DC/OSx
222140266059SGregory Neil Shapiro **
222240266059SGregory Neil Shapiro **	From Earle Ake <akee@wpdiss1.wpafb.af.mil>.
222340266059SGregory Neil Shapiro */
222440266059SGregory Neil Shapiro 
222540266059SGregory Neil Shapiro # ifdef DCOSx
222640266059SGregory Neil Shapiro #  define GIDSET_T	gid_t
222740266059SGregory Neil Shapiro #  ifndef IDENTPROTO
222840266059SGregory Neil Shapiro #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
222940266059SGregory Neil Shapiro #  endif /* ! IDENTPROTO */
223040266059SGregory Neil Shapiro # endif /* DCOSx */
223140266059SGregory Neil Shapiro 
223240266059SGregory Neil Shapiro /*
223340266059SGregory Neil Shapiro **  Concurrent Computer Corporation Maxion
223440266059SGregory Neil Shapiro **
223540266059SGregory Neil Shapiro **	From Donald R. Laster Jr. <laster@access.digex.net>.
223640266059SGregory Neil Shapiro */
223740266059SGregory Neil Shapiro 
223840266059SGregory Neil Shapiro # ifdef __MAXION__
223940266059SGregory Neil Shapiro 
224040266059SGregory Neil Shapiro #  include <sys/stream.h>
224140266059SGregory Neil Shapiro #  define __svr4__		1	/* SVR4.2MP */
224240266059SGregory Neil Shapiro #  define HASSETREUID		1	/* have setreuid(2) */
224340266059SGregory Neil Shapiro #  define HASLSTAT		1	/* have lstat(2) */
224440266059SGregory Neil Shapiro #  define HASSETRLIMIT		1	/* have setrlimit(2) */
224540266059SGregory Neil Shapiro #  define HASGETDTABLESIZE	1	/* have getdtablesize(2) */
224640266059SGregory Neil Shapiro #  define HASGETUSERSHELL	1	/* have getusershell(3) */
224740266059SGregory Neil Shapiro #  define NOFTRUNCATE		1	/* do not have ftruncate(2) */
224840266059SGregory Neil Shapiro #  define SLEEP_T		unsigned
224940266059SGregory Neil Shapiro #  define SFS_TYPE		SFS_STATVFS
225040266059SGregory Neil Shapiro #  define SFS_BAVAIL		f_bavail
225140266059SGregory Neil Shapiro #  ifndef SYSLOG_BUFSIZE
225240266059SGregory Neil Shapiro #   define SYSLOG_BUFSIZE	256	/* Use 256 bytes */
225340266059SGregory Neil Shapiro #  endif /* ! SYSLOG_BUFSIZE */
225440266059SGregory Neil Shapiro 
225540266059SGregory Neil Shapiro #  undef WUNTRACED
225640266059SGregory Neil Shapiro #  undef WIFEXITED
225740266059SGregory Neil Shapiro #  undef WIFSIGNALED
225840266059SGregory Neil Shapiro #  undef WIFSTOPPED
225940266059SGregory Neil Shapiro #  undef WEXITSTATUS
226040266059SGregory Neil Shapiro #  undef WTERMSIG
226140266059SGregory Neil Shapiro #  undef WSTOPSIG
226240266059SGregory Neil Shapiro 
226340266059SGregory Neil Shapiro # endif /* __MAXION__ */
226440266059SGregory Neil Shapiro 
226540266059SGregory Neil Shapiro /*
226640266059SGregory Neil Shapiro **  Harris Nighthawk PowerUX (nh6000 box)
226740266059SGregory Neil Shapiro **
226840266059SGregory Neil Shapiro **  Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com>
226940266059SGregory Neil Shapiro */
227040266059SGregory Neil Shapiro 
227140266059SGregory Neil Shapiro # ifdef _PowerUX
227240266059SGregory Neil Shapiro #  ifndef __svr4__
227340266059SGregory Neil Shapiro #   define __svr4__
227440266059SGregory Neil Shapiro #  endif /* ! __svr4__ */
227540266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
227640266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
227740266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
227840266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
227940266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
228040266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
228140266059SGregory Neil Shapiro #  define SYSLOG_BUFSIZE		1024
228240266059SGregory Neil Shapiro #  define LA_TYPE		LA_ZERO
228340266059SGregory Neil Shapiro typedef struct msgb		mblk_t;
228440266059SGregory Neil Shapiro #  undef offsetof	/* avoid stddefs.h and sys/sysmacros.h conflict */
228540266059SGregory Neil Shapiro # endif /* _PowerUX */
228640266059SGregory Neil Shapiro 
228740266059SGregory Neil Shapiro /*
228840266059SGregory Neil Shapiro **  Siemens Nixdorf Informationssysteme AG SINIX
228940266059SGregory Neil Shapiro **
229040266059SGregory Neil Shapiro **	Contributed by Gerald Rinske of Siemens Business Services VAS.
229140266059SGregory Neil Shapiro */
229240266059SGregory Neil Shapiro # ifdef sinix
229340266059SGregory Neil Shapiro #  define HASRANDOM		0	/* has random(3) */
229440266059SGregory Neil Shapiro #  define SYSLOG_BUFSIZE	1024
229540266059SGregory Neil Shapiro #  define SM_INT32		int	/* 32bit integer */
229640266059SGregory Neil Shapiro # endif /* sinix */
229740266059SGregory Neil Shapiro 
229840266059SGregory Neil Shapiro 
229940266059SGregory Neil Shapiro /*
230040266059SGregory Neil Shapiro **  Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3
230140266059SGregory Neil Shapiro **
230240266059SGregory Neil Shapiro **	Contributed by Sergey Rusanov <rsm@utfoms.udmnet.ru>
230340266059SGregory Neil Shapiro */
230440266059SGregory Neil Shapiro 
230540266059SGregory Neil Shapiro # ifdef MOTO
230640266059SGregory Neil Shapiro #  define HASFCHMOD		1
230740266059SGregory Neil Shapiro #  define HASSETRLIMIT		0
2308e92d3f3fSGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
230940266059SGregory Neil Shapiro #  define HASSETREUID		1
231040266059SGregory Neil Shapiro #  define HASULIMIT		1
231140266059SGregory Neil Shapiro #  define HASWAITPID		1
231240266059SGregory Neil Shapiro #  define HASGETDTABLESIZE	1
231340266059SGregory Neil Shapiro #  define HASGETUSERSHELL	1
231440266059SGregory Neil Shapiro #  define IP_SRCROUTE		0
231540266059SGregory Neil Shapiro #  define IDENTPROTO		0
231640266059SGregory Neil Shapiro #  define RES_DNSRCH_VARIABLE	_res_dnsrch
231740266059SGregory Neil Shapiro #  define _PATH_UNIX		"/unix"
231840266059SGregory Neil Shapiro #  define _PATH_VENDOR_CF	"/etc/sendmail.cf"
231940266059SGregory Neil Shapiro #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
232040266059SGregory Neil Shapiro # endif /* MOTO */
232140266059SGregory Neil Shapiro 
232213bd1963SGregory Neil Shapiro /*
232313bd1963SGregory Neil Shapiro **  Interix
232413bd1963SGregory Neil Shapiro **	Contributed by Nedelcho Stanev <nedelcho.stanev@atlanticsky.com>
232513bd1963SGregory Neil Shapiro **
232613bd1963SGregory Neil Shapiro **	Used for Interix support.
232713bd1963SGregory Neil Shapiro */
232813bd1963SGregory Neil Shapiro 
232913bd1963SGregory Neil Shapiro # if defined(__INTERIX)
233013bd1963SGregory Neil Shapiro #  define HASURANDOMDEV		1
233113bd1963SGregory Neil Shapiro #  define HASGETUSERSHELL	0
233213bd1963SGregory Neil Shapiro #  define HASSTRERROR		1
233313bd1963SGregory Neil Shapiro #  define HASUNSETENV		1
233413bd1963SGregory Neil Shapiro #  define HASFCHOWN		1
233513bd1963SGregory Neil Shapiro #  undef HAVE_SYS_ERRLIST
233613bd1963SGregory Neil Shapiro #  define sys_errlist		__sys_errlist
233713bd1963SGregory Neil Shapiro #  define sys_nerr		__sys_nerr
2338e92d3f3fSGregory Neil Shapiro #  include <sys/mkdev.h>
2339e92d3f3fSGregory Neil Shapiro #  ifndef major
2340323f6dcbSGregory Neil Shapiro #   define major(dev)		((int)(((dev) >> 8) & 0xff))
2341e92d3f3fSGregory Neil Shapiro #  endif /* ! major */
2342e92d3f3fSGregory Neil Shapiro #  ifndef minor
2343323f6dcbSGregory Neil Shapiro #   define minor(dev)		((int)((dev) & 0xff))
2344e92d3f3fSGregory Neil Shapiro #  endif /* ! minor */
234513bd1963SGregory Neil Shapiro # endif /* defined(__INTERIX) */
234613bd1963SGregory Neil Shapiro 
234740266059SGregory Neil Shapiro 
234840266059SGregory Neil Shapiro /**********************************************************************
234940266059SGregory Neil Shapiro **  End of Per-Operating System defines
235040266059SGregory Neil Shapiro **********************************************************************/
235140266059SGregory Neil Shapiro /**********************************************************************
235240266059SGregory Neil Shapiro **  More general defines
235340266059SGregory Neil Shapiro **********************************************************************/
235440266059SGregory Neil Shapiro 
235540266059SGregory Neil Shapiro /* general BSD defines */
235640266059SGregory Neil Shapiro # ifdef BSD
235740266059SGregory Neil Shapiro #  define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
235840266059SGregory Neil Shapiro #  ifndef HASSETREUID
235940266059SGregory Neil Shapiro #   define HASSETREUID	1	/* has setreuid(2) call */
236040266059SGregory Neil Shapiro #  endif /* ! HASSETREUID */
236140266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
236240266059SGregory Neil Shapiro #  ifndef IP_SRCROUTE
236340266059SGregory Neil Shapiro #   define IP_SRCROUTE	1	/* can check IP source routing */
236440266059SGregory Neil Shapiro #  endif /* ! IP_SRCROUTE */
236540266059SGregory Neil Shapiro #  ifndef HASSETRLIMIT
236640266059SGregory Neil Shapiro #   define HASSETRLIMIT	1	/* has setrlimit(2) call */
236740266059SGregory Neil Shapiro #  endif /* ! HASSETRLIMIT */
236840266059SGregory Neil Shapiro #  ifndef HASFLOCK
236940266059SGregory Neil Shapiro #   define HASFLOCK	1	/* has flock(2) call */
237040266059SGregory Neil Shapiro #  endif /* ! HASFLOCK */
237140266059SGregory Neil Shapiro #  ifndef TZ_TYPE
237240266059SGregory Neil Shapiro #   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
237340266059SGregory Neil Shapiro #  endif /* ! TZ_TYPE */
237440266059SGregory Neil Shapiro # endif /* BSD */
237540266059SGregory Neil Shapiro 
237640266059SGregory Neil Shapiro /* general System V Release 4 defines */
237740266059SGregory Neil Shapiro # ifdef __svr4__
237840266059SGregory Neil Shapiro #  define SYSTEM5	1
237940266059SGregory Neil Shapiro #  define USESETEUID	1	/* has usable seteuid(2) call */
238040266059SGregory Neil Shapiro #  define HASINITGROUPS	1	/* has initgroups(3) call */
238140266059SGregory Neil Shapiro #  define BSD_COMP	1	/* get BSD ioctl calls */
238240266059SGregory Neil Shapiro #  ifndef HASSETRLIMIT
238340266059SGregory Neil Shapiro #   define HASSETRLIMIT	1	/* has setrlimit(2) call */
238440266059SGregory Neil Shapiro #  endif /* ! HASSETRLIMIT */
238540266059SGregory Neil Shapiro #  ifndef HASGETUSERSHELL
238640266059SGregory Neil Shapiro #   define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
238740266059SGregory Neil Shapiro #  endif /* ! HASGETUSERSHELL */
238840266059SGregory Neil Shapiro #  ifndef HASFCHMOD
238940266059SGregory Neil Shapiro #   define HASFCHMOD	1	/* most (all?) SVr4s seem to have fchmod(2) */
239040266059SGregory Neil Shapiro #  endif /* ! HASFCHMOD */
239140266059SGregory Neil Shapiro 
239240266059SGregory Neil Shapiro #  ifndef _PATH_UNIX
239340266059SGregory Neil Shapiro #   define _PATH_UNIX		"/unix"
239440266059SGregory Neil Shapiro #  endif /* ! _PATH_UNIX */
239540266059SGregory Neil Shapiro #  ifndef _PATH_VENDOR_CF
239640266059SGregory Neil Shapiro #   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
239740266059SGregory Neil Shapiro #  endif /* ! _PATH_VENDOR_CF */
239840266059SGregory Neil Shapiro #  ifndef _PATH_SENDMAILPID
239940266059SGregory Neil Shapiro #   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
240040266059SGregory Neil Shapiro #  endif /* ! _PATH_SENDMAILPID */
240140266059SGregory Neil Shapiro #  ifndef SYSLOG_BUFSIZE
240240266059SGregory Neil Shapiro #   define SYSLOG_BUFSIZE	128
240340266059SGregory Neil Shapiro #  endif /* ! SYSLOG_BUFSIZE */
240440266059SGregory Neil Shapiro #  ifndef SFS_TYPE
240540266059SGregory Neil Shapiro #   define SFS_TYPE		SFS_STATVFS
240640266059SGregory Neil Shapiro #  endif /* ! SFS_TYPE */
240740266059SGregory Neil Shapiro 
240840266059SGregory Neil Shapiro #  ifndef USE_SIGLONGJMP
240940266059SGregory Neil Shapiro #   define USE_SIGLONGJMP	1 /* sigsetjmp needed for signal handling */
241040266059SGregory Neil Shapiro #  endif /* ! USE_SIGLONGJMP */
241140266059SGregory Neil Shapiro # endif /* __svr4__ */
241240266059SGregory Neil Shapiro 
241340266059SGregory Neil Shapiro # ifdef __SVR4
241440266059SGregory Neil Shapiro #  define LDA_USE_LOCKF		1
241540266059SGregory Neil Shapiro #  define LDA_USE_SETEUID	1
241640266059SGregory Neil Shapiro #  define _PATH_MAILDIR		"/var/mail"
241740266059SGregory Neil Shapiro # endif /* __SVR4 */
241840266059SGregory Neil Shapiro 
241940266059SGregory Neil Shapiro /* general System V defines */
242040266059SGregory Neil Shapiro # ifdef SYSTEM5
242140266059SGregory Neil Shapiro #  include <sys/sysmacros.h>
242240266059SGregory Neil Shapiro #  define HASUNAME	1	/* use System V uname(2) system call */
242340266059SGregory Neil Shapiro #  define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
242440266059SGregory Neil Shapiro #  define HASSETVBUF	1	/* we have setvbuf(3) in libc */
242540266059SGregory Neil Shapiro #  ifndef HASULIMIT
242640266059SGregory Neil Shapiro #   define HASULIMIT	1	/* has the ulimit(2) syscall */
242740266059SGregory Neil Shapiro #  endif /* ! HASULIMIT */
242840266059SGregory Neil Shapiro #  ifndef LA_TYPE
242940266059SGregory Neil Shapiro #   ifdef MIOC_READKSYM
243040266059SGregory Neil Shapiro #    define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
243140266059SGregory Neil Shapiro #   else /* MIOC_READKSYM */
243240266059SGregory Neil Shapiro #    define LA_TYPE	LA_INT		/* assume integer load average */
243340266059SGregory Neil Shapiro #   endif /* MIOC_READKSYM */
243440266059SGregory Neil Shapiro #  endif /* ! LA_TYPE */
243540266059SGregory Neil Shapiro #  ifndef SFS_TYPE
243640266059SGregory Neil Shapiro #   define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
243740266059SGregory Neil Shapiro #  endif /* ! SFS_TYPE */
243840266059SGregory Neil Shapiro #  ifndef TZ_TYPE
243940266059SGregory Neil Shapiro #   define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
244040266059SGregory Neil Shapiro #  endif /* ! TZ_TYPE */
244140266059SGregory Neil Shapiro # endif /* SYSTEM5 */
244240266059SGregory Neil Shapiro 
244340266059SGregory Neil Shapiro /* general POSIX defines */
244440266059SGregory Neil Shapiro # ifdef _POSIX_VERSION
2445e92d3f3fSGregory Neil Shapiro #  define HASSETSID	1	/* has POSIX setsid(2) call */
2446e92d3f3fSGregory Neil Shapiro #  define HASWAITPID	1	/* has POSIX waitpid(2) call */
244740266059SGregory Neil Shapiro #  if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
244840266059SGregory Neil Shapiro #   define USESETEUID	1	/* has usable seteuid(2) call */
244940266059SGregory Neil Shapiro #  endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */
245040266059SGregory Neil Shapiro # endif /* _POSIX_VERSION */
245140266059SGregory Neil Shapiro /*
245240266059SGregory Neil Shapiro **  Tweaking for systems that (for example) claim to be BSD or POSIX
245340266059SGregory Neil Shapiro **  but don't have all the standard BSD or POSIX routines (boo hiss).
245440266059SGregory Neil Shapiro */
245540266059SGregory Neil Shapiro 
245640266059SGregory Neil Shapiro # ifdef titan
245740266059SGregory Neil Shapiro #  undef HASINITGROUPS		/* doesn't have initgroups(3) call */
245840266059SGregory Neil Shapiro # endif /* titan */
245940266059SGregory Neil Shapiro 
246040266059SGregory Neil Shapiro # ifdef _CRAYCOM
246140266059SGregory Neil Shapiro #  undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
246240266059SGregory Neil Shapiro # endif /* _CRAYCOM */
246340266059SGregory Neil Shapiro 
246440266059SGregory Neil Shapiro # ifdef MOTO
246540266059SGregory Neil Shapiro #  undef USESETEUID
246640266059SGregory Neil Shapiro # endif /* MOTO */
246740266059SGregory Neil Shapiro 
246840266059SGregory Neil Shapiro /*
246940266059SGregory Neil Shapiro **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
247040266059SGregory Neil Shapiro **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
247140266059SGregory Neil Shapiro **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
247240266059SGregory Neil Shapiro **  are closed.  Some firewalls return this error if you try to connect
247340266059SGregory Neil Shapiro **  to the IDENT port (113), so you can't receive email from these hosts
247440266059SGregory Neil Shapiro **  on these systems.  The firewall really should use a more specific
247540266059SGregory Neil Shapiro **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB.  If
247640266059SGregory Neil Shapiro **  not explicitly set to zero above, default it on.
247740266059SGregory Neil Shapiro */
247840266059SGregory Neil Shapiro 
247940266059SGregory Neil Shapiro # ifndef IDENTPROTO
248040266059SGregory Neil Shapiro #  define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
248140266059SGregory Neil Shapiro # endif /* ! IDENTPROTO */
248240266059SGregory Neil Shapiro 
248340266059SGregory Neil Shapiro # ifndef IP_SRCROUTE
248440266059SGregory Neil Shapiro #  define IP_SRCROUTE	1	/* Detect IP source routing */
248540266059SGregory Neil Shapiro # endif /* ! IP_SRCROUTE */
248640266059SGregory Neil Shapiro 
248740266059SGregory Neil Shapiro # ifndef HASGETUSERSHELL
248840266059SGregory Neil Shapiro #  define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
248940266059SGregory Neil Shapiro # endif /* ! HASGETUSERSHELL */
249040266059SGregory Neil Shapiro 
249140266059SGregory Neil Shapiro # ifndef NETUNIX
249240266059SGregory Neil Shapiro #  define NETUNIX	1	/* include unix domain support */
249340266059SGregory Neil Shapiro # endif /* ! NETUNIX */
249440266059SGregory Neil Shapiro 
249540266059SGregory Neil Shapiro # ifndef HASRANDOM
249640266059SGregory Neil Shapiro #  define HASRANDOM	1	/* has random(3) support */
249740266059SGregory Neil Shapiro # endif /* ! HASRANDOM */
249840266059SGregory Neil Shapiro 
249940266059SGregory Neil Shapiro # ifndef HASFLOCK
250040266059SGregory Neil Shapiro #  define HASFLOCK	0	/* assume no flock(2) support */
250140266059SGregory Neil Shapiro # endif /* ! HASFLOCK */
250240266059SGregory Neil Shapiro 
250340266059SGregory Neil Shapiro # ifndef HASSETREUID
250440266059SGregory Neil Shapiro #  define HASSETREUID	0	/* assume no setreuid(2) call */
250540266059SGregory Neil Shapiro # endif /* ! HASSETREUID */
250640266059SGregory Neil Shapiro 
250740266059SGregory Neil Shapiro # ifndef HASFCHMOD
250840266059SGregory Neil Shapiro #  define HASFCHMOD	0	/* assume no fchmod(2) syscall */
250940266059SGregory Neil Shapiro # endif /* ! HASFCHMOD */
251040266059SGregory Neil Shapiro 
251140266059SGregory Neil Shapiro # ifndef USESETEUID
251240266059SGregory Neil Shapiro #  define USESETEUID	0	/* assume no seteuid(2) call or no saved ids */
251340266059SGregory Neil Shapiro # endif /* ! USESETEUID */
251440266059SGregory Neil Shapiro 
251540266059SGregory Neil Shapiro # ifndef HASSETRLIMIT
251640266059SGregory Neil Shapiro #  define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
251740266059SGregory Neil Shapiro # endif /* ! HASSETRLIMIT */
251840266059SGregory Neil Shapiro 
251940266059SGregory Neil Shapiro # ifndef HASULIMIT
252040266059SGregory Neil Shapiro #  define HASULIMIT	0	/* assume no ulimit(2) support */
252140266059SGregory Neil Shapiro # endif /* ! HASULIMIT */
252240266059SGregory Neil Shapiro 
252340266059SGregory Neil Shapiro # ifndef SECUREWARE
252440266059SGregory Neil Shapiro #  define SECUREWARE	0	/* assume no SecureWare C2 auditing hooks */
252540266059SGregory Neil Shapiro # endif /* ! SECUREWARE */
252640266059SGregory Neil Shapiro 
252740266059SGregory Neil Shapiro # ifndef USE_DOUBLE_FORK
252840266059SGregory Neil Shapiro #  define USE_DOUBLE_FORK	1	/* avoid intermediate zombies */
252940266059SGregory Neil Shapiro # endif /* ! USE_DOUBLE_FORK */
253040266059SGregory Neil Shapiro 
253140266059SGregory Neil Shapiro # ifndef USE_ENVIRON
253240266059SGregory Neil Shapiro #  define USE_ENVIRON	0	/* use main() envp instead of extern environ */
253340266059SGregory Neil Shapiro # endif /* ! USE_ENVIRON */
253440266059SGregory Neil Shapiro 
253540266059SGregory Neil Shapiro # ifndef USE_SIGLONGJMP
253640266059SGregory Neil Shapiro #  define USE_SIGLONGJMP	0	/* assume setjmp handles signals properly */
253740266059SGregory Neil Shapiro # endif /* ! USE_SIGLONGJMP */
253840266059SGregory Neil Shapiro 
253940266059SGregory Neil Shapiro # ifndef FDSET_CAST
254040266059SGregory Neil Shapiro #  define FDSET_CAST		/* (empty) cast for fd_set arg to select */
254140266059SGregory Neil Shapiro # endif /* ! FDSET_CAST */
254240266059SGregory Neil Shapiro 
254340266059SGregory Neil Shapiro /*
254440266059SGregory Neil Shapiro **  Pick a mailer setuid method for changing the current uid
254540266059SGregory Neil Shapiro */
254640266059SGregory Neil Shapiro 
254740266059SGregory Neil Shapiro # define USE_SETEUID	0
254840266059SGregory Neil Shapiro # define USE_SETREUID	1
254940266059SGregory Neil Shapiro # define USE_SETUID	2
255040266059SGregory Neil Shapiro 
255140266059SGregory Neil Shapiro # if USESETEUID
255240266059SGregory Neil Shapiro #  define MAILER_SETUID_METHOD	USE_SETEUID
255340266059SGregory Neil Shapiro # else /* USESETEUID */
255440266059SGregory Neil Shapiro #  if HASSETREUID
255540266059SGregory Neil Shapiro #   define MAILER_SETUID_METHOD	USE_SETREUID
255640266059SGregory Neil Shapiro #  else /* HASSETREUID */
255740266059SGregory Neil Shapiro #   define MAILER_SETUID_METHOD	USE_SETUID
255840266059SGregory Neil Shapiro #  endif /* HASSETREUID */
255940266059SGregory Neil Shapiro # endif /* USESETEUID */
256040266059SGregory Neil Shapiro 
256140266059SGregory Neil Shapiro /*
256240266059SGregory Neil Shapiro **  If no type for argument two of getgroups call is defined, assume
256340266059SGregory Neil Shapiro **  it's an integer -- unfortunately, there seem to be several choices
256440266059SGregory Neil Shapiro **  here.
256540266059SGregory Neil Shapiro */
256640266059SGregory Neil Shapiro 
256740266059SGregory Neil Shapiro # ifndef GIDSET_T
256840266059SGregory Neil Shapiro #  define GIDSET_T	int
256940266059SGregory Neil Shapiro # endif /* ! GIDSET_T */
257040266059SGregory Neil Shapiro 
257140266059SGregory Neil Shapiro # ifndef UID_T
257240266059SGregory Neil Shapiro #  define UID_T		uid_t
257340266059SGregory Neil Shapiro # endif /* ! UID_T */
257440266059SGregory Neil Shapiro 
257540266059SGregory Neil Shapiro # ifndef GID_T
257640266059SGregory Neil Shapiro #  define GID_T		gid_t
257740266059SGregory Neil Shapiro # endif /* ! GID_T */
257840266059SGregory Neil Shapiro 
257940266059SGregory Neil Shapiro # ifndef MODE_T
258040266059SGregory Neil Shapiro #  define MODE_T		mode_t
258140266059SGregory Neil Shapiro # endif /* ! MODE_T */
258240266059SGregory Neil Shapiro 
258340266059SGregory Neil Shapiro # ifndef ARGV_T
258440266059SGregory Neil Shapiro #  define ARGV_T		char **
258540266059SGregory Neil Shapiro # endif /* ! ARGV_T */
258640266059SGregory Neil Shapiro 
258740266059SGregory Neil Shapiro # ifndef SOCKADDR_LEN_T
258840266059SGregory Neil Shapiro #  define SOCKADDR_LEN_T	int
258940266059SGregory Neil Shapiro # endif /* ! SOCKADDR_LEN_T */
259040266059SGregory Neil Shapiro 
259140266059SGregory Neil Shapiro # ifndef SOCKOPT_LEN_T
259240266059SGregory Neil Shapiro #  define SOCKOPT_LEN_T	int
259340266059SGregory Neil Shapiro # endif /* ! SOCKOPT_LEN_T */
259440266059SGregory Neil Shapiro 
259540266059SGregory Neil Shapiro # ifndef QUAD_T
259640266059SGregory Neil Shapiro #  define QUAD_T	unsigned long
259740266059SGregory Neil Shapiro # endif /* ! QUAD_T */
259840266059SGregory Neil Shapiro /**********************************************************************
259940266059SGregory Neil Shapiro **  Remaining definitions should never have to be changed.  They are
260040266059SGregory Neil Shapiro **  primarily to provide back compatibility for older systems -- for
260140266059SGregory Neil Shapiro **  example, it includes some POSIX compatibility definitions
260240266059SGregory Neil Shapiro **********************************************************************/
260340266059SGregory Neil Shapiro 
260440266059SGregory Neil Shapiro /* System 5 compatibility */
260540266059SGregory Neil Shapiro # ifndef S_ISREG
260640266059SGregory Neil Shapiro #  define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
260740266059SGregory Neil Shapiro # endif /* ! S_ISREG */
260840266059SGregory Neil Shapiro # ifndef S_ISDIR
260940266059SGregory Neil Shapiro #  define S_ISDIR(foo)	((foo & S_IFMT) == S_IFDIR)
261040266059SGregory Neil Shapiro # endif /* ! S_ISDIR */
261140266059SGregory Neil Shapiro # if !defined(S_ISLNK) && defined(S_IFLNK)
261240266059SGregory Neil Shapiro #  define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
261340266059SGregory Neil Shapiro # endif /* !defined(S_ISLNK) && defined(S_IFLNK) */
261440266059SGregory Neil Shapiro # if !defined(S_ISFIFO)
261540266059SGregory Neil Shapiro #  if defined(S_IFIFO)
261640266059SGregory Neil Shapiro #   define S_ISFIFO(foo)	((foo & S_IFMT) == S_IFIFO)
261740266059SGregory Neil Shapiro #  else /* defined(S_IFIFO) */
261840266059SGregory Neil Shapiro #   define S_ISFIFO(foo)	false
261940266059SGregory Neil Shapiro #  endif /* defined(S_IFIFO) */
262040266059SGregory Neil Shapiro # endif /* !defined(S_ISFIFO) */
262140266059SGregory Neil Shapiro # ifndef S_IRUSR
262240266059SGregory Neil Shapiro #  define S_IRUSR		0400
262340266059SGregory Neil Shapiro # endif /* ! S_IRUSR */
262440266059SGregory Neil Shapiro # ifndef S_IWUSR
262540266059SGregory Neil Shapiro #  define S_IWUSR		0200
262640266059SGregory Neil Shapiro # endif /* ! S_IWUSR */
262740266059SGregory Neil Shapiro # ifndef S_IRGRP
262840266059SGregory Neil Shapiro #  define S_IRGRP		0040
262940266059SGregory Neil Shapiro # endif /* ! S_IRGRP */
263040266059SGregory Neil Shapiro # ifndef S_IWGRP
263140266059SGregory Neil Shapiro #  define S_IWGRP		0020
263240266059SGregory Neil Shapiro # endif /* ! S_IWGRP */
263340266059SGregory Neil Shapiro # ifndef S_IROTH
263440266059SGregory Neil Shapiro #  define S_IROTH		0004
263540266059SGregory Neil Shapiro # endif /* ! S_IROTH */
263640266059SGregory Neil Shapiro # ifndef S_IWOTH
263740266059SGregory Neil Shapiro #  define S_IWOTH		0002
263840266059SGregory Neil Shapiro # endif /* ! S_IWOTH */
263940266059SGregory Neil Shapiro 
264040266059SGregory Neil Shapiro /* close-on-exec flag */
264140266059SGregory Neil Shapiro # ifndef FD_CLOEXEC
264240266059SGregory Neil Shapiro #  define FD_CLOEXEC	1
264340266059SGregory Neil Shapiro # endif /* ! FD_CLOEXEC */
264440266059SGregory Neil Shapiro 
264540266059SGregory Neil Shapiro /*
264640266059SGregory Neil Shapiro **  Older systems don't have this error code -- it should be in
264740266059SGregory Neil Shapiro **  /usr/include/sysexits.h.
264840266059SGregory Neil Shapiro */
264940266059SGregory Neil Shapiro 
265040266059SGregory Neil Shapiro # ifndef EX_CONFIG
265140266059SGregory Neil Shapiro #  define EX_CONFIG	78	/* configuration error */
265240266059SGregory Neil Shapiro # endif /* ! EX_CONFIG */
265340266059SGregory Neil Shapiro 
265440266059SGregory Neil Shapiro /* pseudo-codes */
265540266059SGregory Neil Shapiro # define EX_QUIT	22	/* drop out of server immediately */
265640266059SGregory Neil Shapiro # define EX_RESTART	23	/* restart sendmail daemon */
265740266059SGregory Neil Shapiro # define EX_SHUTDOWN	24	/* shutdown sendmail daemon */
265840266059SGregory Neil Shapiro 
265940266059SGregory Neil Shapiro #ifndef EX_NOTFOUND
266040266059SGregory Neil Shapiro # define EX_NOTFOUND	EX_NOHOST
266140266059SGregory Neil Shapiro #endif /* ! EX_NOTFOUND */
266240266059SGregory Neil Shapiro 
266340266059SGregory Neil Shapiro /* pseudo-code used for mci_setstat */
2664e92d3f3fSGregory Neil Shapiro # define EX_NOTSTICKY	(-5)	/* don't save persistent status */
266540266059SGregory Neil Shapiro 
266640266059SGregory Neil Shapiro 
266740266059SGregory Neil Shapiro /*
266840266059SGregory Neil Shapiro **  An "impossible" file mode to indicate that the file does not exist.
266940266059SGregory Neil Shapiro */
267040266059SGregory Neil Shapiro 
267140266059SGregory Neil Shapiro # define ST_MODE_NOFILE	0171147		/* unlikely to occur */
267240266059SGregory Neil Shapiro 
267340266059SGregory Neil Shapiro 
267440266059SGregory Neil Shapiro /* type of arbitrary pointer */
267540266059SGregory Neil Shapiro # ifndef ARBPTR_T
267640266059SGregory Neil Shapiro #  define ARBPTR_T	void *
267740266059SGregory Neil Shapiro # endif /* ! ARBPTR_T */
267840266059SGregory Neil Shapiro 
267940266059SGregory Neil Shapiro # ifndef __P
268040266059SGregory Neil Shapiro #  include "sm/cdefs.h"
268140266059SGregory Neil Shapiro # endif /* ! __P */
268240266059SGregory Neil Shapiro 
268340266059SGregory Neil Shapiro # if HESIOD && !defined(NAMED_BIND)
268440266059SGregory Neil Shapiro #  define NAMED_BIND	1	/* not one without the other */
268540266059SGregory Neil Shapiro # endif /* HESIOD && !defined(NAMED_BIND) */
268640266059SGregory Neil Shapiro 
268740266059SGregory Neil Shapiro #  if NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno )
268840266059SGregory Neil Shapiro extern int	h_errno;
268940266059SGregory Neil Shapiro #  endif /* NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) */
269040266059SGregory Neil Shapiro 
269140266059SGregory Neil Shapiro # if NEEDPUTENV
269240266059SGregory Neil Shapiro extern int	putenv __P((char *));
269340266059SGregory Neil Shapiro # endif /* NEEDPUTENV */
269440266059SGregory Neil Shapiro 
269540266059SGregory Neil Shapiro #if !HASUNSETENV
269640266059SGregory Neil Shapiro extern void	unsetenv __P((char *));
269740266059SGregory Neil Shapiro #endif /* !HASUNSETENV */
269840266059SGregory Neil Shapiro 
269940266059SGregory Neil Shapiro # ifdef LDAPMAP
270040266059SGregory Neil Shapiro #  include <sys/time.h>
270140266059SGregory Neil Shapiro #  include <lber.h>
270240266059SGregory Neil Shapiro #  include <ldap.h>
270340266059SGregory Neil Shapiro 
270440266059SGregory Neil Shapiro /* Some LDAP constants */
270540266059SGregory Neil Shapiro #  define LDAPMAP_FALSE		0
270640266059SGregory Neil Shapiro #  define LDAPMAP_TRUE		1
270740266059SGregory Neil Shapiro 
270840266059SGregory Neil Shapiro /*
270940266059SGregory Neil Shapiro **  ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1.
271040266059SGregory Neil Shapiro **  Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations
271140266059SGregory Neil Shapiro **  and assume (falsely) that all old API implementations are broken.
271240266059SGregory Neil Shapiro **  (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT)
271340266059SGregory Neil Shapiro */
271440266059SGregory Neil Shapiro 
271540266059SGregory Neil Shapiro #  if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT)
271640266059SGregory Neil Shapiro #   define USE_LDAP_INIT	1
271740266059SGregory Neil Shapiro #  endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) */
271840266059SGregory Neil Shapiro 
271940266059SGregory Neil Shapiro /*
272040266059SGregory Neil Shapiro **  LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x,
272140266059SGregory Neil Shapiro **  hence ldap_set_option() must not exist.
272240266059SGregory Neil Shapiro */
272340266059SGregory Neil Shapiro 
272440266059SGregory Neil Shapiro #  if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION)
272540266059SGregory Neil Shapiro #   define USE_LDAP_SET_OPTION	1
272640266059SGregory Neil Shapiro #  endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) */
272740266059SGregory Neil Shapiro 
272840266059SGregory Neil Shapiro # endif /* LDAPMAP */
272940266059SGregory Neil Shapiro 
273040266059SGregory Neil Shapiro # if HASUNAME
273140266059SGregory Neil Shapiro #  include <sys/utsname.h>
273240266059SGregory Neil Shapiro #  ifdef newstr
273340266059SGregory Neil Shapiro #   undef newstr
273440266059SGregory Neil Shapiro #  endif /* newstr */
273540266059SGregory Neil Shapiro # else /* HASUNAME */
273640266059SGregory Neil Shapiro #  define NODE_LENGTH 32
273740266059SGregory Neil Shapiro struct utsname
273840266059SGregory Neil Shapiro {
273940266059SGregory Neil Shapiro 	char nodename[NODE_LENGTH + 1];
274040266059SGregory Neil Shapiro };
274140266059SGregory Neil Shapiro # endif /* HASUNAME */
274240266059SGregory Neil Shapiro 
274340266059SGregory Neil Shapiro # if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V)
274440266059SGregory Neil Shapiro #  define MAXHOSTNAMELEN	256
274540266059SGregory Neil Shapiro # endif /* !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) */
274640266059SGregory Neil Shapiro 
274740266059SGregory Neil Shapiro # if !defined(SIGCHLD) && defined(SIGCLD)
274840266059SGregory Neil Shapiro #  define SIGCHLD	SIGCLD
274940266059SGregory Neil Shapiro # endif /* !defined(SIGCHLD) && defined(SIGCLD) */
275040266059SGregory Neil Shapiro 
275140266059SGregory Neil Shapiro # ifndef STDIN_FILENO
275240266059SGregory Neil Shapiro #  define STDIN_FILENO	0
275340266059SGregory Neil Shapiro # endif /* ! STDIN_FILENO */
275440266059SGregory Neil Shapiro 
275540266059SGregory Neil Shapiro # ifndef STDOUT_FILENO
275640266059SGregory Neil Shapiro #  define STDOUT_FILENO	1
275740266059SGregory Neil Shapiro # endif /* ! STDOUT_FILENO */
275840266059SGregory Neil Shapiro 
275940266059SGregory Neil Shapiro # ifndef STDERR_FILENO
276040266059SGregory Neil Shapiro #  define STDERR_FILENO	2
276140266059SGregory Neil Shapiro # endif /* ! STDERR_FILENO */
276240266059SGregory Neil Shapiro 
276340266059SGregory Neil Shapiro # ifndef LOCK_SH
276440266059SGregory Neil Shapiro #  define LOCK_SH	0x01	/* shared lock */
276540266059SGregory Neil Shapiro #  define LOCK_EX	0x02	/* exclusive lock */
276640266059SGregory Neil Shapiro #  define LOCK_NB	0x04	/* non-blocking lock */
276740266059SGregory Neil Shapiro #  define LOCK_UN	0x08	/* unlock */
276840266059SGregory Neil Shapiro # endif /* ! LOCK_SH */
276940266059SGregory Neil Shapiro 
277040266059SGregory Neil Shapiro # ifndef S_IXOTH
277140266059SGregory Neil Shapiro #  define S_IXOTH	(S_IEXEC >> 6)
277240266059SGregory Neil Shapiro # endif /* ! S_IXOTH */
277340266059SGregory Neil Shapiro 
277440266059SGregory Neil Shapiro # ifndef S_IXGRP
277540266059SGregory Neil Shapiro #  define S_IXGRP	(S_IEXEC >> 3)
277640266059SGregory Neil Shapiro # endif /* ! S_IXGRP */
277740266059SGregory Neil Shapiro 
277840266059SGregory Neil Shapiro # ifndef S_IXUSR
277940266059SGregory Neil Shapiro #  define S_IXUSR	(S_IEXEC)
278040266059SGregory Neil Shapiro # endif /* ! S_IXUSR */
278140266059SGregory Neil Shapiro 
278240266059SGregory Neil Shapiro #ifndef O_ACCMODE
278340266059SGregory Neil Shapiro # define O_ACCMODE	(O_RDONLY|O_WRONLY|O_RDWR)
278440266059SGregory Neil Shapiro #endif /* ! O_ACCMODE */
278540266059SGregory Neil Shapiro 
278640266059SGregory Neil Shapiro # ifndef SEEK_SET
278740266059SGregory Neil Shapiro #  define SEEK_SET	0
278840266059SGregory Neil Shapiro #  define SEEK_CUR	1
278940266059SGregory Neil Shapiro #  define SEEK_END	2
279040266059SGregory Neil Shapiro # endif /* ! SEEK_SET */
279140266059SGregory Neil Shapiro 
279240266059SGregory Neil Shapiro # ifndef SIG_ERR
279340266059SGregory Neil Shapiro #  define SIG_ERR	((void (*)()) -1)
279440266059SGregory Neil Shapiro # endif /* ! SIG_ERR */
279540266059SGregory Neil Shapiro 
279640266059SGregory Neil Shapiro # ifndef WEXITSTATUS
279740266059SGregory Neil Shapiro #  define WEXITSTATUS(st)	(((st) >> 8) & 0377)
279840266059SGregory Neil Shapiro # endif /* ! WEXITSTATUS */
279940266059SGregory Neil Shapiro # ifndef WIFEXITED
280040266059SGregory Neil Shapiro #  define WIFEXITED(st)		(((st) & 0377) == 0)
280140266059SGregory Neil Shapiro # endif /* ! WIFEXITED */
280240266059SGregory Neil Shapiro # ifndef WIFSTOPPED
280340266059SGregory Neil Shapiro #  define WIFSTOPPED(st)		(((st) & 0100) == 0)
280440266059SGregory Neil Shapiro # endif /* ! WIFSTOPPED */
280540266059SGregory Neil Shapiro # ifndef WCOREDUMP
280640266059SGregory Neil Shapiro #  define WCOREDUMP(st)		(((st) & 0200) != 0)
280740266059SGregory Neil Shapiro # endif /* ! WCOREDUMP */
280840266059SGregory Neil Shapiro # ifndef WTERMSIG
280940266059SGregory Neil Shapiro #  define WTERMSIG(st)		(((st) & 0177))
281040266059SGregory Neil Shapiro # endif /* ! WTERMSIG */
281140266059SGregory Neil Shapiro 
281240266059SGregory Neil Shapiro # ifndef SIGFUNC_DEFINED
281340266059SGregory Neil Shapiro typedef void		(*sigfunc_t) __P((int));
281440266059SGregory Neil Shapiro # endif /* ! SIGFUNC_DEFINED */
281540266059SGregory Neil Shapiro # ifndef SIGFUNC_RETURN
281640266059SGregory Neil Shapiro #  define SIGFUNC_RETURN
281740266059SGregory Neil Shapiro # endif /* ! SIGFUNC_RETURN */
281840266059SGregory Neil Shapiro # ifndef SIGFUNC_DECL
281940266059SGregory Neil Shapiro #  define SIGFUNC_DECL	void
282040266059SGregory Neil Shapiro # endif /* ! SIGFUNC_DECL */
282140266059SGregory Neil Shapiro 
282240266059SGregory Neil Shapiro /* size of syslog buffer */
282340266059SGregory Neil Shapiro # ifndef SYSLOG_BUFSIZE
282440266059SGregory Neil Shapiro #  define SYSLOG_BUFSIZE	1024
282540266059SGregory Neil Shapiro # endif /* ! SYSLOG_BUFSIZE */
282640266059SGregory Neil Shapiro 
282713bd1963SGregory Neil Shapiro /* for FD_SET() */
282813bd1963SGregory Neil Shapiro #ifndef FD_SETSIZE
282913bd1963SGregory Neil Shapiro # define FD_SETSIZE	256
283013bd1963SGregory Neil Shapiro #endif /* ! FD_SETSIZE */
283113bd1963SGregory Neil Shapiro 
283240266059SGregory Neil Shapiro /*
283340266059SGregory Neil Shapiro **  Size of prescan buffer.
283440266059SGregory Neil Shapiro **	Despite comments in the _sendmail_ book, this probably should
283540266059SGregory Neil Shapiro **	not be changed; there are some hard-to-define dependencies.
283640266059SGregory Neil Shapiro */
283740266059SGregory Neil Shapiro 
283840266059SGregory Neil Shapiro # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
283940266059SGregory Neil Shapiro 
284040266059SGregory Neil Shapiro /* fork routine -- set above using #ifdef _osname_ or in Makefile */
284140266059SGregory Neil Shapiro # ifndef FORK
284240266059SGregory Neil Shapiro #  define FORK		fork		/* function to call to fork mailer */
284340266059SGregory Neil Shapiro # endif /* ! FORK */
284440266059SGregory Neil Shapiro 
284540266059SGregory Neil Shapiro /* setting h_errno */
284640266059SGregory Neil Shapiro # ifndef SM_SET_H_ERRNO
284740266059SGregory Neil Shapiro #  define SM_SET_H_ERRNO(err)	h_errno = (err)
284840266059SGregory Neil Shapiro # endif /* SM_SET_H_ERRNO */
284940266059SGregory Neil Shapiro 
285040266059SGregory Neil Shapiro # ifndef SM_CONF_GETOPT
285140266059SGregory Neil Shapiro #  define SM_CONF_GETOPT	1
285240266059SGregory Neil Shapiro # endif /* ! SM_CONF_GETOPT */
285340266059SGregory Neil Shapiro 
285440266059SGregory Neil Shapiro /* random routine -- set above using #ifdef _osname_ or in Makefile */
285540266059SGregory Neil Shapiro # if HASRANDOM
285640266059SGregory Neil Shapiro #  define get_random()	random()
285740266059SGregory Neil Shapiro # else /* HASRANDOM */
285840266059SGregory Neil Shapiro #  define get_random()	((long) rand())
285940266059SGregory Neil Shapiro #  ifndef RANDOMSHIFT
286040266059SGregory Neil Shapiro #   define RANDOMSHIFT	8
286140266059SGregory Neil Shapiro #  endif /* ! RANDOMSHIFT */
286240266059SGregory Neil Shapiro # endif /* HASRANDOM */
286340266059SGregory Neil Shapiro 
286440266059SGregory Neil Shapiro /*
286540266059SGregory Neil Shapiro **  Default to using scanf in readcf.
286640266059SGregory Neil Shapiro */
286740266059SGregory Neil Shapiro 
286840266059SGregory Neil Shapiro # ifndef SCANF
286940266059SGregory Neil Shapiro #  define SCANF		1
287040266059SGregory Neil Shapiro # endif /* ! SCANF */
287140266059SGregory Neil Shapiro 
287240266059SGregory Neil Shapiro /* XXX  32 bit type */
287340266059SGregory Neil Shapiro # ifndef SM_INT32
287440266059SGregory Neil Shapiro #  define SM_INT32	int32_t
287540266059SGregory Neil Shapiro # endif /* ! SM_INT32 */
287640266059SGregory Neil Shapiro 
287740266059SGregory Neil Shapiro /*
287840266059SGregory Neil Shapiro **  SVr4 and similar systems use different routines for setjmp/longjmp
287940266059SGregory Neil Shapiro **  with signal support
288040266059SGregory Neil Shapiro */
288140266059SGregory Neil Shapiro 
288240266059SGregory Neil Shapiro # if USE_SIGLONGJMP
288340266059SGregory Neil Shapiro #  ifdef jmp_buf
288440266059SGregory Neil Shapiro #   undef jmp_buf
288540266059SGregory Neil Shapiro #  endif /* jmp_buf */
288640266059SGregory Neil Shapiro #  define jmp_buf		sigjmp_buf
288740266059SGregory Neil Shapiro #  ifdef setjmp
288840266059SGregory Neil Shapiro #   undef setjmp
288940266059SGregory Neil Shapiro #  endif /* setjmp */
289040266059SGregory Neil Shapiro #  define setjmp(env)		sigsetjmp(env, 1)
289140266059SGregory Neil Shapiro #  ifdef longjmp
289240266059SGregory Neil Shapiro #   undef longjmp
289340266059SGregory Neil Shapiro #  endif /* longjmp */
289440266059SGregory Neil Shapiro #  define longjmp(env, val)	siglongjmp(env, val)
289540266059SGregory Neil Shapiro # endif /* USE_SIGLONGJMP */
289640266059SGregory Neil Shapiro 
289740266059SGregory Neil Shapiro # if !defined(NGROUPS_MAX) && defined(NGROUPS)
289840266059SGregory Neil Shapiro #  define NGROUPS_MAX	NGROUPS		/* POSIX naming convention */
289940266059SGregory Neil Shapiro # endif /* !defined(NGROUPS_MAX) && defined(NGROUPS) */
290040266059SGregory Neil Shapiro 
290140266059SGregory Neil Shapiro /*
290240266059SGregory Neil Shapiro **  Some snprintf() implementations are rumored not to NUL terminate.
290340266059SGregory Neil Shapiro */
290440266059SGregory Neil Shapiro # if SNPRINTF_IS_BROKEN
290540266059SGregory Neil Shapiro #  ifdef snprintf
290640266059SGregory Neil Shapiro #   undef snprintf
290740266059SGregory Neil Shapiro #  endif /* snprintf */
290840266059SGregory Neil Shapiro #  define snprintf	sm_snprintf
290940266059SGregory Neil Shapiro #  ifdef vsnprintf
291040266059SGregory Neil Shapiro #   undef vsnprintf
291140266059SGregory Neil Shapiro #  endif /* vsnprintf */
291240266059SGregory Neil Shapiro #  define vsnprintf	sm_vsnprintf
291340266059SGregory Neil Shapiro # endif /* SNPRINTF_IS_BROKEN */
291440266059SGregory Neil Shapiro 
291540266059SGregory Neil Shapiro /*
291640266059SGregory Neil Shapiro **  If we don't have a system syslog, simulate it.
291740266059SGregory Neil Shapiro */
291840266059SGregory Neil Shapiro 
291940266059SGregory Neil Shapiro # if !LOG
292040266059SGregory Neil Shapiro #  define LOG_EMERG	0	/* system is unusable */
292140266059SGregory Neil Shapiro #  define LOG_ALERT	1	/* action must be taken immediately */
292240266059SGregory Neil Shapiro #  define LOG_CRIT	2	/* critical conditions */
292340266059SGregory Neil Shapiro #  define LOG_ERR	3	/* error conditions */
292440266059SGregory Neil Shapiro #  define LOG_WARNING	4	/* warning conditions */
292540266059SGregory Neil Shapiro #  define LOG_NOTICE	5	/* normal but significant condition */
292640266059SGregory Neil Shapiro #  define LOG_INFO	6	/* informational */
292740266059SGregory Neil Shapiro #  define LOG_DEBUG	7	/* debug-level messages */
292840266059SGregory Neil Shapiro # endif /* !LOG */
292940266059SGregory Neil Shapiro 
293040266059SGregory Neil Shapiro # ifndef SM_CONF_SYSLOG
293140266059SGregory Neil Shapiro #  define SM_CONF_SYSLOG 1	/* syslog.h has prototype for syslog() */
293240266059SGregory Neil Shapiro # endif /* SM_CONF_SYSLOG */
293340266059SGregory Neil Shapiro 
293440266059SGregory Neil Shapiro # if !SM_CONF_SYSLOG
293540266059SGregory Neil Shapiro #   ifdef __STDC__
293640266059SGregory Neil Shapiro extern void	syslog(int, const char *, ...);
293740266059SGregory Neil Shapiro #   else /* __STDC__ */
293840266059SGregory Neil Shapiro extern void	syslog();
293940266059SGregory Neil Shapiro #   endif /* __STDC__ */
294040266059SGregory Neil Shapiro # endif /* !SM_CONF_SYSLOG */
294140266059SGregory Neil Shapiro 
294240266059SGregory Neil Shapiro /* portable(?) definition for alignment */
294340266059SGregory Neil Shapiro # ifndef SM_ALIGN_SIZE
294440266059SGregory Neil Shapiro struct sm_align
294540266059SGregory Neil Shapiro {
294640266059SGregory Neil Shapiro 	char al_c;
294740266059SGregory Neil Shapiro 	union
294840266059SGregory Neil Shapiro 	{
294940266059SGregory Neil Shapiro 		long	al_l;
295040266059SGregory Neil Shapiro 		void	*al_p;
295140266059SGregory Neil Shapiro 		double	al_d;
2952b6bacd31SGregory Neil Shapiro 		void	(*al_f) __P((void));
295340266059SGregory Neil Shapiro 	} al_u;
295440266059SGregory Neil Shapiro };
295540266059SGregory Neil Shapiro #  define SM_ALIGN_SIZE offsetof(struct sm_align, al_u)
295640266059SGregory Neil Shapiro # endif /* ! SM_ALIGN_SIZE */
295740266059SGregory Neil Shapiro # define SM_ALIGN_BITS (SM_ALIGN_SIZE - 1)
295840266059SGregory Neil Shapiro 
295940266059SGregory Neil Shapiro #endif /* ! SM_CONF_H */
2960