xref: /illumos-gate/usr/src/cmd/sendmail/include/sm/conf.h (revision e9af4bc0)
17c478bd9Sstevel@tonic-gate /*
2*e9af4bc0SJohn Beck  * Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers.
37c478bd9Sstevel@tonic-gate  *	All rights reserved.
47c478bd9Sstevel@tonic-gate  * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
57c478bd9Sstevel@tonic-gate  * Copyright (c) 1988, 1993
67c478bd9Sstevel@tonic-gate  *	The Regents of the University of California.  All rights reserved.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * By using this file, you agree to the terms and conditions set
97c478bd9Sstevel@tonic-gate  * forth in the LICENSE file which can be found at the top level of
107c478bd9Sstevel@tonic-gate  * the sendmail distribution.
117c478bd9Sstevel@tonic-gate  *
127c478bd9Sstevel@tonic-gate  *
13*e9af4bc0SJohn Beck  *	$Id: conf.h,v 1.139 2009/06/16 23:41:32 ca Exp $
147c478bd9Sstevel@tonic-gate  */
157c478bd9Sstevel@tonic-gate 
167c478bd9Sstevel@tonic-gate /*
1739c1a28dSJohn Beck  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
187c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
197c478bd9Sstevel@tonic-gate  */
207c478bd9Sstevel@tonic-gate 
217c478bd9Sstevel@tonic-gate /*
227c478bd9Sstevel@tonic-gate **  CONF.H -- All user-configurable parameters for sendmail
237c478bd9Sstevel@tonic-gate **
24058561cbSjbeck **	Send updates to Sendmail.ORG so they will be
25058561cbSjbeck **	included in the next release; see
26058561cbSjbeck **	http://www.sendmail.org/email-addresses.html
27058561cbSjbeck **	for current e-mail address.
287c478bd9Sstevel@tonic-gate */
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifndef SM_CONF_H
317c478bd9Sstevel@tonic-gate # define SM_CONF_H 1
327c478bd9Sstevel@tonic-gate 
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate # include <sm/config.h>
357c478bd9Sstevel@tonic-gate # include <sm/varargs.h>
367c478bd9Sstevel@tonic-gate 
377c478bd9Sstevel@tonic-gate /*
387c478bd9Sstevel@tonic-gate **  General "standard C" defines.
397c478bd9Sstevel@tonic-gate **
407c478bd9Sstevel@tonic-gate **	These may be undone later, to cope with systems that claim to
417c478bd9Sstevel@tonic-gate **	be Standard C but aren't.  Gcc is the biggest offender -- it
427c478bd9Sstevel@tonic-gate **	doesn't realize that the library is part of the language.
437c478bd9Sstevel@tonic-gate **
447c478bd9Sstevel@tonic-gate **	Life would be much easier if we could get rid of this sort
457c478bd9Sstevel@tonic-gate **	of bozo problems.
467c478bd9Sstevel@tonic-gate */
477c478bd9Sstevel@tonic-gate 
487c478bd9Sstevel@tonic-gate # ifdef __STDC__
497c478bd9Sstevel@tonic-gate #  define HASSETVBUF	1	/* we have setvbuf(3) in libc */
507c478bd9Sstevel@tonic-gate # endif /* __STDC__ */
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate /*
537c478bd9Sstevel@tonic-gate **  Assume you have standard calls; can be #undefed below if necessary.
547c478bd9Sstevel@tonic-gate */
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate # ifndef HASLSTAT
577c478bd9Sstevel@tonic-gate #  define HASLSTAT	1	/* has lstat(2) call */
587c478bd9Sstevel@tonic-gate # endif /* ! HASLSTAT */
597c478bd9Sstevel@tonic-gate 
607c478bd9Sstevel@tonic-gate # ifndef HASNICE
617c478bd9Sstevel@tonic-gate #  define HASNICE	1	/* has nice(2) call */
627c478bd9Sstevel@tonic-gate # endif /* ! HASNICE */
637c478bd9Sstevel@tonic-gate 
647c478bd9Sstevel@tonic-gate # ifndef HASRRESVPORT
657c478bd9Sstevel@tonic-gate #  define HASRRESVPORT	1	/* has rrsevport(3) call */
667c478bd9Sstevel@tonic-gate # endif /* ! HASRRESVPORT */
677c478bd9Sstevel@tonic-gate 
687c478bd9Sstevel@tonic-gate /**********************************************************************
697c478bd9Sstevel@tonic-gate **  "Hard" compilation options.
707c478bd9Sstevel@tonic-gate **	#define these if they are available; comment them out otherwise.
717c478bd9Sstevel@tonic-gate **  These cannot be overridden from the Makefile, and should really not
727c478bd9Sstevel@tonic-gate **  be turned off unless absolutely necessary.
737c478bd9Sstevel@tonic-gate **********************************************************************/
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate #define LOG		1	/* enable logging -- don't turn off */
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate /**********************************************************************
787c478bd9Sstevel@tonic-gate **  Operating system configuration.
797c478bd9Sstevel@tonic-gate **
807c478bd9Sstevel@tonic-gate **	Unless you are porting to a new OS, you shouldn't have to
817c478bd9Sstevel@tonic-gate **	change these.
827c478bd9Sstevel@tonic-gate **********************************************************************/
837c478bd9Sstevel@tonic-gate 
847c478bd9Sstevel@tonic-gate /*
857c478bd9Sstevel@tonic-gate **  HP-UX -- tested for 8.07, 9.00, and 9.01.
867c478bd9Sstevel@tonic-gate **
877c478bd9Sstevel@tonic-gate **	If V4FS is defined, compile for HP-UX 10.0.
887c478bd9Sstevel@tonic-gate **	11.x support from Richard Allen <ra@hp.is>.
897c478bd9Sstevel@tonic-gate */
907c478bd9Sstevel@tonic-gate 
917c478bd9Sstevel@tonic-gate # ifdef __hpux
927c478bd9Sstevel@tonic-gate 		/* common definitions for HP-UX 9.x and 10.x */
937c478bd9Sstevel@tonic-gate #  undef m_flags		/* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */
947c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* include all the System V defines */
957c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
967c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
977c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
987c478bd9Sstevel@tonic-gate #  define HASSETRESGID	1	/* use setresgid(2) to set saved gid */
997c478bd9Sstevel@tonic-gate #  define BOGUS_O_EXCL	1	/* exclusive open follows symlinks */
1007c478bd9Sstevel@tonic-gate #  define seteuid(e)	setresuid(-1, e, -1)
1017c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	1	/* can check IP source routing */
1027c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_HPUX
1037c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_PSTAT
1047c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1057c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
1067c478bd9Sstevel@tonic-gate #  define LDA_USE_LOCKF	1
1077c478bd9Sstevel@tonic-gate #  ifndef HASGETUSERSHELL
1087c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
1097c478bd9Sstevel@tonic-gate #  endif /* ! HASGETUSERSHELL */
1107c478bd9Sstevel@tonic-gate #  ifdef HPUX10
1117c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAIL	"/usr/sbin/sendmail"
1127c478bd9Sstevel@tonic-gate #   ifndef SMRSH_CMDDIR
1137c478bd9Sstevel@tonic-gate #    define SMRSH_CMDDIR	"/var/adm/sm.bin"
1147c478bd9Sstevel@tonic-gate #   endif /* ! SMRSH_CMDDIR */
1157c478bd9Sstevel@tonic-gate #  endif /* HPUX10 */
1167c478bd9Sstevel@tonic-gate #  ifdef HPUX11
1177c478bd9Sstevel@tonic-gate #   define HASSETREUID	1	/* setreuid(2) works on HP-UX 11.x */
1187c478bd9Sstevel@tonic-gate #   define HASFCHOWN	1	/* has fchown(2) */
1197c478bd9Sstevel@tonic-gate #   ifndef BROKEN_RES_SEARCH
1207c478bd9Sstevel@tonic-gate #    define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
1217c478bd9Sstevel@tonic-gate #   endif /* ! BROKEN_RES_SEARCH */
1227c478bd9Sstevel@tonic-gate #   ifndef SMRSH_CMDDIR
1237c478bd9Sstevel@tonic-gate #    define SMRSH_CMDDIR	"/var/adm/sm.bin"
1247c478bd9Sstevel@tonic-gate #   endif /* ! SMRSH_CMDDIR */
1257c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAIL	"/usr/sbin/sendmail"
1267c478bd9Sstevel@tonic-gate #  else /* HPUX11 */
1277c478bd9Sstevel@tonic-gate #   ifndef NOT_SENDMAIL
1287c478bd9Sstevel@tonic-gate #    define syslog	hard_syslog
1297c478bd9Sstevel@tonic-gate #   endif /* ! NOT_SENDMAIL */
1307c478bd9Sstevel@tonic-gate #  endif /* HPUX11 */
1317c478bd9Sstevel@tonic-gate #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
1327c478bd9Sstevel@tonic-gate 
1337c478bd9Sstevel@tonic-gate #  ifdef V4FS
1347c478bd9Sstevel@tonic-gate 		/* HP-UX 10.x */
1357c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/stand/vmunix"
1367c478bd9Sstevel@tonic-gate #   ifndef _PATH_VENDOR_CF
1377c478bd9Sstevel@tonic-gate #    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
1387c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_VENDOR_CF */
1397c478bd9Sstevel@tonic-gate #   ifndef _PATH_SENDMAILPID
1407c478bd9Sstevel@tonic-gate #    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
1417c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_SENDMAILPID */
1427c478bd9Sstevel@tonic-gate #   ifndef IDENTPROTO
1437c478bd9Sstevel@tonic-gate #    define IDENTPROTO	1	/* TCP/IP implementation fixed in 10.0 */
1447c478bd9Sstevel@tonic-gate #   endif /* ! IDENTPROTO */
1457c478bd9Sstevel@tonic-gate #   include <sys/mpctl.h>	/* for mpctl() in get_num_procs_online() */
1467c478bd9Sstevel@tonic-gate #  else /* V4FS */
1477c478bd9Sstevel@tonic-gate 		/* HP-UX 9.x */
1487c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/hp-ux"
1497c478bd9Sstevel@tonic-gate #   ifndef _PATH_VENDOR_CF
1507c478bd9Sstevel@tonic-gate #    define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1517c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_VENDOR_CF */
1527c478bd9Sstevel@tonic-gate #   ifndef IDENTPROTO
1537c478bd9Sstevel@tonic-gate #    define IDENTPROTO	0	/* TCP/IP implementation is broken */
1547c478bd9Sstevel@tonic-gate #   endif /* ! IDENTPROTO */
1557c478bd9Sstevel@tonic-gate #   ifdef __STDC__
1567c478bd9Sstevel@tonic-gate extern void	hard_syslog(int, char *, ...);
1577c478bd9Sstevel@tonic-gate #   else /* __STDC__ */
1587c478bd9Sstevel@tonic-gate extern void	hard_syslog();
1597c478bd9Sstevel@tonic-gate #   endif /* __STDC__ */
1607c478bd9Sstevel@tonic-gate #   define FDSET_CAST	(int *)	/* cast for fd_set parameters to select */
1617c478bd9Sstevel@tonic-gate #  endif /* V4FS */
1627c478bd9Sstevel@tonic-gate 
1637c478bd9Sstevel@tonic-gate # endif /* __hpux */
1647c478bd9Sstevel@tonic-gate 
1657c478bd9Sstevel@tonic-gate /*
1667c478bd9Sstevel@tonic-gate **  IBM AIX 5.x
1677c478bd9Sstevel@tonic-gate */
1687c478bd9Sstevel@tonic-gate 
1697c478bd9Sstevel@tonic-gate # ifdef _AIX5
1704aac33d3Sjbeck #  include <sys/signal.h>
1714aac33d3Sjbeck #  include <sys/wait.h>
1727c478bd9Sstevel@tonic-gate #  define _AIX4		40300
1737c478bd9Sstevel@tonic-gate #  define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */
1747c478bd9Sstevel@tonic-gate #  define SOCKOPT_LEN_T	socklen_t /* arg#5 to getsockopt */
1757c478bd9Sstevel@tonic-gate #  if _AIX5 >= 50200
1767c478bd9Sstevel@tonic-gate #   define HASUNSETENV	1	/* has unsetenv(3) call */
1777c478bd9Sstevel@tonic-gate #  endif /* _AIX5 >= 50200 */
1787c478bd9Sstevel@tonic-gate # endif /* _AIX5 */
1797c478bd9Sstevel@tonic-gate 
1807c478bd9Sstevel@tonic-gate /*
1817c478bd9Sstevel@tonic-gate **  IBM AIX 4.x
1827c478bd9Sstevel@tonic-gate */
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate # ifdef _AIX4
1857c478bd9Sstevel@tonic-gate #  define _AIX3		1	/* pull in AIX3 stuff */
1867c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR	/* has sa_len */
1877c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* seteuid(2) works */
1887c478bd9Sstevel@tonic-gate #  define TZ_TYPE	TZ_NAME	/* use tzname[] vector */
1897c478bd9Sstevel@tonic-gate #  ifndef SOCKOPT_LEN_T
1907c478bd9Sstevel@tonic-gate #   define SOCKOPT_LEN_T	size_t	/* arg#5 to getsockopt */
1917c478bd9Sstevel@tonic-gate #  endif /* SOCKOPT_LEN_T */
1927c478bd9Sstevel@tonic-gate #  if _AIX4 >= 40200
1937c478bd9Sstevel@tonic-gate #   define HASSETREUID	1	/* setreuid(2) works as of AIX 4.2 */
1947c478bd9Sstevel@tonic-gate #   ifndef SOCKADDR_LEN_T
1957c478bd9Sstevel@tonic-gate #    define SOCKADDR_LEN_T	size_t	/* e.g., arg#3 to accept, getsockname */
1967c478bd9Sstevel@tonic-gate #   endif /* SOCKADDR_LEN_T */
1977c478bd9Sstevel@tonic-gate #  endif /* _AIX4 >= 40200 */
1987c478bd9Sstevel@tonic-gate #  if defined(_ILS_MACROS)	/* IBM versions aren't side-effect clean */
1997c478bd9Sstevel@tonic-gate #   undef isascii
2007c478bd9Sstevel@tonic-gate #   define isascii(c)		!(c & ~0177)
2017c478bd9Sstevel@tonic-gate #   undef isdigit
2027c478bd9Sstevel@tonic-gate #   define isdigit(__a)		(_IS(__a,_ISDIGIT))
2037c478bd9Sstevel@tonic-gate #   undef isspace
2047c478bd9Sstevel@tonic-gate #   define isspace(__a)		(_IS(__a,_ISSPACE))
2057c478bd9Sstevel@tonic-gate #  endif /* defined(_ILS_MACROS) */
2067c478bd9Sstevel@tonic-gate # endif /* _AIX4 */
2077c478bd9Sstevel@tonic-gate 
2087c478bd9Sstevel@tonic-gate 
2097c478bd9Sstevel@tonic-gate /*
2107c478bd9Sstevel@tonic-gate **  IBM AIX 3.x -- actually tested for 3.2.3
2117c478bd9Sstevel@tonic-gate */
2127c478bd9Sstevel@tonic-gate 
2137c478bd9Sstevel@tonic-gate # ifdef _AIX3
2147c478bd9Sstevel@tonic-gate #  include <paths.h>
2157c478bd9Sstevel@tonic-gate #  include <sys/machine.h>	/* to get byte order */
2167c478bd9Sstevel@tonic-gate #  include <sys/select.h>
2177c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) */
2187c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
2197c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
2207c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
2217c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
2227c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
2237c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
2247c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
2257c478bd9Sstevel@tonic-gate #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
2267c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
2277c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
2287c478bd9Sstevel@tonic-gate #  endif /* LA_TYPE */
2297c478bd9Sstevel@tonic-gate #  define FSHIFT	16
2307c478bd9Sstevel@tonic-gate #  define LA_AVENRUN	"avenrun"
2317c478bd9Sstevel@tonic-gate #  if !defined(_AIX4) || _AIX4 < 40300
2327c478bd9Sstevel@tonic-gate #   ifndef __BIT_TYPES_DEFINED__
2337c478bd9Sstevel@tonic-gate #    define SM_INT32	int
2347c478bd9Sstevel@tonic-gate #   endif /* __BIT_TYPES_DEFINED__ */
2357c478bd9Sstevel@tonic-gate #  endif /* !defined(_AIX4) || _AIX4 < 40300 */
2367c478bd9Sstevel@tonic-gate #  if !defined(_AIX4) || _AIX4 < 40200
2377c478bd9Sstevel@tonic-gate #   define SM_CONF_SYSLOG	0
2387c478bd9Sstevel@tonic-gate #  endif /* !defined(_AIX4) || _AIX4 < 40200 */
2397c478bd9Sstevel@tonic-gate # endif /* _AIX3 */
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate 
2427c478bd9Sstevel@tonic-gate /*
2437c478bd9Sstevel@tonic-gate **  IBM AIX 2.2.1 -- actually tested for osupdate level 2706+1773
2447c478bd9Sstevel@tonic-gate **
2457c478bd9Sstevel@tonic-gate **	From Mark Whetzel <markw@wg.waii.com>.
2467c478bd9Sstevel@tonic-gate */
2477c478bd9Sstevel@tonic-gate 
2487c478bd9Sstevel@tonic-gate # ifdef AIX			/* AIX/RT compiler pre-defines this */
2497c478bd9Sstevel@tonic-gate #  include <paths.h>
2507c478bd9Sstevel@tonic-gate #  include <sys/time.h>		/* AIX/RT resource.h does NOT include this */
2517c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
2527c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
2537c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
2547c478bd9Sstevel@tonic-gate #  define HASFCHMOD	0	/* does not have fchmod(2) syscall */
2557c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* use setreuid(2) -lbsd system call */
2567c478bd9Sstevel@tonic-gate #  define HASSETVBUF	1	/* use setvbuf(2) system call */
2577c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT	0	/* does not have setrlimit call */
2587c478bd9Sstevel@tonic-gate #  define HASFLOCK	0	/* does not have flock call - use fcntl */
2597c478bd9Sstevel@tonic-gate #  define HASULIMIT	1	/* use ulimit instead of setrlimit call */
2607c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	0	/* Do we need theirs or ours */
2617c478bd9Sstevel@tonic-gate #  define SYS5SETPGRP	1	/* don't have setpgid on AIX/RT */
2627c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
2637c478bd9Sstevel@tonic-gate #  define BSD4_3		1	/* NOT bsd 4.4 or posix signals */
2647c478bd9Sstevel@tonic-gate #  define GIDSET_T	int
2657c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
2667c478bd9Sstevel@tonic-gate #  define SPT_PADCHAR	'\0'		/* pad process title with nulls */
2677c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_SUBR		/* use our ported loadavgd daemon */
2687c478bd9Sstevel@tonic-gate #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
2697c478bd9Sstevel@tonic-gate #  define ARBPTR_T	int *
2707c478bd9Sstevel@tonic-gate #  define void		int
2717c478bd9Sstevel@tonic-gate typedef int		pid_t;
2727c478bd9Sstevel@tonic-gate /* RTisms for BSD compatibility, specified in the Makefile
2737c478bd9Sstevel@tonic-gate   define BSD		1
2747c478bd9Sstevel@tonic-gate   define BSD_INCLUDES		1
2757c478bd9Sstevel@tonic-gate   define BSD_REMAP_SIGNAL_TO_SIGVEC
2767c478bd9Sstevel@tonic-gate     RTisms needed above */
2777c478bd9Sstevel@tonic-gate /* make this sendmail in a completely different place */
2787c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
2797c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/local/newmail/sendmail.cf"
2807c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
2817c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
2827c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/usr/local/newmail/sendmail.pid"
2837c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
2847c478bd9Sstevel@tonic-gate # endif /* AIX */
2857c478bd9Sstevel@tonic-gate 
2867c478bd9Sstevel@tonic-gate # if defined(_AIX)
2877c478bd9Sstevel@tonic-gate #  define LDA_USE_LOCKF		1
2887c478bd9Sstevel@tonic-gate #  define LDA_USE_SETEUID	1
2897c478bd9Sstevel@tonic-gate # endif /* defined(_AIX) */
2907c478bd9Sstevel@tonic-gate 
2917c478bd9Sstevel@tonic-gate /*
2927c478bd9Sstevel@tonic-gate **  Silicon Graphics IRIX
2937c478bd9Sstevel@tonic-gate **
2947c478bd9Sstevel@tonic-gate **	Compiles on 4.0.1.
2957c478bd9Sstevel@tonic-gate **
2967c478bd9Sstevel@tonic-gate **	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
2977c478bd9Sstevel@tonic-gate **	Use IRIX5 instead of IRIX for IRIX 5.x.
2987c478bd9Sstevel@tonic-gate **
2997c478bd9Sstevel@tonic-gate **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
3007c478bd9Sstevel@tonic-gate **	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
3017c478bd9Sstevel@tonic-gate */
3027c478bd9Sstevel@tonic-gate 
3037c478bd9Sstevel@tonic-gate # ifdef IRIX
3047c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* this is a System-V derived system */
3057c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
3067c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
3077c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
3087c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
3097c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	1	/* can check IP source routing */
3107c478bd9Sstevel@tonic-gate #  define setpgid	BSDsetpgrp
3117c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
3127c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
3137c478bd9Sstevel@tonic-gate #  define SFS_BAVAIL	f_bfree		/* alternate field name */
3147c478bd9Sstevel@tonic-gate #  define SYSLOG_BUFSIZE 512
3157c478bd9Sstevel@tonic-gate #  if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
3167c478bd9Sstevel@tonic-gate     /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */
3177c478bd9Sstevel@tonic-gate #   define _SC_NPROCESSORS_ONLN	_SC_NPROC_ONLN
3187c478bd9Sstevel@tonic-gate #  endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */
3197c478bd9Sstevel@tonic-gate #  ifdef IRIX6
3207c478bd9Sstevel@tonic-gate #   define STAT64	1
3217c478bd9Sstevel@tonic-gate #   define QUAD_T	unsigned long long
3227c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_IRIX6	/* figure out at run time */
3237c478bd9Sstevel@tonic-gate #   define SAFENFSPATHCONF 0	/* pathconf(2) lies on NFS filesystems */
3247c478bd9Sstevel@tonic-gate #  else /* IRIX6 */
3257c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
3267c478bd9Sstevel@tonic-gate 
3277c478bd9Sstevel@tonic-gate #   ifdef IRIX64
3287c478bd9Sstevel@tonic-gate #    define STAT64	1
3297c478bd9Sstevel@tonic-gate #    define QUAD_T	unsigned long long
3307c478bd9Sstevel@tonic-gate #    define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
3317c478bd9Sstevel@tonic-gate #   else /* IRIX64 */
3327c478bd9Sstevel@tonic-gate #    define STAT64	0
3337c478bd9Sstevel@tonic-gate #    define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
3347c478bd9Sstevel@tonic-gate #   endif /* IRIX64 */
3357c478bd9Sstevel@tonic-gate #  endif /* IRIX6 */
3367c478bd9Sstevel@tonic-gate #  if defined(IRIX64) || defined(IRIX5) || defined(IRIX6)
3377c478bd9Sstevel@tonic-gate #   include <sys/cdefs.h>
3387c478bd9Sstevel@tonic-gate #   include <paths.h>
3397c478bd9Sstevel@tonic-gate #   define ARGV_T	char *const *
3407c478bd9Sstevel@tonic-gate #   define HASFCHOWN	1	/* has fchown(2) */
3417c478bd9Sstevel@tonic-gate #   define HASSETRLIMIT	1	/* has setrlimit(2) syscall */
3427c478bd9Sstevel@tonic-gate #   define HASGETDTABLESIZE 1	/* has getdtablesize(2) syscall */
3437c478bd9Sstevel@tonic-gate #   define HASSTRERROR	1	/* has strerror(3) */
3447c478bd9Sstevel@tonic-gate #  else /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
3457c478bd9Sstevel@tonic-gate #   define ARGV_T	const char **
3467c478bd9Sstevel@tonic-gate #   define WAITUNION	1	/* use "union wait" as wait argument type */
3477c478bd9Sstevel@tonic-gate #  endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
3487c478bd9Sstevel@tonic-gate # endif /* IRIX */
3497c478bd9Sstevel@tonic-gate 
3507c478bd9Sstevel@tonic-gate 
3517c478bd9Sstevel@tonic-gate /*
3527c478bd9Sstevel@tonic-gate **  SunOS and Solaris
3537c478bd9Sstevel@tonic-gate **
3547c478bd9Sstevel@tonic-gate **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
3557c478bd9Sstevel@tonic-gate **	Solaris 2.4 (a.k.a. SunOS 5.4).
3567c478bd9Sstevel@tonic-gate */
3577c478bd9Sstevel@tonic-gate 
3587c478bd9Sstevel@tonic-gate # if defined(sun) && !defined(BSD)
3597c478bd9Sstevel@tonic-gate 
3607c478bd9Sstevel@tonic-gate #  include <sys/time.h>
3617c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
3627c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
3637c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
3647c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	1	/* can check IP source routing */
3657c478bd9Sstevel@tonic-gate #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
3667c478bd9Sstevel@tonic-gate #  ifndef HASFCHOWN
3677c478bd9Sstevel@tonic-gate #   define HASFCHOWN	1	/* fchown(2) */
3687c478bd9Sstevel@tonic-gate #  endif /* ! HASFCHOWN */
3697c478bd9Sstevel@tonic-gate 
3707c478bd9Sstevel@tonic-gate #  ifdef __svr4__
3717c478bd9Sstevel@tonic-gate #   define LDA_USE_LOCKF		1
3727c478bd9Sstevel@tonic-gate #   define LDA_USE_SETEUID	1
3737c478bd9Sstevel@tonic-gate #   define _PATH_MAILDIR		"/var/mail"
3747c478bd9Sstevel@tonic-gate #  endif /* __svr4__ */
3757c478bd9Sstevel@tonic-gate 
3767c478bd9Sstevel@tonic-gate #  ifdef SOLARIS_2_3
3777c478bd9Sstevel@tonic-gate #   define SOLARIS	20300	/* for back compat only -- use -DSOLARIS=20300 */
3787c478bd9Sstevel@tonic-gate #  endif /* SOLARIS_2_3 */
3797c478bd9Sstevel@tonic-gate 
3807c478bd9Sstevel@tonic-gate #  if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4))
3817c478bd9Sstevel@tonic-gate #   define SOLARIS	1	/* unknown Solaris version */
3827c478bd9Sstevel@tonic-gate #  endif /* defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) */
3837c478bd9Sstevel@tonic-gate 
3847c478bd9Sstevel@tonic-gate #  ifdef SOLARIS
3857c478bd9Sstevel@tonic-gate 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
3867c478bd9Sstevel@tonic-gate #   ifndef __svr4__
3877c478bd9Sstevel@tonic-gate #    define __svr4__		/* use all System V Release 4 defines below */
3887c478bd9Sstevel@tonic-gate #   endif /* ! __svr4__ */
3897c478bd9Sstevel@tonic-gate #   define GIDSET_T	gid_t
3907c478bd9Sstevel@tonic-gate #   define USE_SA_SIGACTION	1	/* use sa_sigaction field */
3917c478bd9Sstevel@tonic-gate #   define BROKEN_PTHREAD_SLEEP	1	/* sleep after pthread_create() fails */
3927c478bd9Sstevel@tonic-gate #   define HASSTRERROR	1	/* has strerror(3) */
3937c478bd9Sstevel@tonic-gate #   ifndef _PATH_UNIX
3947c478bd9Sstevel@tonic-gate #    define _PATH_UNIX		"/dev/ksyms"
3957c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_UNIX */
3967c478bd9Sstevel@tonic-gate #   ifndef _PATH_VENDOR_CF
3977c478bd9Sstevel@tonic-gate #    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
3987c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_VENDOR_CF */
3997c478bd9Sstevel@tonic-gate #   ifndef _PATH_SENDMAILPID
4007c478bd9Sstevel@tonic-gate #    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
4017c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_SENDMAILPID */
4027c478bd9Sstevel@tonic-gate #   ifndef _PATH_HOSTS
4037c478bd9Sstevel@tonic-gate #    define _PATH_HOSTS		"/etc/inet/hosts"
4047c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_HOSTS */
4057c478bd9Sstevel@tonic-gate #   ifndef SYSLOG_BUFSIZE
4067c478bd9Sstevel@tonic-gate #    define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
4077c478bd9Sstevel@tonic-gate #   endif /* ! SYSLOG_BUFSIZE */
4087c478bd9Sstevel@tonic-gate #   ifndef TZ_TYPE
4097c478bd9Sstevel@tonic-gate #    define TZ_TYPE	TZ_TZNAME
4107c478bd9Sstevel@tonic-gate #   endif /* ! TZ_TYPE */
4117c478bd9Sstevel@tonic-gate #   if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203)
4127c478bd9Sstevel@tonic-gate #    define USESETEUID		1	/* seteuid works as of 2.3 */
4137c478bd9Sstevel@tonic-gate #    define LDA_CONTENTLENGTH	1	/* Needs the Content-Length header */
4147c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */
4157c478bd9Sstevel@tonic-gate #   if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205)
4167c478bd9Sstevel@tonic-gate #    define HASSETREUID	1		/* setreuid works as of 2.5 */
4177c478bd9Sstevel@tonic-gate #    define HASSETREGID	1	/* use setregid(2) to set saved gid */
41849218d4fSjbeck #   if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206)
41949218d4fSjbeck #    define HASSNPRINTF 1	/* has snprintf(3c) starting in 2.6 */
42049218d4fSjbeck #   endif /* SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) */
4217c478bd9Sstevel@tonic-gate #    if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700)
4227c478bd9Sstevel@tonic-gate #     ifndef LA_TYPE
4237c478bd9Sstevel@tonic-gate #      define LA_TYPE	LA_KSTAT	/* use kstat(3k) -- may work in < 2.5 */
4247c478bd9Sstevel@tonic-gate #     endif /* ! LA_TYPE */
4257c478bd9Sstevel@tonic-gate #     ifndef RANDOMSHIFT		/* random() doesn't work well (sometimes) */
4267c478bd9Sstevel@tonic-gate #      define RANDOMSHIFT	8
4277c478bd9Sstevel@tonic-gate #     endif /* ! RANDOMSHIFT */
4287c478bd9Sstevel@tonic-gate #    endif /* SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) */
4297c478bd9Sstevel@tonic-gate #   else /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */
4307c478bd9Sstevel@tonic-gate #    ifndef HASRANDOM
4317c478bd9Sstevel@tonic-gate #     define HASRANDOM	0		/* doesn't have random(3) */
4327c478bd9Sstevel@tonic-gate #    endif /* ! HASRANDOM */
4337c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */
4347c478bd9Sstevel@tonic-gate #   if (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206
4357c478bd9Sstevel@tonic-gate #    define SM_INT32	int	/* 32bit integer */
4367c478bd9Sstevel@tonic-gate #   endif /* (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206 */
4377c478bd9Sstevel@tonic-gate #   if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207)
4387c478bd9Sstevel@tonic-gate #    ifndef LA_TYPE
4397c478bd9Sstevel@tonic-gate #     include <sys/loadavg.h>
4407c478bd9Sstevel@tonic-gate #     if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
4417c478bd9Sstevel@tonic-gate #      include <sys/pset.h>
4427c478bd9Sstevel@tonic-gate #      define LA_TYPE	LA_PSET	/* pset_getloadavg(3c) appears in 2.9 */
4437c478bd9Sstevel@tonic-gate #     else /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
4447c478bd9Sstevel@tonic-gate #      define LA_TYPE	LA_SUBR	/* getloadavg(3c) appears in 2.7 */
4457c478bd9Sstevel@tonic-gate #     endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
4467c478bd9Sstevel@tonic-gate #    endif /* ! LA_TYPE */
4477c478bd9Sstevel@tonic-gate #    define HASGETUSERSHELL 1	/* getusershell(3c) bug fixed in 2.7 */
4487c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */
4497c478bd9Sstevel@tonic-gate #   if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208)
4507c478bd9Sstevel@tonic-gate #    undef _PATH_SENDMAILPID	/* tmpfs /var/run added in 2.8 */
4517c478bd9Sstevel@tonic-gate #    define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
4527c478bd9Sstevel@tonic-gate #    ifndef SMRSH_CMDDIR
4537c478bd9Sstevel@tonic-gate #     define SMRSH_CMDDIR	"/var/adm/sm.bin"
4547c478bd9Sstevel@tonic-gate #    endif /* ! SMRSH_CMDDIR */
4557c478bd9Sstevel@tonic-gate #    define SL_FUDGE	34	/* fudge offset for SyslogPrefixLen */
4567c478bd9Sstevel@tonic-gate #    define HASLDAPGETALIASBYNAME	1	/* added in S8 */
4577c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */
4587c478bd9Sstevel@tonic-gate #   if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
4597c478bd9Sstevel@tonic-gate #    define HASURANDOMDEV	1	/* /dev/[u]random added in S9 */
4607c478bd9Sstevel@tonic-gate #    define HASCLOSEFROM	1	/* closefrom(3c) added in S9 */
4617c478bd9Sstevel@tonic-gate #    define HASFDWALK		1	/* fdwalk(3c) added in S9 */
4627c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
4637c478bd9Sstevel@tonic-gate #   if SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210)
4647c478bd9Sstevel@tonic-gate #    define HASUNSETENV 1       /* unsetenv() added in S10 */
4657c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) */
4667800901eSjbeck #   if SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211)
4677800901eSjbeck #    define GETLDAPALIASBYNAME_VERSION 2	/* changed in S11 */
46839c1a28dSJohn Beck #    define HAVE_NANOSLEEP	1	/* moved from librt to libc in S11 */
4697800901eSjbeck #   endif /* SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) */
4707c478bd9Sstevel@tonic-gate #   ifndef HASGETUSERSHELL
4717c478bd9Sstevel@tonic-gate #    define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps pre-2.7 */
4727c478bd9Sstevel@tonic-gate #   endif /* ! HASGETUSERSHELL */
4737c478bd9Sstevel@tonic-gate 
4747c478bd9Sstevel@tonic-gate #  else /* SOLARIS */
4757c478bd9Sstevel@tonic-gate 			/* SunOS 4.0.3 or 4.1.x */
4767c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
4777c478bd9Sstevel@tonic-gate #   define HASSETREUID	1	/* has setreuid(2) call */
4787c478bd9Sstevel@tonic-gate #   ifndef HASFLOCK
4797c478bd9Sstevel@tonic-gate #    define HASFLOCK	1	/* has flock(2) call */
4807c478bd9Sstevel@tonic-gate #   endif /* ! HASFLOCK */
4817c478bd9Sstevel@tonic-gate #   define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
4827c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
4837c478bd9Sstevel@tonic-gate #   include <memory.h>
4847c478bd9Sstevel@tonic-gate #   include <vfork.h>
4857c478bd9Sstevel@tonic-gate #   ifdef __GNUC__
4867c478bd9Sstevel@tonic-gate #    define strtoul	strtol	/* gcc library bogosity */
4877c478bd9Sstevel@tonic-gate #   endif /* __GNUC__ */
4887c478bd9Sstevel@tonic-gate #   define memmove(d, s, l)	(bcopy((s), (d), (l)))
4897c478bd9Sstevel@tonic-gate #   define atexit(f)	on_exit((f), 0)	/* ugly hack for SunOS */
4907c478bd9Sstevel@tonic-gate #   define SM_INT32	int	/* 32bit integer */
4917c478bd9Sstevel@tonic-gate #   define SM_ALIGN_SIZE (sizeof(long))
4927c478bd9Sstevel@tonic-gate #   define GIDSET_T	int
4937c478bd9Sstevel@tonic-gate #   define SM_CONF_SYSLOG	0
4947c478bd9Sstevel@tonic-gate 
4957c478bd9Sstevel@tonic-gate #   ifdef SUNOS403
4967c478bd9Sstevel@tonic-gate 			/* special tweaking for SunOS 4.0.3 */
4977c478bd9Sstevel@tonic-gate #    include <malloc.h>
4987c478bd9Sstevel@tonic-gate #    define BSD4_3	1	/* 4.3 BSD-based */
4997c478bd9Sstevel@tonic-gate #    define NEEDSTRSTR	1	/* need emulation of strstr(3) routine */
5007c478bd9Sstevel@tonic-gate #    define WAITUNION	1	/* use "union wait" as wait argument type */
5017c478bd9Sstevel@tonic-gate #    undef WIFEXITED
5027c478bd9Sstevel@tonic-gate #    undef WEXITSTATUS
5037c478bd9Sstevel@tonic-gate #    undef HASUNAME
5047c478bd9Sstevel@tonic-gate #    define setpgid	setpgrp
5057c478bd9Sstevel@tonic-gate #    define MODE_T	int
5067c478bd9Sstevel@tonic-gate typedef int		pid_t;
5077c478bd9Sstevel@tonic-gate extern char		*getenv();
5087c478bd9Sstevel@tonic-gate 
5097c478bd9Sstevel@tonic-gate #   else /* SUNOS403 */
5107c478bd9Sstevel@tonic-gate 			/* 4.1.x specifics */
5117c478bd9Sstevel@tonic-gate #    define HASSETSID	1	/* has POSIX setsid(2) call */
5127c478bd9Sstevel@tonic-gate #    define HASSETVBUF	1	/* we have setvbuf(3) in libc */
5137c478bd9Sstevel@tonic-gate 
5147c478bd9Sstevel@tonic-gate #   endif /* SUNOS403 */
5157c478bd9Sstevel@tonic-gate #  endif /* SOLARIS */
5167c478bd9Sstevel@tonic-gate 
5177c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
5187c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
5197c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
5207c478bd9Sstevel@tonic-gate 
5217c478bd9Sstevel@tonic-gate # endif /* defined(sun) && !defined(BSD) */
5227c478bd9Sstevel@tonic-gate 
5237c478bd9Sstevel@tonic-gate /*
5247c478bd9Sstevel@tonic-gate **  DG/UX
5257c478bd9Sstevel@tonic-gate **
5267c478bd9Sstevel@tonic-gate **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
5277c478bd9Sstevel@tonic-gate **	older support.
5287c478bd9Sstevel@tonic-gate **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
5297c478bd9Sstevel@tonic-gate */
5307c478bd9Sstevel@tonic-gate 
5317c478bd9Sstevel@tonic-gate # ifdef DGUX_5_4_2
5327c478bd9Sstevel@tonic-gate #  define DGUX		1
5337c478bd9Sstevel@tonic-gate # endif /* DGUX_5_4_2 */
5347c478bd9Sstevel@tonic-gate 
5357c478bd9Sstevel@tonic-gate # ifdef DGUX
5367c478bd9Sstevel@tonic-gate #  define SYSTEM5	1
5377c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_DGUX
5387c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
5397c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
5407c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
5417c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
5427c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	0	/* does not have <netinet/ip_var.h> */
5437c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) */
5447c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
5457c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
5467c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
5477c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
5487c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
5497c478bd9Sstevel@tonic-gate #  define LDA_USE_LOCKF		1
5507c478bd9Sstevel@tonic-gate 
5517c478bd9Sstevel@tonic-gate /* these include files must be included early on DG/UX */
5527c478bd9Sstevel@tonic-gate #  include <netinet/in.h>
5537c478bd9Sstevel@tonic-gate #  include <arpa/inet.h>
5547c478bd9Sstevel@tonic-gate 
5557c478bd9Sstevel@tonic-gate /* compiler doesn't understand const? */
5567c478bd9Sstevel@tonic-gate #  define const
5577c478bd9Sstevel@tonic-gate 
5587c478bd9Sstevel@tonic-gate #  ifdef DGUX_5_4_2
5597c478bd9Sstevel@tonic-gate #   define inet_addr	dgux_inet_addr
5607c478bd9Sstevel@tonic-gate extern long	dgux_inet_addr();
5617c478bd9Sstevel@tonic-gate #  endif /* DGUX_5_4_2 */
5627c478bd9Sstevel@tonic-gate # endif /* DGUX */
5637c478bd9Sstevel@tonic-gate 
5647c478bd9Sstevel@tonic-gate 
5657c478bd9Sstevel@tonic-gate /*
5667c478bd9Sstevel@tonic-gate **  Digital Ultrix 4.2 - 4.5
5677c478bd9Sstevel@tonic-gate **
5687c478bd9Sstevel@tonic-gate **	Apparently, fcntl locking is broken on 4.2A, in that locks are
5697c478bd9Sstevel@tonic-gate **	not dropped when the process exits.  This causes major problems,
5707c478bd9Sstevel@tonic-gate **	so flock is the only alternative.
5717c478bd9Sstevel@tonic-gate */
5727c478bd9Sstevel@tonic-gate 
5737c478bd9Sstevel@tonic-gate # ifdef ultrix
5747c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
5757c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
5767c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
5777c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
5787c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
5797c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) syscall */
5807c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
5817c478bd9Sstevel@tonic-gate #   define HASFLOCK	1	/* has flock(2) call */
5827c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
5837c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
5847c478bd9Sstevel@tonic-gate #  ifndef BROKEN_RES_SEARCH
5857c478bd9Sstevel@tonic-gate #   define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
5867c478bd9Sstevel@tonic-gate #  endif /* ! BROKEN_RES_SEARCH */
5877c478bd9Sstevel@tonic-gate #  if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621
5887c478bd9Sstevel@tonic-gate #   define NEEDLOCAL_HOSTNAME_LENGTH	1	/* see sendmail/README */
5897c478bd9Sstevel@tonic-gate #  endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */
5907c478bd9Sstevel@tonic-gate #  ifdef vax
5917c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_FLOAT
5927c478bd9Sstevel@tonic-gate #  else /* vax */
5937c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
5947c478bd9Sstevel@tonic-gate #   define LA_AVENRUN	"avenrun"
5957c478bd9Sstevel@tonic-gate #  endif /* vax */
5967c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
5977c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
5987c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
5997c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
6007c478bd9Sstevel@tonic-gate #  define SYSLOG_BUFSIZE	256
6017c478bd9Sstevel@tonic-gate #  define SM_CONF_SYSLOG	0
6027c478bd9Sstevel@tonic-gate # endif /* ultrix */
6037c478bd9Sstevel@tonic-gate 
6047c478bd9Sstevel@tonic-gate 
6057c478bd9Sstevel@tonic-gate /*
6067c478bd9Sstevel@tonic-gate **  OSF/1 for KSR.
6077c478bd9Sstevel@tonic-gate **
6087c478bd9Sstevel@tonic-gate **	Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu>
6097c478bd9Sstevel@tonic-gate */
6107c478bd9Sstevel@tonic-gate 
6117c478bd9Sstevel@tonic-gate # ifdef __ksr__
6127c478bd9Sstevel@tonic-gate #  define __osf__	1	/* get OSF/1 defines below */
6137c478bd9Sstevel@tonic-gate #  ifndef TZ_TYPE
6147c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
6157c478bd9Sstevel@tonic-gate #  endif /* ! TZ_TYPE */
6167c478bd9Sstevel@tonic-gate # endif /* __ksr__ */
6177c478bd9Sstevel@tonic-gate 
6187c478bd9Sstevel@tonic-gate 
6197c478bd9Sstevel@tonic-gate /*
6207c478bd9Sstevel@tonic-gate **  OSF/1 for Intel Paragon.
6217c478bd9Sstevel@tonic-gate **
6227c478bd9Sstevel@tonic-gate **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
6237c478bd9Sstevel@tonic-gate **	of Intel Scalable Systems Divison.
6247c478bd9Sstevel@tonic-gate */
6257c478bd9Sstevel@tonic-gate 
6267c478bd9Sstevel@tonic-gate # ifdef __PARAGON__
6277c478bd9Sstevel@tonic-gate #  define __osf__	1	/* get OSF/1 defines below */
6287c478bd9Sstevel@tonic-gate #  ifndef TZ_TYPE
6297c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
6307c478bd9Sstevel@tonic-gate #  endif /* ! TZ_TYPE */
6317c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
6327c478bd9Sstevel@tonic-gate #  define MAXNAMLEN	NAME_MAX
6337c478bd9Sstevel@tonic-gate # endif /* __PARAGON__ */
6347c478bd9Sstevel@tonic-gate 
6357c478bd9Sstevel@tonic-gate 
6367c478bd9Sstevel@tonic-gate /*
6377c478bd9Sstevel@tonic-gate **  Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1
6387c478bd9Sstevel@tonic-gate **
6397c478bd9Sstevel@tonic-gate **	Tested for 3.2 and 4.0.
6407c478bd9Sstevel@tonic-gate */
6417c478bd9Sstevel@tonic-gate 
6427c478bd9Sstevel@tonic-gate # ifdef __osf__
6437c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* has uname(2) call */
6447c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
6457c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
6467c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
6477c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
6487c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) syscall */
6497c478bd9Sstevel@tonic-gate #  define HASSETLOGIN	1	/* has setlogin(2) */
6507c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	1	/* can check IP source routing */
6517c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
6527c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
6537c478bd9Sstevel@tonic-gate #  define SM_INT32	int	/* 32bit integer */
6547c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
6557c478bd9Sstevel@tonic-gate #   include <standards.h>
6567c478bd9Sstevel@tonic-gate #   if _XOPEN_SOURCE+0 >= 400
6577c478bd9Sstevel@tonic-gate #    define HASFLOCK	0	/* 5.0 and later has bad flock(2) call */
6587c478bd9Sstevel@tonic-gate #   else /* _XOPEN_SOURCE+0 >= 400 */
6597c478bd9Sstevel@tonic-gate #    define HASFLOCK	1	/* has flock(2) call */
6607c478bd9Sstevel@tonic-gate #   endif /* _XOPEN_SOURCE+0 >= 400 */
6617c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
6627c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_ALPHAOSF
6637c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATVFS	/* use <sys/statvfs.h> statfs() impl */
6647c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
6657c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/var/adm/sendmail/sendmail.cf"
6667c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
6677c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
6687c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
6697c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
6707c478bd9Sstevel@tonic-gate #  if _FFR_DIGUNIX_SAFECHOWN
6717c478bd9Sstevel@tonic-gate /*
6727c478bd9Sstevel@tonic-gate **  Testing on a Digital UNIX 4.0a system showed this to be the correct
6737c478bd9Sstevel@tonic-gate **  setting but given the security consequences, more testing and
6747c478bd9Sstevel@tonic-gate **  verification is needed.  Unfortunately, the man page offers no
6757c478bd9Sstevel@tonic-gate **  assistance.
6767c478bd9Sstevel@tonic-gate */
6777c478bd9Sstevel@tonic-gate #   define IS_SAFE_CHOWN >= 0
6787c478bd9Sstevel@tonic-gate #  endif /* _FFR_DIGUNIX_SAFECHOWN */
6797c478bd9Sstevel@tonic-gate # endif /* __osf__ */
6807c478bd9Sstevel@tonic-gate 
6817c478bd9Sstevel@tonic-gate 
6827c478bd9Sstevel@tonic-gate /*
6837c478bd9Sstevel@tonic-gate **  NeXTstep
6847c478bd9Sstevel@tonic-gate */
6857c478bd9Sstevel@tonic-gate 
6867c478bd9Sstevel@tonic-gate # ifdef NeXT
6877c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
6887c478bd9Sstevel@tonic-gate #  define NEEDPUTENV	2	/* need putenv(3) call; no setenv(3) call */
6897c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
6907c478bd9Sstevel@tonic-gate #   define HASFLOCK	1	/* has flock(2) call */
6917c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
6927c478bd9Sstevel@tonic-gate #  define UID_T		int	/* compiler gripes on uid_t */
6937c478bd9Sstevel@tonic-gate #  define GID_T		int	/* ditto for gid_t */
6947c478bd9Sstevel@tonic-gate #  define MODE_T	int	/* and mode_t */
6957c478bd9Sstevel@tonic-gate #  define setpgid	setpgrp
6967c478bd9Sstevel@tonic-gate #  ifndef NOT_SENDMAIL
6977c478bd9Sstevel@tonic-gate #   define sleep		sleepX
6987c478bd9Sstevel@tonic-gate #  endif /* ! NOT_SENDMAIL */
6997c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
7007c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_MACH
7017c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
7027c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
7037c478bd9Sstevel@tonic-gate #  ifdef _POSIX_SOURCE
7047c478bd9Sstevel@tonic-gate extern struct passwd	*getpwent();
7057c478bd9Sstevel@tonic-gate #  else /* _POSIX_SOURCE */
7067c478bd9Sstevel@tonic-gate #   define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
7077c478bd9Sstevel@tonic-gate #   define WAITUNION	1	/* use "union wait" as wait argument type */
7087c478bd9Sstevel@tonic-gate typedef int		pid_t;
7097c478bd9Sstevel@tonic-gate #   undef WEXITSTATUS
7107c478bd9Sstevel@tonic-gate #   undef WIFEXITED
7117c478bd9Sstevel@tonic-gate #   undef WIFSTOPPED
7127c478bd9Sstevel@tonic-gate #   undef WTERMSIG
7137c478bd9Sstevel@tonic-gate #  endif /* _POSIX_SOURCE */
7147c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
7157c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/etc/sendmail/sendmail.cf"
7167c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
7177c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
7187c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
7197c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
7207c478bd9Sstevel@tonic-gate #  define SM_INT32	int	/* 32bit integer */
7217c478bd9Sstevel@tonic-gate 
7227c478bd9Sstevel@tonic-gate #  ifdef TCPWRAPPERS
7237c478bd9Sstevel@tonic-gate #   ifndef HASUNSETENV
7247c478bd9Sstevel@tonic-gate #    define HASUNSETENV	1
7257c478bd9Sstevel@tonic-gate #   endif /* ! HASUNSETENV */
7267c478bd9Sstevel@tonic-gate #   undef NEEDPUTENV
7277c478bd9Sstevel@tonic-gate #  endif /* TCPWRAPPERS */
7287c478bd9Sstevel@tonic-gate #  ifndef __APPLE__
7297c478bd9Sstevel@tonic-gate #   include <libc.h>
7307c478bd9Sstevel@tonic-gate #   ifndef S_IRUSR
7317c478bd9Sstevel@tonic-gate #    define S_IRUSR	S_IREAD
7327c478bd9Sstevel@tonic-gate #   endif /* ! S_IRUSR */
7337c478bd9Sstevel@tonic-gate #   ifndef S_IWUSR
7347c478bd9Sstevel@tonic-gate #    define S_IWUSR	S_IWRITE
7357c478bd9Sstevel@tonic-gate #   endif /* ! S_IWUSR */
7367c478bd9Sstevel@tonic-gate #   define _PATH_MAILDIR	"/usr/spool/mail"
7377c478bd9Sstevel@tonic-gate #  endif /* ! __APPLE__ */
7387c478bd9Sstevel@tonic-gate #  ifndef isascii
7397c478bd9Sstevel@tonic-gate #   define isascii(c)	((unsigned)(c) <= 0177)
7407c478bd9Sstevel@tonic-gate #  endif /* ! isascii */
7417c478bd9Sstevel@tonic-gate # endif /* NeXT */
7427c478bd9Sstevel@tonic-gate 
7437c478bd9Sstevel@tonic-gate /*
7447c478bd9Sstevel@tonic-gate **  Apple Darwin
7457c478bd9Sstevel@tonic-gate **      Contributed by Wilfredo Sanchez <wsanchez@mit.edu>
7467c478bd9Sstevel@tonic-gate */
7477c478bd9Sstevel@tonic-gate 
7487c478bd9Sstevel@tonic-gate # if defined(DARWIN)
7497c478bd9Sstevel@tonic-gate #  define HASFCHMOD		1	/* has fchmod(2) */
7507c478bd9Sstevel@tonic-gate #  define HASFCHOWN		1	/* has fchown(2) */
7517c478bd9Sstevel@tonic-gate #  define HASFLOCK		1	/* has flock(2) */
7527c478bd9Sstevel@tonic-gate #  define HASUNAME		1	/* has uname(2) */
7537c478bd9Sstevel@tonic-gate #  define HASUNSETENV		1	/* has unsetenv(3) */
75449218d4fSjbeck #  define HASSETSID		1	/* has POSIX setsid(2) call */
75549218d4fSjbeck #  define HASINITGROUPS		1	/* has initgroups(3) */
7567c478bd9Sstevel@tonic-gate #  define HASSETVBUF		1	/* has setvbuf (3) */
7577c478bd9Sstevel@tonic-gate #  define HASSETREUID		0	/* setreuid(2) unusable */
7587c478bd9Sstevel@tonic-gate #  define HASSETEUID		1	/* has seteuid(2) */
7597c478bd9Sstevel@tonic-gate #  define USESETEUID		1	/* has seteuid(2) */
7607c478bd9Sstevel@tonic-gate #  define HASSETEGID		1	/* has setegid(2) */
7617c478bd9Sstevel@tonic-gate #  define HASSETREGID		1	/* has setregid(2) */
7627c478bd9Sstevel@tonic-gate #  define HASSETRESGID		0	/* no setresgid(2) */
7637c478bd9Sstevel@tonic-gate #  define HASLSTAT		1	/* has lstat(2) */
7647c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT		1	/* has setrlimit(2) */
7657c478bd9Sstevel@tonic-gate #  define HASWAITPID		1	/* has waitpid(2) */
7667c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE	1	/* has getdtablesize(2) */
7677c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN		1	/* has st_gen field in struct stat */
76849218d4fSjbeck #  define HASURANDOMDEV		1	/* has urandom(4) */
7697c478bd9Sstevel@tonic-gate #  define HASSTRERROR		1	/* has strerror(3) */
7707c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL	1	/* had getusershell(3) */
7717c478bd9Sstevel@tonic-gate #  define GIDSET_T		gid_t	/* getgroups(2) takes gid_t */
7727c478bd9Sstevel@tonic-gate #  define LA_TYPE		LA_SUBR	/* use getloadavg(3) */
7737c478bd9Sstevel@tonic-gate #  define SFS_TYPE		SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
774445f2479Sjbeck #  if DARWIN >= 70000
775445f2479Sjbeck #   define SOCKADDR_LEN_T	socklen_t
776445f2479Sjbeck #  endif
77749218d4fSjbeck #  if DARWIN >= 80000
77849218d4fSjbeck #   define SPT_TYPE		SPT_REUSEARGV
77949218d4fSjbeck #   define SPT_PADCHAR		'\0'
78049218d4fSjbeck #   define SOCKOPT_LEN_T	socklen_t
78149218d4fSjbeck #  else
78249218d4fSjbeck #   define SPT_TYPE		SPT_PSSTRINGS	/* use magic PS_STRINGS pointer for setproctitle */
78349218d4fSjbeck #  endif
7847c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED		/* don't declare sys_errlist */
7857c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR		/* struct sockaddr has sa_len */
7867c478bd9Sstevel@tonic-gate #  define SAFENFSPATHCONF	0	/* unverified: pathconf(2) doesn't work on NFS */
7877c478bd9Sstevel@tonic-gate #  define HAS_IN_H		1
7887c478bd9Sstevel@tonic-gate #  define NETLINK		1	/* supports AF_LINK */
7897c478bd9Sstevel@tonic-gate #  ifndef NOT_SENDMAIL
7907c478bd9Sstevel@tonic-gate #   define sleep sleepX
7917c478bd9Sstevel@tonic-gate extern unsigned int sleepX __P((unsigned int seconds));
7927c478bd9Sstevel@tonic-gate #  endif /* ! NOT_SENDMAIL */
7937c478bd9Sstevel@tonic-gate # endif /* defined(DARWIN) */
7947c478bd9Sstevel@tonic-gate 
7957c478bd9Sstevel@tonic-gate 
7967c478bd9Sstevel@tonic-gate /*
7977c478bd9Sstevel@tonic-gate **  4.4 BSD
7987c478bd9Sstevel@tonic-gate **
7997c478bd9Sstevel@tonic-gate **	See also BSD defines.
8007c478bd9Sstevel@tonic-gate */
8017c478bd9Sstevel@tonic-gate 
80249218d4fSjbeck # if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN)
8037c478bd9Sstevel@tonic-gate #  include <paths.h>
8047c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
8057c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
8067c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
8077c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) syscall */
8087c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
8097c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
8107c478bd9Sstevel@tonic-gate #  include <sys/cdefs.h>
8117c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
8127c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR	/* has sa_len */
8137c478bd9Sstevel@tonic-gate #  define NEED_PRINTF_PERCENTQ	1	/* doesn't have %lld */
8147c478bd9Sstevel@tonic-gate #  define NETLINK	1	/* supports AF_LINK */
8157c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
8167c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_SUBR
8177c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
8187c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
8197c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
82049218d4fSjbeck # endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN)*/
8217c478bd9Sstevel@tonic-gate 
8227c478bd9Sstevel@tonic-gate 
8237c478bd9Sstevel@tonic-gate /*
8247c478bd9Sstevel@tonic-gate **  BSD/OS (was BSD/386) (all versions)
8257c478bd9Sstevel@tonic-gate **	From Tony Sanders, BSDI
8267c478bd9Sstevel@tonic-gate */
8277c478bd9Sstevel@tonic-gate 
8287c478bd9Sstevel@tonic-gate # ifdef __bsdi__
8297c478bd9Sstevel@tonic-gate #  include <paths.h>
8307c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has the unsetenv(3) call */
8317c478bd9Sstevel@tonic-gate #  define HASSETREUID	0	/* BSD-OS has broken setreuid(2) emulation */
8327c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
8337c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
8347c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
8357c478bd9Sstevel@tonic-gate #  define HASSETLOGIN	1	/* has setlogin(2) */
8367c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* has uname(2) syscall */
8377c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
8387c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
8397c478bd9Sstevel@tonic-gate #  include <sys/cdefs.h>
8407c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
8417c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR	/* has sa_len */
8427c478bd9Sstevel@tonic-gate #  define NETLINK	1	/* supports AF_LINK */
8437c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
8447c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
8457c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_SUBR
8467c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
8477c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
8487c478bd9Sstevel@tonic-gate #  define QUAD_T		quad_t
8497c478bd9Sstevel@tonic-gate #  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
8507c478bd9Sstevel@tonic-gate 			/* version 1.1 or later */
8517c478bd9Sstevel@tonic-gate #   undef SPT_TYPE
8527c478bd9Sstevel@tonic-gate #   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
8537c478bd9Sstevel@tonic-gate #  else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
8547c478bd9Sstevel@tonic-gate 			/* version 1.0 or earlier */
8557c478bd9Sstevel@tonic-gate #   define SPT_PADCHAR	'\0'	/* pad process title with nulls */
8567c478bd9Sstevel@tonic-gate #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
8577c478bd9Sstevel@tonic-gate #  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701	/* on 3.x */
8587c478bd9Sstevel@tonic-gate #   define HASSETUSERCONTEXT 1	/* has setusercontext */
8597c478bd9Sstevel@tonic-gate #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */
8607c478bd9Sstevel@tonic-gate #  if defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701	/* 3.1 and earlier */
8617c478bd9Sstevel@tonic-gate #   define MODE_T	int	/* va_arg() can't handle less than int */
8627c478bd9Sstevel@tonic-gate #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 */
8637c478bd9Sstevel@tonic-gate #  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910	/* on 4.x */
8647c478bd9Sstevel@tonic-gate #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
8657c478bd9Sstevel@tonic-gate #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 */
8667c478bd9Sstevel@tonic-gate # endif /* __bsdi__ */
8677c478bd9Sstevel@tonic-gate 
8687c478bd9Sstevel@tonic-gate 
8694aac33d3Sjbeck # if defined(__QNX__)
8704aac33d3Sjbeck #  if defined(__QNXNTO__)
8714aac33d3Sjbeck /* QNX 6 */
8724aac33d3Sjbeck #   include <unix.h>
8734aac33d3Sjbeck #   define HASUNSETENV	1	/* has unsetenv(3) call */
8744aac33d3Sjbeck #   define HASINITGROUPS	1	/* has initgroups(3) call */
8754aac33d3Sjbeck #   define HASSETSID	1	/* has POSIX setsid(2) call */
8764aac33d3Sjbeck #   define USESETEUID	1	/* has usable seteuid(2) call */
8774aac33d3Sjbeck #   define HASFCHMOD	1	/* has fchmod(2) syscall */
8784aac33d3Sjbeck #   define HASFCHOWN	1	/* has fchown(2) syscall */
8794aac33d3Sjbeck #   define HASUNAME	1	/* has uname(2) syscall */
8804aac33d3Sjbeck #   define HASSTRERROR	1	/* has strerror(3) */
8814aac33d3Sjbeck #   define BSD4_4_SOCKADDR	/* has sa_len */
8824aac33d3Sjbeck #   define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
8834aac33d3Sjbeck #   define NETLINK	1	/* supports AF_LINK */
8844aac33d3Sjbeck #   define GIDSET_T	gid_t
8854aac33d3Sjbeck #   define QUAD_T	uint64_t
8864aac33d3Sjbeck #   define HASSNPRINTF	1	/* has snprintf(3) (all versions?) */
8874aac33d3Sjbeck #   define HASGETUSERSHELL 0
8884aac33d3Sjbeck 
8894aac33d3Sjbeck /*
8904aac33d3Sjbeck **  We have a strrev() that doesn't allocate anything.
8914aac33d3Sjbeck **  Make sure the one here is used.
8924aac33d3Sjbeck */
8934aac33d3Sjbeck 
8944aac33d3Sjbeck #   define strrev strrev_sendmail
8954aac33d3Sjbeck 
8964aac33d3Sjbeck #  else /* defined(__QNXNTO__) */
8974aac33d3Sjbeck 
8987c478bd9Sstevel@tonic-gate /*
8997c478bd9Sstevel@tonic-gate **  QNX 4.2x
9007c478bd9Sstevel@tonic-gate **	Contributed by Glen McCready <glen@qnx.com>.
9017c478bd9Sstevel@tonic-gate **
9024aac33d3Sjbeck **	Should work with all versions of QNX 4.
9037c478bd9Sstevel@tonic-gate */
9047c478bd9Sstevel@tonic-gate 
9054aac33d3Sjbeck #   include <unix.h>
9064aac33d3Sjbeck #   include <sys/select.h>
9074aac33d3Sjbeck #   undef NGROUPS_MAX
9084aac33d3Sjbeck #   define HASSETSID	1	/* has POSIX setsid(2) call */
9094aac33d3Sjbeck #   define USESETEUID	1	/* has usable seteuid(2) call */
9104aac33d3Sjbeck #   define HASFCHMOD	1	/* has fchmod(2) syscall */
9114aac33d3Sjbeck #   define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
9124aac33d3Sjbeck #   define HASSETREUID	1	/* has setreuid(2) call */
9134aac33d3Sjbeck #   define HASSTRERROR	1	/* has strerror(3) */
9144aac33d3Sjbeck #   define HASFLOCK	0
9154aac33d3Sjbeck #   undef HASINITGROUPS		/* has initgroups(3) call */
9164aac33d3Sjbeck #   define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
9174aac33d3Sjbeck #   define IP_SRCROUTE	1	/* can check IP source routing */
9184aac33d3Sjbeck #   define TZ_TYPE	TZ_TMNAME	/* use tmname variable */
9194aac33d3Sjbeck #   define GIDSET_T	gid_t
9204aac33d3Sjbeck #   define LA_TYPE	LA_ZERO
9214aac33d3Sjbeck #   define SFS_TYPE	SFS_NONE
9224aac33d3Sjbeck #   define SPT_TYPE	SPT_REUSEARGV
9234aac33d3Sjbeck #   define SPT_PADCHAR	'\0'	/* pad process title with nulls */
9244aac33d3Sjbeck #   define HASGETUSERSHELL 0
9254aac33d3Sjbeck #   define _FILE_H_INCLUDED
9264aac33d3Sjbeck #  endif /* defined(__QNXNTO__) */
9277c478bd9Sstevel@tonic-gate # endif /* defined(__QNX__) */
9287c478bd9Sstevel@tonic-gate 
9297c478bd9Sstevel@tonic-gate 
9307c478bd9Sstevel@tonic-gate /*
9317c478bd9Sstevel@tonic-gate **  DragonFly BSD/ FreeBSD / NetBSD / OpenBSD (all architectures, all versions)
9327c478bd9Sstevel@tonic-gate **
9337c478bd9Sstevel@tonic-gate **  4.3BSD clone, closer to 4.4BSD	for FreeBSD 1.x and NetBSD 0.9x
9347c478bd9Sstevel@tonic-gate **  4.4BSD-Lite based			for FreeBSD 2.x and NetBSD 1.x
9357c478bd9Sstevel@tonic-gate **
9367c478bd9Sstevel@tonic-gate **	See also BSD defines.
9377c478bd9Sstevel@tonic-gate */
9387c478bd9Sstevel@tonic-gate 
9397c478bd9Sstevel@tonic-gate # if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
9407c478bd9Sstevel@tonic-gate #  include <paths.h>
9417c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
9427c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
9437c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
9447c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
9457c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) syscall */
9467c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* has uname(2) syscall */
9477c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
9487c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
9497c478bd9Sstevel@tonic-gate #  define NEED_PRINTF_PERCENTQ	1	/* doesn't have %lld */
9507c478bd9Sstevel@tonic-gate #  include <sys/cdefs.h>
9517c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
9527c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR	/* has sa_len */
9537c478bd9Sstevel@tonic-gate #  define NETLINK	1	/* supports AF_LINK */
9547c478bd9Sstevel@tonic-gate #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
9557c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
95649218d4fSjbeck #  define QUAD_T	unsigned long long
95749218d4fSjbeck #  define HASSNPRINTF	1	/* has snprintf(3) (all versions?) */
9587c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
9597c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_SUBR
9607c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
961445f2479Sjbeck #  if defined(__NetBSD__) && defined(__NetBSD_Version__) && \
962445f2479Sjbeck     ((__NetBSD_Version__ >= 200040000 && __NetBSD_Version__ < 200090000) || \
963445f2479Sjbeck     (__NetBSD_Version__ >= 299000900))
9647c478bd9Sstevel@tonic-gate #   undef SFS_TYPE
9657c478bd9Sstevel@tonic-gate #   define SFS_TYPE	SFS_STATVFS
9667c478bd9Sstevel@tonic-gate #  else
9677c478bd9Sstevel@tonic-gate #   define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
9687c478bd9Sstevel@tonic-gate #  endif
9697c478bd9Sstevel@tonic-gate #  if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1)
9707c478bd9Sstevel@tonic-gate #   undef SPT_TYPE
9717c478bd9Sstevel@tonic-gate #   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
9727c478bd9Sstevel@tonic-gate #  endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */
9737c478bd9Sstevel@tonic-gate #  if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3))
9747c478bd9Sstevel@tonic-gate #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
9757c478bd9Sstevel@tonic-gate #  endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */
9767c478bd9Sstevel@tonic-gate #  if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104170000
9777c478bd9Sstevel@tonic-gate #   define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
9787c478bd9Sstevel@tonic-gate #  endif
979445f2479Sjbeck #  if defined(__NetBSD__) && defined(__NetBSD_Version__) && \
980445f2479Sjbeck     ((__NetBSD_Version__ >= 200060000 && __NetBSD_Version__ < 200090000) || \
981445f2479Sjbeck     (__NetBSD_Version__ >= 299000900))
9827c478bd9Sstevel@tonic-gate #   define HASCLOSEFROM	1	/* closefrom(3) added in 2.0F */
9837c478bd9Sstevel@tonic-gate #  endif
9847c478bd9Sstevel@tonic-gate #  if defined(__NetBSD__)
9857c478bd9Sstevel@tonic-gate #   define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
9867c478bd9Sstevel@tonic-gate #   include <sys/param.h>
9877c478bd9Sstevel@tonic-gate #   include <sys/sysctl.h>
9887c478bd9Sstevel@tonic-gate #  endif
9897c478bd9Sstevel@tonic-gate #  if defined(__DragonFly__)
9907c478bd9Sstevel@tonic-gate #   define HASSETLOGIN		1	/* has setlogin(2) */
9917c478bd9Sstevel@tonic-gate #   define HASSRANDOMDEV	1	/* has srandomdev(3) */
9927c478bd9Sstevel@tonic-gate #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
9937c478bd9Sstevel@tonic-gate #   undef SPT_TYPE
9947c478bd9Sstevel@tonic-gate #   include <libutil.h>
9957c478bd9Sstevel@tonic-gate #   define SPT_TYPE		SPT_BUILTIN
9967c478bd9Sstevel@tonic-gate #   define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
9977c478bd9Sstevel@tonic-gate #   ifndef SMRSH_CMDDIR
9987c478bd9Sstevel@tonic-gate #    define SMRSH_CMDDIR	"/usr/libexec/sm.bin"
9997c478bd9Sstevel@tonic-gate #   endif /* ! SMRSH_CMDDIR */
10007c478bd9Sstevel@tonic-gate #   ifndef SMRSH_PATH
10017c478bd9Sstevel@tonic-gate #    define SMRSH_PATH		"/bin:/usr/bin"
10027c478bd9Sstevel@tonic-gate #   endif /* ! SMRSH_PATH */
10037c478bd9Sstevel@tonic-gate #  define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
10047c478bd9Sstevel@tonic-gate #  include <sys/sysctl.h>
10057c478bd9Sstevel@tonic-gate #  endif /* defined(__DragonFly__) */
10067c478bd9Sstevel@tonic-gate #  if defined(__FreeBSD__)
10077c478bd9Sstevel@tonic-gate #   define HASSETLOGIN	1	/* has setlogin(2) */
10087c478bd9Sstevel@tonic-gate #   if __FreeBSD_version >= 227001
10097c478bd9Sstevel@tonic-gate #    define HASSRANDOMDEV	1	/* has srandomdev(3) */
10107c478bd9Sstevel@tonic-gate #    define HASURANDOMDEV	1	/* has /dev/urandom(4) */
10117c478bd9Sstevel@tonic-gate #   endif /* __FreeBSD_version >= 227001 */
10127c478bd9Sstevel@tonic-gate #   undef SPT_TYPE
10137c478bd9Sstevel@tonic-gate #   if __FreeBSD__ >= 2
10147c478bd9Sstevel@tonic-gate #    include <osreldate.h>
10157c478bd9Sstevel@tonic-gate #    if __FreeBSD_version >= 199512	/* 2.2-current when it appeared */
10167c478bd9Sstevel@tonic-gate #     include <libutil.h>
10177c478bd9Sstevel@tonic-gate #     define SPT_TYPE	SPT_BUILTIN
10187c478bd9Sstevel@tonic-gate #    endif /* __FreeBSD_version >= 199512 */
10197c478bd9Sstevel@tonic-gate #    if __FreeBSD_version >= 222000	/* 2.2.2-release and later */
10207c478bd9Sstevel@tonic-gate #     define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
10217c478bd9Sstevel@tonic-gate #    endif /* __FreeBSD_version >= 222000 */
10227c478bd9Sstevel@tonic-gate #    if __FreeBSD_version >= 330000	/* 3.3.0-release and later */
10237c478bd9Sstevel@tonic-gate #     ifndef SMRSH_CMDDIR
10247c478bd9Sstevel@tonic-gate #      define SMRSH_CMDDIR	"/usr/libexec/sm.bin"
10257c478bd9Sstevel@tonic-gate #     endif /* ! SMRSH_CMDDIR */
10267c478bd9Sstevel@tonic-gate #     ifndef SMRSH_PATH
10277c478bd9Sstevel@tonic-gate #      define SMRSH_PATH	"/bin:/usr/bin"
10287c478bd9Sstevel@tonic-gate #     endif /* ! SMRSH_PATH */
10297c478bd9Sstevel@tonic-gate #    endif /* __FreeBSD_version >= 330000 */
1030*e9af4bc0SJohn Beck #    if __FreeBSD_version >= 430000	/* 4.3.0-release and later */
1031*e9af4bc0SJohn Beck #     define SOCKADDR_LEN_T	socklen_t	/* e.g., arg#3 to accept, getsockname */
1032*e9af4bc0SJohn Beck #     define SOCKOPT_LEN_T	socklen_t	/* arg#5 to getsockopt */
1033*e9af4bc0SJohn Beck #    endif /* __FreeBSD_version >= 430000 */
10347c478bd9Sstevel@tonic-gate #    define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
10357c478bd9Sstevel@tonic-gate #    include <sys/sysctl.h>
10367c478bd9Sstevel@tonic-gate #   endif /* __FreeBSD__ >= 2 */
10377c478bd9Sstevel@tonic-gate #   ifndef SPT_TYPE
10387c478bd9Sstevel@tonic-gate #    define SPT_TYPE	SPT_REUSEARGV
10397c478bd9Sstevel@tonic-gate #    define SPT_PADCHAR	'\0'		/* pad process title with nulls */
10407c478bd9Sstevel@tonic-gate #   endif /* ! SPT_TYPE */
10417c478bd9Sstevel@tonic-gate #  endif /* defined(__FreeBSD__) */
10427c478bd9Sstevel@tonic-gate #  if defined(__OpenBSD__)
10437c478bd9Sstevel@tonic-gate #   undef SPT_TYPE
10447c478bd9Sstevel@tonic-gate #   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
10457c478bd9Sstevel@tonic-gate #   define HASSETLOGIN	1	/* has setlogin(2) */
10467c478bd9Sstevel@tonic-gate #   if OpenBSD < 200305
10477c478bd9Sstevel@tonic-gate #    define HASSETREUID	0	/* setreuid(2) broken in OpenBSD < 3.3 */
10487c478bd9Sstevel@tonic-gate #   endif /* OpenBSD < 200305 */
10497c478bd9Sstevel@tonic-gate #   define HASSETEGID	1	/* use setegid(2) to set saved gid */
10507c478bd9Sstevel@tonic-gate #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
10517c478bd9Sstevel@tonic-gate #   if OpenBSD >= 200006
10527c478bd9Sstevel@tonic-gate #    define HASSRANDOMDEV	1	/* has srandomdev(3) */
10537c478bd9Sstevel@tonic-gate #   endif /* OpenBSD >= 200006 */
10547c478bd9Sstevel@tonic-gate #   if OpenBSD >= 200012
10557c478bd9Sstevel@tonic-gate #    define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
10567c478bd9Sstevel@tonic-gate #   endif /* OpenBSD >= 200012 */
10577c478bd9Sstevel@tonic-gate #   if OpenBSD >= 200405
10587c478bd9Sstevel@tonic-gate #    define HASCLOSEFROM	1	/* closefrom(3) added in 3.5 */
10597c478bd9Sstevel@tonic-gate #   endif /* OpenBSD >= 200405 */
106049218d4fSjbeck #   if OpenBSD >= 200505
106149218d4fSjbeck #    undef NETISO	/* iso.h removed in 3.7 */
106249218d4fSjbeck #   endif /* OpenBSD >= 200505 */
10637c478bd9Sstevel@tonic-gate #  endif /* defined(__OpenBSD__) */
10647c478bd9Sstevel@tonic-gate # endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */
10657c478bd9Sstevel@tonic-gate 
10667c478bd9Sstevel@tonic-gate 
10677c478bd9Sstevel@tonic-gate /*
10687c478bd9Sstevel@tonic-gate **  Mach386
10697c478bd9Sstevel@tonic-gate **
10707c478bd9Sstevel@tonic-gate **	For mt Xinu's Mach386 system.
10717c478bd9Sstevel@tonic-gate */
10727c478bd9Sstevel@tonic-gate 
10737c478bd9Sstevel@tonic-gate # if defined(MACH) && defined(i386) && !defined(__GNU__)
10747c478bd9Sstevel@tonic-gate #  define MACH386	1
10757c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
10767c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
10777c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
10787c478bd9Sstevel@tonic-gate #   define HASFLOCK	1	/* has flock(2) call */
10797c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
10807c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
10817c478bd9Sstevel@tonic-gate #  define NEEDSTRTOL	1	/* need the strtol() function */
10827c478bd9Sstevel@tonic-gate #  define setpgid	setpgrp
10837c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
10847c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_FLOAT
10857c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
10867c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
10877c478bd9Sstevel@tonic-gate #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
10887c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
10897c478bd9Sstevel@tonic-gate #  undef WIFEXITED
10907c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
10917c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
10927c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
10937c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
10947c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
10957c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
10967c478bd9Sstevel@tonic-gate # endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */
10977c478bd9Sstevel@tonic-gate 
10987c478bd9Sstevel@tonic-gate 
10997c478bd9Sstevel@tonic-gate 
11007c478bd9Sstevel@tonic-gate /*
11017c478bd9Sstevel@tonic-gate **  GNU OS (hurd)
11027c478bd9Sstevel@tonic-gate **	Largely BSD & posix compatible.
11037c478bd9Sstevel@tonic-gate **	Port contributed by Miles Bader <miles@gnu.ai.mit.edu>.
11047c478bd9Sstevel@tonic-gate **	Updated by Mark Kettenis <kettenis@wins.uva.nl>.
11057c478bd9Sstevel@tonic-gate */
11067c478bd9Sstevel@tonic-gate 
11077c478bd9Sstevel@tonic-gate # if defined(__GNU__) && !defined(NeXT)
11087c478bd9Sstevel@tonic-gate #  include <paths.h>
11097c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) call */
11107c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) call */
11117c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* has uname(2) call */
11127c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
11137c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
11147c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
11157c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
11167c478bd9Sstevel@tonic-gate #  define SOCKADDR_LEN_T	socklen_t
11177c478bd9Sstevel@tonic-gate #  define SOCKOPT_LEN_T	socklen_t
11187c478bd9Sstevel@tonic-gate #  if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2
11197c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_SUBR
11207c478bd9Sstevel@tonic-gate #  else /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
11217c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_MACH
11227c478bd9Sstevel@tonic-gate    /* GNU uses mach[34], which renames some rpcs from mach2.x. */
11237c478bd9Sstevel@tonic-gate #   define host_self	mach_host_self
11247c478bd9Sstevel@tonic-gate #  endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
11257c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATFS
11267c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_CHANGEARGV
11277c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED	1	/* don't declare sys_errlist */
11287c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR	1	/* has sa_len */
11297c478bd9Sstevel@tonic-gate #  define SIOCGIFCONF_IS_BROKEN  1	/* SIOCGFCONF doesn't work */
11307c478bd9Sstevel@tonic-gate #  define HAS_IN_H	1	/* GNU has netinet/in.h. */
11317c478bd9Sstevel@tonic-gate /* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */
11327c478bd9Sstevel@tonic-gate #  define MAXPATHLEN	2048
11337c478bd9Sstevel@tonic-gate # endif /* defined(__GNU__) && !defined(NeXT) */
11347c478bd9Sstevel@tonic-gate 
11357c478bd9Sstevel@tonic-gate /*
11367c478bd9Sstevel@tonic-gate **  4.3 BSD -- this is for very old systems
11377c478bd9Sstevel@tonic-gate **
11387c478bd9Sstevel@tonic-gate **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
11397c478bd9Sstevel@tonic-gate **
11407c478bd9Sstevel@tonic-gate **	You'll also have to install a new resolver library.
11417c478bd9Sstevel@tonic-gate **	I don't guarantee that support for this environment is complete.
11427c478bd9Sstevel@tonic-gate */
11437c478bd9Sstevel@tonic-gate 
11447c478bd9Sstevel@tonic-gate # if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
11457c478bd9Sstevel@tonic-gate #  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
11467c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
11477c478bd9Sstevel@tonic-gate #  define ARBPTR_T	char *
11487c478bd9Sstevel@tonic-gate #  define setpgid	setpgrp
11497c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
11507c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_FLOAT
11517c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
11527c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
11537c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
11547c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
11557c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
11567c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
11577c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
11587c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
11597c478bd9Sstevel@tonic-gate #  undef WIFEXITED
11607c478bd9Sstevel@tonic-gate typedef short		pid_t;
11617c478bd9Sstevel@tonic-gate # endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */
11627c478bd9Sstevel@tonic-gate 
11637c478bd9Sstevel@tonic-gate 
11647c478bd9Sstevel@tonic-gate /*
11657c478bd9Sstevel@tonic-gate **  SCO Unix
11667c478bd9Sstevel@tonic-gate **
11677c478bd9Sstevel@tonic-gate **	This includes three parts:
11687c478bd9Sstevel@tonic-gate **
11697c478bd9Sstevel@tonic-gate **	The first is for SCO OpenServer 5.
11707c478bd9Sstevel@tonic-gate **	(Contributed by Keith Reynolds <keithr@sco.COM>).
11717c478bd9Sstevel@tonic-gate **
11727c478bd9Sstevel@tonic-gate **		SCO OpenServer 5 has a compiler version number macro,
11737c478bd9Sstevel@tonic-gate **		which we can use to figure out what version we're on.
11747c478bd9Sstevel@tonic-gate **		This may have to change in future releases.
11757c478bd9Sstevel@tonic-gate **
11767c478bd9Sstevel@tonic-gate **	The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0.
11777c478bd9Sstevel@tonic-gate **	(Contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
11787c478bd9Sstevel@tonic-gate **
11797c478bd9Sstevel@tonic-gate **	The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier.
11807c478bd9Sstevel@tonic-gate */
11817c478bd9Sstevel@tonic-gate 
11827c478bd9Sstevel@tonic-gate /* SCO OpenServer 5 */
11837c478bd9Sstevel@tonic-gate # if _SCO_DS >= 1
11847c478bd9Sstevel@tonic-gate #  include <paths.h>
11857c478bd9Sstevel@tonic-gate #  define SIOCGIFNUM_IS_BROKEN 1	/* SIOCGIFNUM returns bogus value */
11867c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) call */
11877c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) call */
11887c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
11897c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has seteuid(2) call */
11907c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
11917c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
11927c478bd9Sstevel@tonic-gate #  define RLIMIT_NEEDS_SYS_TIME_H	1