17c478bdstevel@tonic-gate/*
2e9af4bcJohn Beck * Copyright (c) 1998-2009 Sendmail, Inc. and its suppliers.
37c478bdstevel@tonic-gate *	All rights reserved.
47c478bdstevel@tonic-gate * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
57c478bdstevel@tonic-gate * Copyright (c) 1988, 1993
67c478bdstevel@tonic-gate *	The Regents of the University of California.  All rights reserved.
77c478bdstevel@tonic-gate *
87c478bdstevel@tonic-gate * By using this file, you agree to the terms and conditions set
97c478bdstevel@tonic-gate * forth in the LICENSE file which can be found at the top level of
107c478bdstevel@tonic-gate * the sendmail distribution.
117c478bdstevel@tonic-gate *
127c478bdstevel@tonic-gate *
13e9af4bcJohn Beck *	$Id: conf.h,v 1.139 2009/06/16 23:41:32 ca Exp $
147c478bdstevel@tonic-gate */
157c478bdstevel@tonic-gate
167c478bdstevel@tonic-gate/*
1739c1a28John Beck * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
187c478bdstevel@tonic-gate * Use is subject to license terms.
197c478bdstevel@tonic-gate */
207c478bdstevel@tonic-gate
217c478bdstevel@tonic-gate/*
227c478bdstevel@tonic-gate**  CONF.H -- All user-configurable parameters for sendmail
237c478bdstevel@tonic-gate**
24058561cjbeck**	Send updates to Sendmail.ORG so they will be
25058561cjbeck**	included in the next release; see
26058561cjbeck**	http://www.sendmail.org/email-addresses.html
27058561cjbeck**	for current e-mail address.
287c478bdstevel@tonic-gate*/
297c478bdstevel@tonic-gate
307c478bdstevel@tonic-gate#ifndef SM_CONF_H
317c478bdstevel@tonic-gate# define SM_CONF_H 1
327c478bdstevel@tonic-gate
337c478bdstevel@tonic-gate
347c478bdstevel@tonic-gate# include <sm/config.h>
357c478bdstevel@tonic-gate# include <sm/varargs.h>
367c478bdstevel@tonic-gate
377c478bdstevel@tonic-gate/*
387c478bdstevel@tonic-gate**  General "standard C" defines.
397c478bdstevel@tonic-gate**
407c478bdstevel@tonic-gate**	These may be undone later, to cope with systems that claim to
417c478bdstevel@tonic-gate**	be Standard C but aren't.  Gcc is the biggest offender -- it
427c478bdstevel@tonic-gate**	doesn't realize that the library is part of the language.
437c478bdstevel@tonic-gate**
447c478bdstevel@tonic-gate**	Life would be much easier if we could get rid of this sort
457c478bdstevel@tonic-gate**	of bozo problems.
467c478bdstevel@tonic-gate*/
477c478bdstevel@tonic-gate
487c478bdstevel@tonic-gate# ifdef __STDC__
497c478bdstevel@tonic-gate#  define HASSETVBUF	1	/* we have setvbuf(3) in libc */
507c478bdstevel@tonic-gate# endif /* __STDC__ */
517c478bdstevel@tonic-gate
527c478bdstevel@tonic-gate/*
537c478bdstevel@tonic-gate**  Assume you have standard calls; can be #undefed below if necessary.
547c478bdstevel@tonic-gate*/
557c478bdstevel@tonic-gate
567c478bdstevel@tonic-gate# ifndef HASLSTAT
577c478bdstevel@tonic-gate#  define HASLSTAT	1	/* has lstat(2) call */
587c478bdstevel@tonic-gate# endif /* ! HASLSTAT */
597c478bdstevel@tonic-gate
607c478bdstevel@tonic-gate# ifndef HASNICE
617c478bdstevel@tonic-gate#  define HASNICE	1	/* has nice(2) call */
627c478bdstevel@tonic-gate# endif /* ! HASNICE */
637c478bdstevel@tonic-gate
647c478bdstevel@tonic-gate# ifndef HASRRESVPORT
657c478bdstevel@tonic-gate#  define HASRRESVPORT	1	/* has rrsevport(3) call */
667c478bdstevel@tonic-gate# endif /* ! HASRRESVPORT */
677c478bdstevel@tonic-gate
687c478bdstevel@tonic-gate/**********************************************************************
697c478bdstevel@tonic-gate**  "Hard" compilation options.
707c478bdstevel@tonic-gate**	#define these if they are available; comment them out otherwise.
717c478bdstevel@tonic-gate**  These cannot be overridden from the Makefile, and should really not
727c478bdstevel@tonic-gate**  be turned off unless absolutely necessary.
737c478bdstevel@tonic-gate**********************************************************************/
747c478bdstevel@tonic-gate
757c478bdstevel@tonic-gate#define LOG		1	/* enable logging -- don't turn off */
767c478bdstevel@tonic-gate
777c478bdstevel@tonic-gate/**********************************************************************
787c478bdstevel@tonic-gate**  Operating system configuration.
797c478bdstevel@tonic-gate**
807c478bdstevel@tonic-gate**	Unless you are porting to a new OS, you shouldn't have to
817c478bdstevel@tonic-gate**	change these.
827c478bdstevel@tonic-gate**********************************************************************/
837c478bdstevel@tonic-gate
847c478bdstevel@tonic-gate/*
857c478bdstevel@tonic-gate**  HP-UX -- tested for 8.07, 9.00, and 9.01.
867c478bdstevel@tonic-gate**
877c478bdstevel@tonic-gate**	If V4FS is defined, compile for HP-UX 10.0.
887c478bdstevel@tonic-gate**	11.x support from Richard Allen <ra@hp.is>.
897c478bdstevel@tonic-gate*/
907c478bdstevel@tonic-gate
917c478bdstevel@tonic-gate# ifdef __hpux
927c478bdstevel@tonic-gate		/* common definitions for HP-UX 9.x and 10.x */
937c478bdstevel@tonic-gate#  undef m_flags		/* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */
947c478bdstevel@tonic-gate#  define SYSTEM5	1	/* include all the System V defines */
957c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
967c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
977c478bdstevel@tonic-gate#  define USESETEUID	1	/* has usable seteuid(2) call */
987c478bdstevel@tonic-gate#  define HASSETRESGID	1	/* use setresgid(2) to set saved gid */
997c478bdstevel@tonic-gate#  define BOGUS_O_EXCL	1	/* exclusive open follows symlinks */
1007c478bdstevel@tonic-gate#  define seteuid(e)	setresuid(-1, e, -1)
1017c478bdstevel@tonic-gate#  define IP_SRCROUTE	1	/* can check IP source routing */
1027c478bdstevel@tonic-gate#  define LA_TYPE	LA_HPUX
1037c478bdstevel@tonic-gate#  define SPT_TYPE	SPT_PSTAT
1047c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1057c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
1067c478bdstevel@tonic-gate#  define LDA_USE_LOCKF	1
1077c478bdstevel@tonic-gate#  ifndef HASGETUSERSHELL
1087c478bdstevel@tonic-gate#   define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
1097c478bdstevel@tonic-gate#  endif /* ! HASGETUSERSHELL */
1107c478bdstevel@tonic-gate#  ifdef HPUX10
1117c478bdstevel@tonic-gate#   define _PATH_SENDMAIL	"/usr/sbin/sendmail"
1127c478bdstevel@tonic-gate#   ifndef SMRSH_CMDDIR
1137c478bdstevel@tonic-gate#    define SMRSH_CMDDIR	"/var/adm/sm.bin"
1147c478bdstevel@tonic-gate#   endif /* ! SMRSH_CMDDIR */
1157c478bdstevel@tonic-gate#  endif /* HPUX10 */
1167c478bdstevel@tonic-gate#  ifdef HPUX11
1177c478bdstevel@tonic-gate#   define HASSETREUID	1	/* setreuid(2) works on HP-UX 11.x */
1187c478bdstevel@tonic-gate#   define HASFCHOWN	1	/* has fchown(2) */
1197c478bdstevel@tonic-gate#   ifndef BROKEN_RES_SEARCH
1207c478bdstevel@tonic-gate#    define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
1217c478bdstevel@tonic-gate#   endif /* ! BROKEN_RES_SEARCH */
1227c478bdstevel@tonic-gate#   ifndef SMRSH_CMDDIR
1237c478bdstevel@tonic-gate#    define SMRSH_CMDDIR	"/var/adm/sm.bin"
1247c478bdstevel@tonic-gate#   endif /* ! SMRSH_CMDDIR */
1257c478bdstevel@tonic-gate#   define _PATH_SENDMAIL	"/usr/sbin/sendmail"
1267c478bdstevel@tonic-gate#  else /* HPUX11 */
1277c478bdstevel@tonic-gate#   ifndef NOT_SENDMAIL
1287c478bdstevel@tonic-gate#    define syslog	hard_syslog
1297c478bdstevel@tonic-gate#   endif /* ! NOT_SENDMAIL */
1307c478bdstevel@tonic-gate#  endif /* HPUX11 */
1317c478bdstevel@tonic-gate#  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
1327c478bdstevel@tonic-gate
1337c478bdstevel@tonic-gate#  ifdef V4FS
1347c478bdstevel@tonic-gate		/* HP-UX 10.x */
1357c478bdstevel@tonic-gate#   define _PATH_UNIX		"/stand/vmunix"
1367c478bdstevel@tonic-gate#   ifndef _PATH_VENDOR_CF
1377c478bdstevel@tonic-gate#    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
1387c478bdstevel@tonic-gate#   endif /* ! _PATH_VENDOR_CF */
1397c478bdstevel@tonic-gate#   ifndef _PATH_SENDMAILPID
1407c478bdstevel@tonic-gate#    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
1417c478bdstevel@tonic-gate#   endif /* ! _PATH_SENDMAILPID */
1427c478bdstevel@tonic-gate#   ifndef IDENTPROTO
1437c478bdstevel@tonic-gate#    define IDENTPROTO	1	/* TCP/IP implementation fixed in 10.0 */
1447c478bdstevel@tonic-gate#   endif /* ! IDENTPROTO */
1457c478bdstevel@tonic-gate#   include <sys/mpctl.h>	/* for mpctl() in get_num_procs_online() */
1467c478bdstevel@tonic-gate#  else /* V4FS */
1477c478bdstevel@tonic-gate		/* HP-UX 9.x */
1487c478bdstevel@tonic-gate#   define _PATH_UNIX		"/hp-ux"
1497c478bdstevel@tonic-gate#   ifndef _PATH_VENDOR_CF
1507c478bdstevel@tonic-gate#    define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1517c478bdstevel@tonic-gate#   endif /* ! _PATH_VENDOR_CF */
1527c478bdstevel@tonic-gate#   ifndef IDENTPROTO
1537c478bdstevel@tonic-gate#    define IDENTPROTO	0	/* TCP/IP implementation is broken */
1547c478bdstevel@tonic-gate#   endif /* ! IDENTPROTO */
1557c478bdstevel@tonic-gate#   ifdef __STDC__
1567c478bdstevel@tonic-gateextern void	hard_syslog(int, char *, ...);
1577c478bdstevel@tonic-gate#   else /* __STDC__ */
1587c478bdstevel@tonic-gateextern void	hard_syslog();
1597c478bdstevel@tonic-gate#   endif /* __STDC__ */
1607c478bdstevel@tonic-gate#   define FDSET_CAST	(int *)	/* cast for fd_set parameters to select */
1617c478bdstevel@tonic-gate#  endif /* V4FS */
1627c478bdstevel@tonic-gate
1637c478bdstevel@tonic-gate# endif /* __hpux */
1647c478bdstevel@tonic-gate
1657c478bdstevel@tonic-gate/*
1667c478bdstevel@tonic-gate**  IBM AIX 5.x
1677c478bdstevel@tonic-gate*/
1687c478bdstevel@tonic-gate
1697c478bdstevel@tonic-gate# ifdef _AIX5
1704aac33djbeck#  include <sys/signal.h>
1714aac33djbeck#  include <sys/wait.h>
1727c478bdstevel@tonic-gate#  define _AIX4		40300
1737c478bdstevel@tonic-gate#  define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */
1747c478bdstevel@tonic-gate#  define SOCKOPT_LEN_T	socklen_t /* arg#5 to getsockopt */
1757c478bdstevel@tonic-gate#  if _AIX5 >= 50200
1767c478bdstevel@tonic-gate#   define HASUNSETENV	1	/* has unsetenv(3) call */
1777c478bdstevel@tonic-gate#  endif /* _AIX5 >= 50200 */
1787c478bdstevel@tonic-gate# endif /* _AIX5 */
1797c478bdstevel@tonic-gate
1807c478bdstevel@tonic-gate/*
1817c478bdstevel@tonic-gate**  IBM AIX 4.x
1827c478bdstevel@tonic-gate*/
1837c478bdstevel@tonic-gate
1847c478bdstevel@tonic-gate# ifdef _AIX4
1857c478bdstevel@tonic-gate#  define _AIX3		1	/* pull in AIX3 stuff */
1867c478bdstevel@tonic-gate#  define BSD4_4_SOCKADDR	/* has sa_len */
1877c478bdstevel@tonic-gate#  define USESETEUID	1	/* seteuid(2) works */
1887c478bdstevel@tonic-gate#  define TZ_TYPE	TZ_NAME	/* use tzname[] vector */
1897c478bdstevel@tonic-gate#  ifndef SOCKOPT_LEN_T
1907c478bdstevel@tonic-gate#   define SOCKOPT_LEN_T	size_t	/* arg#5 to getsockopt */
1917c478bdstevel@tonic-gate#  endif /* SOCKOPT_LEN_T */
1927c478bdstevel@tonic-gate#  if _AIX4 >= 40200
1937c478bdstevel@tonic-gate#   define HASSETREUID	1	/* setreuid(2) works as of AIX 4.2 */
1947c478bdstevel@tonic-gate#   ifndef SOCKADDR_LEN_T
1957c478bdstevel@tonic-gate#    define SOCKADDR_LEN_T	size_t	/* e.g., arg#3 to accept, getsockname */
1967c478bdstevel@tonic-gate#   endif /* SOCKADDR_LEN_T */
1977c478bdstevel@tonic-gate#  endif /* _AIX4 >= 40200 */
1987c478bdstevel@tonic-gate#  if defined(_ILS_MACROS)	/* IBM versions aren't side-effect clean */
1997c478bdstevel@tonic-gate#   undef isascii
2007c478bdstevel@tonic-gate#   define isascii(c)		!(c & ~0177)
2017c478bdstevel@tonic-gate#   undef isdigit
2027c478bdstevel@tonic-gate#   define isdigit(__a)		(_IS(__a,_ISDIGIT))
2037c478bdstevel@tonic-gate#   undef isspace
2047c478bdstevel@tonic-gate#   define isspace(__a)		(_IS(__a,_ISSPACE))
2057c478bdstevel@tonic-gate#  endif /* defined(_ILS_MACROS) */
2067c478bdstevel@tonic-gate# endif /* _AIX4 */
2077c478bdstevel@tonic-gate
2087c478bdstevel@tonic-gate
2097c478bdstevel@tonic-gate/*
2107c478bdstevel@tonic-gate**  IBM AIX 3.x -- actually tested for 3.2.3
2117c478bdstevel@tonic-gate*/
2127c478bdstevel@tonic-gate
2137c478bdstevel@tonic-gate# ifdef _AIX3
2147c478bdstevel@tonic-gate#  include <paths.h>
2157c478bdstevel@tonic-gate#  include <sys/machine.h>	/* to get byte order */
2167c478bdstevel@tonic-gate#  include <sys/select.h>
2177c478bdstevel@tonic-gate#  define HASFCHOWN	1	/* has fchown(2) */
2187c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
2197c478bdstevel@tonic-gate#  define HASUNAME	1	/* use System V uname(2) system call */
2207c478bdstevel@tonic-gate#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
2217c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
2227c478bdstevel@tonic-gate#  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
2237c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
2247c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
2257c478bdstevel@tonic-gate#  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
2267c478bdstevel@tonic-gate#  ifndef LA_TYPE
2277c478bdstevel@tonic-gate#   define LA_TYPE	LA_INT
2287c478bdstevel@tonic-gate#  endif /* LA_TYPE */
2297c478bdstevel@tonic-gate#  define FSHIFT	16
2307c478bdstevel@tonic-gate#  define LA_AVENRUN	"avenrun"
2317c478bdstevel@tonic-gate#  if !defined(_AIX4) || _AIX4 < 40300
2327c478bdstevel@tonic-gate#   ifndef __BIT_TYPES_DEFINED__
2337c478bdstevel@tonic-gate#    define SM_INT32	int
2347c478bdstevel@tonic-gate#   endif /* __BIT_TYPES_DEFINED__ */
2357c478bdstevel@tonic-gate#  endif /* !defined(_AIX4) || _AIX4 < 40300 */
2367c478bdstevel@tonic-gate#  if !defined(_AIX4) || _AIX4 < 40200
2377c478bdstevel@tonic-gate#   define SM_CONF_SYSLOG	0
2387c478bdstevel@tonic-gate#  endif /* !defined(_AIX4) || _AIX4 < 40200 */
2397c478bdstevel@tonic-gate# endif /* _AIX3 */
2407c478bdstevel@tonic-gate
2417c478bdstevel@tonic-gate
2427c478bdstevel@tonic-gate/*
2437c478bdstevel@tonic-gate**  IBM AIX 2.2.1 -- actually tested for osupdate level 2706+1773
2447c478bdstevel@tonic-gate**
2457c478bdstevel@tonic-gate**	From Mark Whetzel <markw@wg.waii.com>.
2467c478bdstevel@tonic-gate*/
2477c478bdstevel@tonic-gate
2487c478bdstevel@tonic-gate# ifdef AIX			/* AIX/RT compiler pre-defines this */
2497c478bdstevel@tonic-gate#  include <paths.h>
2507c478bdstevel@tonic-gate#  include <sys/time.h>		/* AIX/RT resource.h does NOT include this */
2517c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
2527c478bdstevel@tonic-gate#  define HASUNAME	1	/* use System V uname(2) system call */
2537c478bdstevel@tonic-gate#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
2547c478bdstevel@tonic-gate#  define HASFCHMOD	0	/* does not have fchmod(2) syscall */
2557c478bdstevel@tonic-gate#  define HASSETREUID	1	/* use setreuid(2) -lbsd system call */
2567c478bdstevel@tonic-gate#  define HASSETVBUF	1	/* use setvbuf(2) system call */
2577c478bdstevel@tonic-gate#  define HASSETRLIMIT	0	/* does not have setrlimit call */
2587c478bdstevel@tonic-gate#  define HASFLOCK	0	/* does not have flock call - use fcntl */
2597c478bdstevel@tonic-gate#  define HASULIMIT	1	/* use ulimit instead of setrlimit call */
2607c478bdstevel@tonic-gate#  define SM_CONF_GETOPT	0	/* Do we need theirs or ours */
2617c478bdstevel@tonic-gate#  define SYS5SETPGRP	1	/* don't have setpgid on AIX/RT */
2627c478bdstevel@tonic-gate#  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
2637c478bdstevel@tonic-gate#  define BSD4_3		1	/* NOT bsd 4.4 or posix signals */
2647c478bdstevel@tonic-gate#  define GIDSET_T	int
2657c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
2667c478bdstevel@tonic-gate#  define SPT_PADCHAR	'\0'		/* pad process title with nulls */
2677c478bdstevel@tonic-gate#  define LA_TYPE	LA_SUBR		/* use our ported loadavgd daemon */
2687c478bdstevel@tonic-gate#  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
2697c478bdstevel@tonic-gate#  define ARBPTR_T	int *
2707c478bdstevel@tonic-gate#  define void		int
2717c478bdstevel@tonic-gatetypedef int		pid_t;
2727c478bdstevel@tonic-gate/* RTisms for BSD compatibility, specified in the Makefile
2737c478bdstevel@tonic-gate  define BSD		1
2747c478bdstevel@tonic-gate  define BSD_INCLUDES		1
2757c478bdstevel@tonic-gate  define BSD_REMAP_SIGNAL_TO_SIGVEC
2767c478bdstevel@tonic-gate    RTisms needed above */
2777c478bdstevel@tonic-gate/* make this sendmail in a completely different place */
2787c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
2797c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/local/newmail/sendmail.cf"
2807c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
2817c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
2827c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/usr/local/newmail/sendmail.pid"
2837c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
2847c478bdstevel@tonic-gate# endif /* AIX */
2857c478bdstevel@tonic-gate
2867c478bdstevel@tonic-gate# if defined(_AIX)
2877c478bdstevel@tonic-gate#  define LDA_USE_LOCKF		1
2887c478bdstevel@tonic-gate#  define LDA_USE_SETEUID	1
2897c478bdstevel@tonic-gate# endif /* defined(_AIX) */
2907c478bdstevel@tonic-gate
2917c478bdstevel@tonic-gate/*
2927c478bdstevel@tonic-gate**  Silicon Graphics IRIX
2937c478bdstevel@tonic-gate**
2947c478bdstevel@tonic-gate**	Compiles on 4.0.1.
2957c478bdstevel@tonic-gate**
2967c478bdstevel@tonic-gate**	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
2977c478bdstevel@tonic-gate**	Use IRIX5 instead of IRIX for IRIX 5.x.
2987c478bdstevel@tonic-gate**
2997c478bdstevel@tonic-gate**	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
3007c478bdstevel@tonic-gate**	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
3017c478bdstevel@tonic-gate*/
3027c478bdstevel@tonic-gate
3037c478bdstevel@tonic-gate# ifdef IRIX
3047c478bdstevel@tonic-gate#  define SYSTEM5	1	/* this is a System-V derived system */
3057c478bdstevel@tonic-gate#  define HASSETREUID	1	/* has setreuid(2) call */
3067c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
3077c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
3087c478bdstevel@tonic-gate#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
3097c478bdstevel@tonic-gate#  define IP_SRCROUTE	1	/* can check IP source routing */
3107c478bdstevel@tonic-gate#  define setpgid	BSDsetpgrp
3117c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
3127c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
3137c478bdstevel@tonic-gate#  define SFS_BAVAIL	f_bfree		/* alternate field name */
3147c478bdstevel@tonic-gate#  define SYSLOG_BUFSIZE 512
3157c478bdstevel@tonic-gate#  if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
3167c478bdstevel@tonic-gate    /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */
3177c478bdstevel@tonic-gate#   define _SC_NPROCESSORS_ONLN	_SC_NPROC_ONLN
3187c478bdstevel@tonic-gate#  endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */
3197c478bdstevel@tonic-gate#  ifdef IRIX6
3207c478bdstevel@tonic-gate#   define STAT64	1
3217c478bdstevel@tonic-gate#   define QUAD_T	unsigned long long
3227c478bdstevel@tonic-gate#   define LA_TYPE	LA_IRIX6	/* figure out at run time */
3237c478bdstevel@tonic-gate#   define SAFENFSPATHCONF 0	/* pathconf(2) lies on NFS filesystems */
3247c478bdstevel@tonic-gate#  else /* IRIX6 */
3257c478bdstevel@tonic-gate#   define LA_TYPE	LA_INT
3267c478bdstevel@tonic-gate
3277c478bdstevel@tonic-gate#   ifdef IRIX64
3287c478bdstevel@tonic-gate#    define STAT64	1
3297c478bdstevel@tonic-gate#    define QUAD_T	unsigned long long
3307c478bdstevel@tonic-gate#    define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
3317c478bdstevel@tonic-gate#   else /* IRIX64 */
3327c478bdstevel@tonic-gate#    define STAT64	0
3337c478bdstevel@tonic-gate#    define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
3347c478bdstevel@tonic-gate#   endif /* IRIX64 */
3357c478bdstevel@tonic-gate#  endif /* IRIX6 */
3367c478bdstevel@tonic-gate#  if defined(IRIX64) || defined(IRIX5) || defined(IRIX6)
3377c478bdstevel@tonic-gate#   include <sys/cdefs.h>
3387c478bdstevel@tonic-gate#   include <paths.h>
3397c478bdstevel@tonic-gate#   define ARGV_T	char *const *
3407c478bdstevel@tonic-gate#   define HASFCHOWN	1	/* has fchown(2) */
3417c478bdstevel@tonic-gate#   define HASSETRLIMIT	1	/* has setrlimit(2) syscall */
3427c478bdstevel@tonic-gate#   define HASGETDTABLESIZE 1	/* has getdtablesize(2) syscall */
3437c478bdstevel@tonic-gate#   define HASSTRERROR	1	/* has strerror(3) */
3447c478bdstevel@tonic-gate#  else /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
3457c478bdstevel@tonic-gate#   define ARGV_T	const char **
3467c478bdstevel@tonic-gate#   define WAITUNION	1	/* use "union wait" as wait argument type */
3477c478bdstevel@tonic-gate#  endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
3487c478bdstevel@tonic-gate# endif /* IRIX */
3497c478bdstevel@tonic-gate
3507c478bdstevel@tonic-gate
3517c478bdstevel@tonic-gate/*
3527c478bdstevel@tonic-gate**  SunOS and Solaris
3537c478bdstevel@tonic-gate**
3547c478bdstevel@tonic-gate**	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
3557c478bdstevel@tonic-gate**	Solaris 2.4 (a.k.a. SunOS 5.4).
3567c478bdstevel@tonic-gate*/
3577c478bdstevel@tonic-gate
3587c478bdstevel@tonic-gate# if defined(sun) && !defined(BSD)
3597c478bdstevel@tonic-gate
3607c478bdstevel@tonic-gate#  include <sys/time.h>
3617c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
3627c478bdstevel@tonic-gate#  define HASUNAME	1	/* use System V uname(2) system call */
3637c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
3647c478bdstevel@tonic-gate#  define IP_SRCROUTE	1	/* can check IP source routing */
3657c478bdstevel@tonic-gate#  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
3667c478bdstevel@tonic-gate#  ifndef HASFCHOWN
3677c478bdstevel@tonic-gate#   define HASFCHOWN	1	/* fchown(2) */
3687c478bdstevel@tonic-gate#  endif /* ! HASFCHOWN */
3697c478bdstevel@tonic-gate
3707c478bdstevel@tonic-gate#  ifdef __svr4__
3717c478bdstevel@tonic-gate#   define LDA_USE_LOCKF		1
3727c478bdstevel@tonic-gate#   define LDA_USE_SETEUID	1
3737c478bdstevel@tonic-gate#   define _PATH_MAILDIR		"/var/mail"
3747c478bdstevel@tonic-gate#  endif /* __svr4__ */
3757c478bdstevel@tonic-gate
3767c478bdstevel@tonic-gate#  ifdef SOLARIS_2_3
3777c478bdstevel@tonic-gate#   define SOLARIS	20300	/* for back compat only -- use -DSOLARIS=20300 */
3787c478bdstevel@tonic-gate#  endif /* SOLARIS_2_3 */
3797c478bdstevel@tonic-gate
3807c478bdstevel@tonic-gate#  if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4))
3817c478bdstevel@tonic-gate#   define SOLARIS	1	/* unknown Solaris version */
3827c478bdstevel@tonic-gate#  endif /* defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) */
3837c478bdstevel@tonic-gate
3847c478bdstevel@tonic-gate#  ifdef SOLARIS
3857c478bdstevel@tonic-gate			/* Solaris 2.x (a.k.a. SunOS 5.x) */
3867c478bdstevel@tonic-gate#   ifndef __svr4__
3877c478bdstevel@tonic-gate#    define __svr4__		/* use all System V Release 4 defines below */
3887c478bdstevel@tonic-gate#   endif /* ! __svr4__ */
3897c478bdstevel@tonic-gate#   define GIDSET_T	gid_t
3907c478bdstevel@tonic-gate#   define USE_SA_SIGACTION	1	/* use sa_sigaction field */
3917c478bdstevel@tonic-gate#   define BROKEN_PTHREAD_SLEEP	1	/* sleep after pthread_create() fails */
3927c478bdstevel@tonic-gate#   define HASSTRERROR	1	/* has strerror(3) */
3937c478bdstevel@tonic-gate#   ifndef _PATH_UNIX
3947c478bdstevel@tonic-gate#    define _PATH_UNIX		"/dev/ksyms"
3957c478bdstevel@tonic-gate#   endif /* ! _PATH_UNIX */
3967c478bdstevel@tonic-gate#   ifndef _PATH_VENDOR_CF
3977c478bdstevel@tonic-gate#    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
3987c478bdstevel@tonic-gate#   endif /* ! _PATH_VENDOR_CF */
3997c478bdstevel@tonic-gate#   ifndef _PATH_SENDMAILPID
4007c478bdstevel@tonic-gate#    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
4017c478bdstevel@tonic-gate#   endif /* ! _PATH_SENDMAILPID */
4027c478bdstevel@tonic-gate#   ifndef _PATH_HOSTS
4037c478bdstevel@tonic-gate#    define _PATH_HOSTS		"/etc/inet/hosts"
4047c478bdstevel@tonic-gate#   endif /* ! _PATH_HOSTS */
4057c478bdstevel@tonic-gate#   ifndef SYSLOG_BUFSIZE
4067c478bdstevel@tonic-gate#    define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
4077c478bdstevel@tonic-gate#   endif /* ! SYSLOG_BUFSIZE */
4087c478bdstevel@tonic-gate#   ifndef TZ_TYPE
4097c478bdstevel@tonic-gate#    define TZ_TYPE	TZ_TZNAME
4107c478bdstevel@tonic-gate#   endif /* ! TZ_TYPE */
4117c478bdstevel@tonic-gate#   if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203)
4127c478bdstevel@tonic-gate#    define USESETEUID		1	/* seteuid works as of 2.3 */
4137c478bdstevel@tonic-gate#    define LDA_CONTENTLENGTH	1	/* Needs the Content-Length header */
4147c478bdstevel@tonic-gate#   endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */
4157c478bdstevel@tonic-gate#   if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205)
4167c478bdstevel@tonic-gate#    define HASSETREUID	1		/* setreuid works as of 2.5 */
4177c478bdstevel@tonic-gate#    define HASSETREGID	1	/* use setregid(2) to set saved gid */
41849218d4jbeck#   if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206)
41949218d4jbeck#    define HASSNPRINTF 1	/* has snprintf(3c) starting in 2.6 */
42049218d4jbeck#   endif /* SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) */
4217c478bdstevel@tonic-gate#    if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700)
4227c478bdstevel@tonic-gate#     ifndef LA_TYPE
4237c478bdstevel@tonic-gate#      define LA_TYPE	LA_KSTAT	/* use kstat(3k) -- may work in < 2.5 */
4247c478bdstevel@tonic-gate#     endif /* ! LA_TYPE */
4257c478bdstevel@tonic-gate#     ifndef RANDOMSHIFT		/* random() doesn't work well (sometimes) */
4267c478bdstevel@tonic-gate#      define RANDOMSHIFT	8
4277c478bdstevel@tonic-gate#     endif /* ! RANDOMSHIFT */
4287c478bdstevel@tonic-gate#    endif /* SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) */
4297c478bdstevel@tonic-gate#   else /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */
4307c478bdstevel@tonic-gate#    ifndef HASRANDOM
4317c478bdstevel@tonic-gate#     define HASRANDOM	0		/* doesn't have random(3) */
4327c478bdstevel@tonic-gate#    endif /* ! HASRANDOM */
4337c478bdstevel@tonic-gate#   endif /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */
4347c478bdstevel@tonic-gate#   if (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206
4357c478bdstevel@tonic-gate#    define SM_INT32	int	/* 32bit integer */
4367c478bdstevel@tonic-gate#   endif /* (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206 */
4377c478bdstevel@tonic-gate#   if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207)
4387c478bdstevel@tonic-gate#    ifndef LA_TYPE
4397c478bdstevel@tonic-gate#     include <sys/loadavg.h>
4407c478bdstevel@tonic-gate#     if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
4417c478bdstevel@tonic-gate#      include <sys/pset.h>
4427c478bdstevel@tonic-gate#      define LA_TYPE	LA_PSET	/* pset_getloadavg(3c) appears in 2.9 */
4437c478bdstevel@tonic-gate#     else /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
4447c478bdstevel@tonic-gate#      define LA_TYPE	LA_SUBR	/* getloadavg(3c) appears in 2.7 */
4457c478bdstevel@tonic-gate#     endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
4467c478bdstevel@tonic-gate#    endif /* ! LA_TYPE */
4477c478bdstevel@tonic-gate#    define HASGETUSERSHELL 1	/* getusershell(3c) bug fixed in 2.7 */
4487c478bdstevel@tonic-gate#   endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */
4497c478bdstevel@tonic-gate#   if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208)
4507c478bdstevel@tonic-gate#    undef _PATH_SENDMAILPID	/* tmpfs /var/run added in 2.8 */
4517c478bdstevel@tonic-gate#    define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
4527c478bdstevel@tonic-gate#    ifndef SMRSH_CMDDIR
4537c478bdstevel@tonic-gate#     define SMRSH_CMDDIR	"/var/adm/sm.bin"
4547c478bdstevel@tonic-gate#    endif /* ! SMRSH_CMDDIR */
4557c478bdstevel@tonic-gate#    define SL_FUDGE	34	/* fudge offset for SyslogPrefixLen */
4567c478bdstevel@tonic-gate#    define HASLDAPGETALIASBYNAME	1	/* added in S8 */
4577c478bdstevel@tonic-gate#   endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */
4587c478bdstevel@tonic-gate#   if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
4597c478bdstevel@tonic-gate#    define HASURANDOMDEV	1	/* /dev/[u]random added in S9 */
4607c478bdstevel@tonic-gate#    define HASCLOSEFROM	1	/* closefrom(3c) added in S9 */
4617c478bdstevel@tonic-gate#    define HASFDWALK		1	/* fdwalk(3c) added in S9 */
4627c478bdstevel@tonic-gate#   endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
4637c478bdstevel@tonic-gate#   if SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210)
4647c478bdstevel@tonic-gate#    define HASUNSETENV 1       /* unsetenv() added in S10 */
4657c478bdstevel@tonic-gate#   endif /* SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) */
4667800901jbeck#   if SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211)
4677800901jbeck#    define GETLDAPALIASBYNAME_VERSION 2	/* changed in S11 */
46839c1a28John Beck#    define HAVE_NANOSLEEP	1	/* moved from librt to libc in S11 */
4697800901jbeck#   endif /* SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) */
4707c478bdstevel@tonic-gate#   ifndef HASGETUSERSHELL
4717c478bdstevel@tonic-gate#    define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps pre-2.7 */
4727c478bdstevel@tonic-gate#   endif /* ! HASGETUSERSHELL */
4737c478bdstevel@tonic-gate
4747c478bdstevel@tonic-gate#  else /* SOLARIS */
4757c478bdstevel@tonic-gate			/* SunOS 4.0.3 or 4.1.x */
4767c478bdstevel@tonic-gate#   define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
4777c478bdstevel@tonic-gate#   define HASSETREUID	1	/* has setreuid(2) call */
4787c478bdstevel@tonic-gate#   ifndef HASFLOCK
4797c478bdstevel@tonic-gate#    define HASFLOCK	1	/* has flock(2) call */
4807c478bdstevel@tonic-gate#   endif /* ! HASFLOCK */
4817c478bdstevel@tonic-gate#   define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
4827c478bdstevel@tonic-gate#   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
4837c478bdstevel@tonic-gate#   include <memory.h>
4847c478bdstevel@tonic-gate#   include <vfork.h>
4857c478bdstevel@tonic-gate#   ifdef __GNUC__
4867c478bdstevel@tonic-gate#    define strtoul	strtol	/* gcc library bogosity */
4877c478bdstevel@tonic-gate#   endif /* __GNUC__ */
4887c478bdstevel@tonic-gate#   define memmove(d, s, l)	(bcopy((s), (d), (l)))
4897c478bdstevel@tonic-gate#   define atexit(f)	on_exit((f), 0)	/* ugly hack for SunOS */
4907c478bdstevel@tonic-gate#   define SM_INT32	int	/* 32bit integer */
4917c478bdstevel@tonic-gate#   define SM_ALIGN_SIZE (sizeof(long))
4927c478bdstevel@tonic-gate#   define GIDSET_T	int
4937c478bdstevel@tonic-gate#   define SM_CONF_SYSLOG	0
4947c478bdstevel@tonic-gate
4957c478bdstevel@tonic-gate#   ifdef SUNOS403
4967c478bdstevel@tonic-gate			/* special tweaking for SunOS 4.0.3 */
4977c478bdstevel@tonic-gate#    include <malloc.h>
4987c478bdstevel@tonic-gate#    define BSD4_3	1	/* 4.3 BSD-based */
4997c478bdstevel@tonic-gate#    define NEEDSTRSTR	1	/* need emulation of strstr(3) routine */
5007c478bdstevel@tonic-gate#    define WAITUNION	1	/* use "union wait" as wait argument type */
5017c478bdstevel@tonic-gate#    undef WIFEXITED
5027c478bdstevel@tonic-gate#    undef WEXITSTATUS
5037c478bdstevel@tonic-gate#    undef HASUNAME
5047c478bdstevel@tonic-gate#    define setpgid	setpgrp
5057c478bdstevel@tonic-gate#    define MODE_T	int
5067c478bdstevel@tonic-gatetypedef int		pid_t;
5077c478bdstevel@tonic-gateextern char		*getenv();
5087c478bdstevel@tonic-gate
5097c478bdstevel@tonic-gate#   else /* SUNOS403 */
5107c478bdstevel@tonic-gate			/* 4.1.x specifics */
5117c478bdstevel@tonic-gate#    define HASSETSID	1	/* has POSIX setsid(2) call */
5127c478bdstevel@tonic-gate#    define HASSETVBUF	1	/* we have setvbuf(3) in libc */
5137c478bdstevel@tonic-gate
5147c478bdstevel@tonic-gate#   endif /* SUNOS403 */
5157c478bdstevel@tonic-gate#  endif /* SOLARIS */
5167c478bdstevel@tonic-gate
5177c478bdstevel@tonic-gate#  ifndef LA_TYPE
5187c478bdstevel@tonic-gate#   define LA_TYPE	LA_INT
5197c478bdstevel@tonic-gate#  endif /* ! LA_TYPE */
5207c478bdstevel@tonic-gate
5217c478bdstevel@tonic-gate# endif /* defined(sun) && !defined(BSD) */
5227c478bdstevel@tonic-gate
5237c478bdstevel@tonic-gate/*
5247c478bdstevel@tonic-gate**  DG/UX
5257c478bdstevel@tonic-gate**
5267c478bdstevel@tonic-gate**	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
5277c478bdstevel@tonic-gate**	older support.
5287c478bdstevel@tonic-gate**	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
5297c478bdstevel@tonic-gate*/
5307c478bdstevel@tonic-gate
5317c478bdstevel@tonic-gate# ifdef DGUX_5_4_2
5327c478bdstevel@tonic-gate#  define DGUX		1
5337c478bdstevel@tonic-gate# endif /* DGUX_5_4_2 */
5347c478bdstevel@tonic-gate
5357c478bdstevel@tonic-gate# ifdef DGUX
5367c478bdstevel@tonic-gate#  define SYSTEM5	1
5377c478bdstevel@tonic-gate#  define LA_TYPE	LA_DGUX
5387c478bdstevel@tonic-gate#  define HASSETREUID	1	/* has setreuid(2) call */
5397c478bdstevel@tonic-gate#  define HASUNAME	1	/* use System V uname(2) system call */
5407c478bdstevel@tonic-gate#  define HASSETSID	1	/* has POSIX setsid(2) call */
5417c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
5427c478bdstevel@tonic-gate#  define IP_SRCROUTE	0	/* does not have <netinet/ip_var.h> */
5437c478bdstevel@tonic-gate#  define HASGETUSERSHELL 0	/* does not have getusershell(3) */
5447c478bdstevel@tonic-gate#  ifndef IDENTPROTO
5457c478bdstevel@tonic-gate#   define IDENTPROTO	0	/* TCP/IP implementation is broken */
5467c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
5477c478bdstevel@tonic-gate#  define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
5487c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
5497c478bdstevel@tonic-gate#  define LDA_USE_LOCKF		1
5507c478bdstevel@tonic-gate
5517c478bdstevel@tonic-gate/* these include files must be included early on DG/UX */
5527c478bdstevel@tonic-gate#  include <netinet/in.h>
5537c478bdstevel@tonic-gate#  include <arpa/inet.h>
5547c478bdstevel@tonic-gate
5557c478bdstevel@tonic-gate/* compiler doesn't understand const? */
5567c478bdstevel@tonic-gate#  define const
5577c478bdstevel@tonic-gate
5587c478bdstevel@tonic-gate#  ifdef DGUX_5_4_2
5597c478bdstevel@tonic-gate#   define inet_addr	dgux_inet_addr
5607c478bdstevel@tonic-gateextern long	dgux_inet_addr();
5617c478bdstevel@tonic-gate#  endif /* DGUX_5_4_2 */
5627c478bdstevel@tonic-gate# endif /* DGUX */
5637c478bdstevel@tonic-gate
5647c478bdstevel@tonic-gate
5657c478bdstevel@tonic-gate/*
5667c478bdstevel@tonic-gate**  Digital Ultrix 4.2 - 4.5
5677c478bdstevel@tonic-gate**
5687c478bdstevel@tonic-gate**	Apparently, fcntl locking is broken on 4.2A, in that locks are
5697c478bdstevel@tonic-gate**	not dropped when the process exits.  This causes major problems,
5707c478bdstevel@tonic-gate**	so flock is the only alternative.
5717c478bdstevel@tonic-gate*/
5727c478bdstevel@tonic-gate
5737c478bdstevel@tonic-gate# ifdef ultrix
5747c478bdstevel@tonic-gate#  define HASSETREUID	1	/* has setreuid(2) call */
5757c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(3) call */
5767c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
5777c478bdstevel@tonic-gate#  define HASUNAME	1	/* use System V uname(2) system call */
5787c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
5797c478bdstevel@tonic-gate#  define HASFCHOWN	1	/* has fchown(2) syscall */
5807c478bdstevel@tonic-gate#  ifndef HASFLOCK
5817c478bdstevel@tonic-gate#   define HASFLOCK	1	/* has flock(2) call */
5827c478bdstevel@tonic-gate#  endif /* ! HASFLOCK */
5837c478bdstevel@tonic-gate#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
5847c478bdstevel@tonic-gate#  ifndef BROKEN_RES_SEARCH
5857c478bdstevel@tonic-gate#   define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
5867c478bdstevel@tonic-gate#  endif /* ! BROKEN_RES_SEARCH */
5877c478bdstevel@tonic-gate#  if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621
5887c478bdstevel@tonic-gate#   define NEEDLOCAL_HOSTNAME_LENGTH	1	/* see sendmail/README */
5897c478bdstevel@tonic-gate#  endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */
5907c478bdstevel@tonic-gate#  ifdef vax
5917c478bdstevel@tonic-gate#   define LA_TYPE	LA_FLOAT
5927c478bdstevel@tonic-gate#  else /* vax */
5937c478bdstevel@tonic-gate#   define LA_TYPE	LA_INT
5947c478bdstevel@tonic-gate#   define LA_AVENRUN	"avenrun"
5957c478bdstevel@tonic-gate#  endif /* vax */
5967c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
5977c478bdstevel@tonic-gate#  ifndef IDENTPROTO
5987c478bdstevel@tonic-gate#   define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
5997c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
6007c478bdstevel@tonic-gate#  define SYSLOG_BUFSIZE	256
6017c478bdstevel@tonic-gate#  define SM_CONF_SYSLOG	0
6027c478bdstevel@tonic-gate# endif /* ultrix */
6037c478bdstevel@tonic-gate
6047c478bdstevel@tonic-gate
6057c478bdstevel@tonic-gate/*
6067c478bdstevel@tonic-gate**  OSF/1 for KSR.
6077c478bdstevel@tonic-gate**
6087c478bdstevel@tonic-gate**	Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu>
6097c478bdstevel@tonic-gate*/
6107c478bdstevel@tonic-gate
6117c478bdstevel@tonic-gate# ifdef __ksr__
6127c478bdstevel@tonic-gate#  define __osf__	1	/* get OSF/1 defines below */
6137c478bdstevel@tonic-gate#  ifndef TZ_TYPE
6147c478bdstevel@tonic-gate#   define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
6157c478bdstevel@tonic-gate#  endif /* ! TZ_TYPE */
6167c478bdstevel@tonic-gate# endif /* __ksr__ */
6177c478bdstevel@tonic-gate
6187c478bdstevel@tonic-gate
6197c478bdstevel@tonic-gate/*
6207c478bdstevel@tonic-gate**  OSF/1 for Intel Paragon.
6217c478bdstevel@tonic-gate**
6227c478bdstevel@tonic-gate**	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
6237c478bdstevel@tonic-gate**	of Intel Scalable Systems Divison.
6247c478bdstevel@tonic-gate*/
6257c478bdstevel@tonic-gate
6267c478bdstevel@tonic-gate# ifdef __PARAGON__
6277c478bdstevel@tonic-gate#  define __osf__	1	/* get OSF/1 defines below */
6287c478bdstevel@tonic-gate#  ifndef TZ_TYPE
6297c478bdstevel@tonic-gate#   define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
6307c478bdstevel@tonic-gate#  endif /* ! TZ_TYPE */
6317c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
6327c478bdstevel@tonic-gate#  define MAXNAMLEN	NAME_MAX
6337c478bdstevel@tonic-gate# endif /* __PARAGON__ */
6347c478bdstevel@tonic-gate
6357c478bdstevel@tonic-gate
6367c478bdstevel@tonic-gate/*
6377c478bdstevel@tonic-gate**  Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1
6387c478bdstevel@tonic-gate**
6397c478bdstevel@tonic-gate**	Tested for 3.2 and 4.0.
6407c478bdstevel@tonic-gate*/
6417c478bdstevel@tonic-gate
6427c478bdstevel@tonic-gate# ifdef __osf__
6437c478bdstevel@tonic-gate#  define HASUNAME	1	/* has uname(2) call */
6447c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(3) call */
6457c478bdstevel@tonic-gate#  define USESETEUID	1	/* has usable seteuid(2) call */
6467c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
6477c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
6487c478bdstevel@tonic-gate#  define HASFCHOWN	1	/* has fchown(2) syscall */
6497c478bdstevel@tonic-gate#  define HASSETLOGIN	1	/* has setlogin(2) */
6507c478bdstevel@tonic-gate#  define IP_SRCROUTE	1	/* can check IP source routing */
6517c478bdstevel@tonic-gate#  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
6527c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
6537c478bdstevel@tonic-gate#  define SM_INT32	int	/* 32bit integer */
6547c478bdstevel@tonic-gate#  ifndef HASFLOCK
6557c478bdstevel@tonic-gate#   include <standards.h>
6567c478bdstevel@tonic-gate#   if _XOPEN_SOURCE+0 >= 400
6577c478bdstevel@tonic-gate#    define HASFLOCK	0	/* 5.0 and later has bad flock(2) call */
6587c478bdstevel@tonic-gate#   else /* _XOPEN_SOURCE+0 >= 400 */
6597c478bdstevel@tonic-gate#    define HASFLOCK	1	/* has flock(2) call */
6607c478bdstevel@tonic-gate#   endif /* _XOPEN_SOURCE+0 >= 400 */
6617c478bdstevel@tonic-gate#  endif /* ! HASFLOCK */
6627c478bdstevel@tonic-gate#  define LA_TYPE	LA_ALPHAOSF
6637c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_STATVFS	/* use <sys/statvfs.h> statfs() impl */
6647c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
6657c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/var/adm/sendmail/sendmail.cf"
6667c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
6677c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
6687c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
6697c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
6707c478bdstevel@tonic-gate#  if _FFR_DIGUNIX_SAFECHOWN
6717c478bdstevel@tonic-gate/*
6727c478bdstevel@tonic-gate**  Testing on a Digital UNIX 4.0a system showed this to be the correct
6737c478bdstevel@tonic-gate**  setting but given the security consequences, more testing and
6747c478bdstevel@tonic-gate**  verification is needed.  Unfortunately, the man page offers no
6757c478bdstevel@tonic-gate**  assistance.
6767c478bdstevel@tonic-gate*/
6777c478bdstevel@tonic-gate#   define IS_SAFE_CHOWN >= 0
6787c478bdstevel@tonic-gate#  endif /* _FFR_DIGUNIX_SAFECHOWN */
6797c478bdstevel@tonic-gate# endif /* __osf__ */
6807c478bdstevel@tonic-gate
6817c478bdstevel@tonic-gate
6827c478bdstevel@tonic-gate/*
6837c478bdstevel@tonic-gate**  NeXTstep
6847c478bdstevel@tonic-gate*/
6857c478bdstevel@tonic-gate
6867c478bdstevel@tonic-gate# ifdef NeXT
6877c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
6887c478bdstevel@tonic-gate#  define NEEDPUTENV	2	/* need putenv(3) call; no setenv(3) call */
6897c478bdstevel@tonic-gate#  ifndef HASFLOCK
6907c478bdstevel@tonic-gate#   define HASFLOCK	1	/* has flock(2) call */
6917c478bdstevel@tonic-gate#  endif /* ! HASFLOCK */
6927c478bdstevel@tonic-gate#  define UID_T		int	/* compiler gripes on uid_t */
6937c478bdstevel@tonic-gate#  define GID_T		int	/* ditto for gid_t */
6947c478bdstevel@tonic-gate#  define MODE_T	int	/* and mode_t */
6957c478bdstevel@tonic-gate#  define setpgid	setpgrp
6967c478bdstevel@tonic-gate#  ifndef NOT_SENDMAIL
6977c478bdstevel@tonic-gate#   define sleep		sleepX
6987c478bdstevel@tonic-gate#  endif /* ! NOT_SENDMAIL */
6997c478bdstevel@tonic-gate#  ifndef LA_TYPE
7007c478bdstevel@tonic-gate#   define LA_TYPE	LA_MACH
7017c478bdstevel@tonic-gate#  endif /* ! LA_TYPE */
7027c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
7037c478bdstevel@tonic-gate#  ifdef _POSIX_SOURCE
7047c478bdstevel@tonic-gateextern struct passwd	*getpwent();
7057c478bdstevel@tonic-gate#  else /* _POSIX_SOURCE */
7067c478bdstevel@tonic-gate#   define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
7077c478bdstevel@tonic-gate#   define WAITUNION	1	/* use "union wait" as wait argument type */
7087c478bdstevel@tonic-gatetypedef int		pid_t;
7097c478bdstevel@tonic-gate#   undef WEXITSTATUS
7107c478bdstevel@tonic-gate#   undef WIFEXITED
7117c478bdstevel@tonic-gate#   undef WIFSTOPPED
7127c478bdstevel@tonic-gate#   undef WTERMSIG
7137c478bdstevel@tonic-gate#  endif /* _POSIX_SOURCE */
7147c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
7157c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/etc/sendmail/sendmail.cf"
7167c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
7177c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
7187c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
7197c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
7207c478bdstevel@tonic-gate#  define SM_INT32	int	/* 32bit integer */
7217c478bdstevel@tonic-gate
7227c478bdstevel@tonic-gate#  ifdef TCPWRAPPERS
7237c478bdstevel@tonic-gate#   ifndef HASUNSETENV
7247c478bdstevel@tonic-gate#    define HASUNSETENV	1
7257c478bdstevel@tonic-gate#   endif /* ! HASUNSETENV */
7267c478bdstevel@tonic-gate#   undef NEEDPUTENV
7277c478bdstevel@tonic-gate#  endif /* TCPWRAPPERS */
7287c478bdstevel@tonic-gate#  ifndef __APPLE__
7297c478bdstevel@tonic-gate#   include <libc.h>
7307c478bdstevel@tonic-gate#   ifndef S_IRUSR
7317c478bdstevel@tonic-gate#    define S_IRUSR	S_IREAD
7327c478bdstevel@tonic-gate#   endif /* ! S_IRUSR */
7337c478bdstevel@tonic-gate#   ifndef S_IWUSR
7347c478bdstevel@tonic-gate#    define S_IWUSR	S_IWRITE
7357c478bdstevel@tonic-gate#   endif /* ! S_IWUSR */
7367c478bdstevel@tonic-gate#   define _PATH_MAILDIR	"/usr/spool/mail"
7377c478bdstevel@tonic-gate#  endif /* ! __APPLE__ */
7387c478bdstevel@tonic-gate#  ifndef isascii
7397c478bdstevel@tonic-gate#   define isascii(c)	((unsigned)(c) <= 0177)
7407c478bdstevel@tonic-gate#  endif /* ! isascii */
7417c478bdstevel@tonic-gate# endif /* NeXT */
7427c478bdstevel@tonic-gate
7437c478bdstevel@tonic-gate/*
7447c478bdstevel@tonic-gate**  Apple Darwin
7457c478bdstevel@tonic-gate**      Contributed by Wilfredo Sanchez <wsanchez@mit.edu>
7467c478bdstevel@tonic-gate*/
7477c478bdstevel@tonic-gate
7487c478bdstevel@tonic-gate# if defined(DARWIN)
7497c478bdstevel@tonic-gate#  define HASFCHMOD		1	/* has fchmod(2) */
7507c478bdstevel@tonic-gate#  define HASFCHOWN		1	/* has fchown(2) */
7517c478bdstevel@tonic-gate#  define HASFLOCK		1	/* has flock(2) */
7527c478bdstevel@tonic-gate#  define HASUNAME		1	/* has uname(2) */
7537c478bdstevel@tonic-gate#  define HASUNSETENV		1	/* has unsetenv(3) */
75449218d4jbeck#  define HASSETSID		1	/* has POSIX setsid(2) call */
75549218d4jbeck#  define HASINITGROUPS		1	/* has initgroups(3) */
7567c478bdstevel@tonic-gate#  define HASSETVBUF		1	/* has setvbuf (3) */
7577c478bdstevel@tonic-gate#  define HASSETREUID		0	/* setreuid(2) unusable */
7587c478bdstevel@tonic-gate#  define HASSETEUID		1	/* has seteuid(2) */
7597c478bdstevel@tonic-gate#  define USESETEUID		1	/* has seteuid(2) */
7607c478bdstevel@tonic-gate#  define HASSETEGID		1	/* has setegid(2) */
7617c478bdstevel@tonic-gate#  define HASSETREGID		1	/* has setregid(2) */
7627c478bdstevel@tonic-gate#  define HASSETRESGID		0	/* no setresgid(2) */
7637c478bdstevel@tonic-gate#  define HASLSTAT		1	/* has lstat(2) */
7647c478bdstevel@tonic-gate#  define HASSETRLIMIT		1	/* has setrlimit(2) */
7657c478bdstevel@tonic-gate#  define HASWAITPID		1	/* has waitpid(2) */
7667c478bdstevel@tonic-gate#  define HASGETDTABLESIZE	1	/* has getdtablesize(2) */
7677c478bdstevel@tonic-gate#  define HAS_ST_GEN		1	/* has st_gen field in struct stat */
76849218d4jbeck#  define HASURANDOMDEV		1	/* has urandom(4) */
7697c478bdstevel@tonic-gate#  define HASSTRERROR		1	/* has strerror(3) */
7707c478bdstevel@tonic-gate#  define HASGETUSERSHELL	1	/* had getusershell(3) */
7717c478bdstevel@tonic-gate#  define GIDSET_T		gid_t	/* getgroups(2) takes gid_t */
7727c478bdstevel@tonic-gate#  define LA_TYPE		LA_SUBR	/* use getloadavg(3) */
7737c478bdstevel@tonic-gate#  define SFS_TYPE		SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
774445f247jbeck#  if DARWIN >= 70000
775445f247jbeck#   define SOCKADDR_LEN_T	socklen_t
776445f247jbeck#  endif
77749218d4jbeck#  if DARWIN >= 80000
77849218d4jbeck#   define SPT_TYPE		SPT_REUSEARGV
77949218d4jbeck#   define SPT_PADCHAR		'\0'
78049218d4jbeck#   define SOCKOPT_LEN_T	socklen_t
78149218d4jbeck#  else
78249218d4jbeck#   define SPT_TYPE		SPT_PSSTRINGS	/* use magic PS_STRINGS pointer for setproctitle */
78349218d4jbeck#  endif
7847c478bdstevel@tonic-gate#  define ERRLIST_PREDEFINED		/* don't declare sys_errlist */
7857c478bdstevel@tonic-gate#  define BSD4_4_SOCKADDR		/* struct sockaddr has sa_len */
7867c478bdstevel@tonic-gate#  define SAFENFSPATHCONF	0	/* unverified: pathconf(2) doesn't work on NFS */
7877c478bdstevel@tonic-gate#  define HAS_IN_H		1
7887c478bdstevel@tonic-gate#  define NETLINK		1	/* supports AF_LINK */
7897c478bdstevel@tonic-gate#  ifndef NOT_SENDMAIL
7907c478bdstevel@tonic-gate#   define sleep sleepX
7917c478bdstevel@tonic-gateextern unsigned int sleepX __P((unsigned int seconds));
7927c478bdstevel@tonic-gate#  endif /* ! NOT_SENDMAIL */
7937c478bdstevel@tonic-gate# endif /* defined(DARWIN) */
7947c478bdstevel@tonic-gate
7957c478bdstevel@tonic-gate
7967c478bdstevel@tonic-gate/*
7977c478bdstevel@tonic-gate**  4.4 BSD
7987c478bdstevel@tonic-gate**
7997c478bdstevel@tonic-gate**	See also BSD defines.
8007c478bdstevel@tonic-gate*/
8017c478bdstevel@tonic-gate
80249218d4jbeck# if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN)
8037c478bdstevel@tonic-gate#  include <paths.h>
8047c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(3) call */
8057c478bdstevel@tonic-gate#  define USESETEUID	1	/* has usable seteuid(2) call */
8067c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
8077c478bdstevel@tonic-gate#  define HASFCHOWN	1	/* has fchown(2) syscall */
8087c478bdstevel@tonic-gate#  define HASSTRERROR	1	/* has strerror(3) */
8097c478bdstevel@tonic-gate#  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
8107c478bdstevel@tonic-gate#  include <sys/cdefs.h>
8117c478bdstevel@tonic-gate#  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
8127c478bdstevel@tonic-gate#  define BSD4_4_SOCKADDR	/* has sa_len */
8137c478bdstevel@tonic-gate#  define NEED_PRINTF_PERCENTQ	1	/* doesn't have %lld */
8147c478bdstevel@tonic-gate#  define NETLINK	1	/* supports AF_LINK */
8157c478bdstevel@tonic-gate#  ifndef LA_TYPE
8167c478bdstevel@tonic-gate#   define LA_TYPE	LA_SUBR
8177c478bdstevel@tonic-gate#  endif /* ! LA_TYPE */
8187c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
8197c478bdstevel@tonic-gate#  define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
82049218d4jbeck# endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN)*/
8217c478bdstevel@tonic-gate
8227c478bdstevel@tonic-gate
8237c478bdstevel@tonic-gate/*
8247c478bdstevel@tonic-gate**  BSD/OS (was BSD/386) (all versions)
8257c478bdstevel@tonic-gate**	From Tony Sanders, BSDI
8267c478bdstevel@tonic-gate*/
8277c478bdstevel@tonic-gate
8287c478bdstevel@tonic-gate# ifdef __bsdi__
8297c478bdstevel@tonic-gate#  include <paths.h>
8307c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has the unsetenv(3) call */
8317c478bdstevel@tonic-gate#  define HASSETREUID	0	/* BSD-OS has broken setreuid(2) emulation */
8327c478bdstevel@tonic-gate#  define HASSETSID	1	/* has POSIX setsid(2) call */
8337c478bdstevel@tonic-gate#  define USESETEUID	1	/* has usable seteuid(2) call */
8347c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
8357c478bdstevel@tonic-gate#  define HASSETLOGIN	1	/* has setlogin(2) */
8367c478bdstevel@tonic-gate#  define HASUNAME	1	/* has uname(2) syscall */
8377c478bdstevel@tonic-gate#  define HASSTRERROR	1	/* has strerror(3) */
8387c478bdstevel@tonic-gate#  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
8397c478bdstevel@tonic-gate#  include <sys/cdefs.h>
8407c478bdstevel@tonic-gate#  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
8417c478bdstevel@tonic-gate#  define BSD4_4_SOCKADDR	/* has sa_len */
8427c478bdstevel@tonic-gate#  define NETLINK	1	/* supports AF_LINK */
8437c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
8447c478bdstevel@tonic-gate#  ifndef LA_TYPE
8457c478bdstevel@tonic-gate#   define LA_TYPE	LA_SUBR
8467c478bdstevel@tonic-gate#  endif /* ! LA_TYPE */
8477c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
8487c478bdstevel@tonic-gate#  define QUAD_T		quad_t
8497c478bdstevel@tonic-gate#  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
8507c478bdstevel@tonic-gate			/* version 1.1 or later */
8517c478bdstevel@tonic-gate#   undef SPT_TYPE
8527c478bdstevel@tonic-gate#   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
8537c478bdstevel@tonic-gate#  else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
8547c478bdstevel@tonic-gate			/* version 1.0 or earlier */
8557c478bdstevel@tonic-gate#   define SPT_PADCHAR	'\0'	/* pad process title with nulls */
8567c478bdstevel@tonic-gate#  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
8577c478bdstevel@tonic-gate#  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701	/* on 3.x */
8587c478bdstevel@tonic-gate#   define HASSETUSERCONTEXT 1	/* has setusercontext */
8597c478bdstevel@tonic-gate#  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */
8607c478bdstevel@tonic-gate#  if defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701	/* 3.1 and earlier */
8617c478bdstevel@tonic-gate#   define MODE_T	int	/* va_arg() can't handle less than int */
8627c478bdstevel@tonic-gate#  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 */
8637c478bdstevel@tonic-gate#  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910	/* on 4.x */
8647c478bdstevel@tonic-gate#   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
8657c478bdstevel@tonic-gate#  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 */
8667c478bdstevel@tonic-gate# endif /* __bsdi__ */
8677c478bdstevel@tonic-gate
8687c478bdstevel@tonic-gate
8694aac33djbeck# if defined(__QNX__)
8704aac33djbeck#  if defined(__QNXNTO__)
8714aac33djbeck/* QNX 6 */
8724aac33djbeck#   include <unix.h>
8734aac33djbeck#   define HASUNSETENV	1	/* has unsetenv(3) call */
8744aac33djbeck#   define HASINITGROUPS	1	/* has initgroups(3) call */
8754aac33djbeck#   define HASSETSID	1	/* has POSIX setsid(2) call */
8764aac33djbeck#   define USESETEUID	1	/* has usable seteuid(2) call */
8774aac33djbeck#   define HASFCHMOD	1	/* has fchmod(2) syscall */
8784aac33djbeck#   define HASFCHOWN	1	/* has fchown(2) syscall */
8794aac33djbeck#   define HASUNAME	1	/* has uname(2) syscall */
8804aac33djbeck#   define HASSTRERROR	1	/* has strerror(3) */
8814aac33djbeck#   define BSD4_4_SOCKADDR	/* has sa_len */
8824aac33djbeck#   define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
8834aac33djbeck#   define NETLINK	1	/* supports AF_LINK */
8844aac33djbeck#   define GIDSET_T	gid_t
8854aac33djbeck#   define QUAD_T	uint64_t
8864aac33djbeck#   define HASSNPRINTF	1	/* has snprintf(3) (all versions?) */
8874aac33djbeck#   define HASGETUSERSHELL 0
8884aac33djbeck
8894aac33djbeck/*
8904aac33djbeck**  We have a strrev() that doesn't allocate anything.
8914aac33djbeck**  Make sure the one here is used.
8924aac33djbeck*/
8934aac33djbeck
8944aac33djbeck#   define strrev strrev_sendmail
8954aac33djbeck
8964aac33djbeck#  else /* defined(__QNXNTO__) */
8974aac33djbeck
8987c478bdstevel@tonic-gate/*
8997c478bdstevel@tonic-gate**  QNX 4.2x
9007c478bdstevel@tonic-gate**	Contributed by Glen McCready <glen@qnx.com>.
9017c478bdstevel@tonic-gate**
9024aac33djbeck**	Should work with all versions of QNX 4.
9037c478bdstevel@tonic-gate*/
9047c478bdstevel@tonic-gate
9054aac33djbeck#   include <unix.h>
9064aac33djbeck#   include <sys/select.h>
9074aac33djbeck#   undef NGROUPS_MAX
9084aac33djbeck#   define HASSETSID	1	/* has POSIX setsid(2) call */
9094aac33djbeck#   define USESETEUID	1	/* has usable seteuid(2) call */
9104aac33djbeck#   define HASFCHMOD	1	/* has fchmod(2) syscall */
9114aac33djbeck#   define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
9124aac33djbeck#   define HASSETREUID	1	/* has setreuid(2) call */
9134aac33djbeck#   define HASSTRERROR	1	/* has strerror(3) */
9144aac33djbeck#   define HASFLOCK	0
9154aac33djbeck#   undef HASINITGROUPS		/* has initgroups(3) call */
9164aac33djbeck#   define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
9174aac33djbeck#   define IP_SRCROUTE	1	/* can check IP source routing */
9184aac33djbeck#   define TZ_TYPE	TZ_TMNAME	/* use tmname variable */
9194aac33djbeck#   define GIDSET_T	gid_t
9204aac33djbeck#   define LA_TYPE	LA_ZERO
9214aac33djbeck#   define SFS_TYPE	SFS_NONE
9224aac33djbeck#   define SPT_TYPE	SPT_REUSEARGV
9234aac33djbeck#   define SPT_PADCHAR	'\0'	/* pad process title with nulls */
9244aac33djbeck#   define HASGETUSERSHELL 0
9254aac33djbeck#   define _FILE_H_INCLUDED
9264aac33djbeck#  endif /* defined(__QNXNTO__) */
9277c478bdstevel@tonic-gate# endif /* defined(__QNX__) */
9287c478bdstevel@tonic-gate
9297c478bdstevel@tonic-gate
9307c478bdstevel@tonic-gate/*
9317c478bdstevel@tonic-gate**  DragonFly BSD/ FreeBSD / NetBSD / OpenBSD (all architectures, all versions)
9327c478bdstevel@tonic-gate**
9337c478bdstevel@tonic-gate**  4.3BSD clone, closer to 4.4BSD	for FreeBSD 1.x and NetBSD 0.9x
9347c478bdstevel@tonic-gate**  4.4BSD-Lite based			for FreeBSD 2.x and NetBSD 1.x
9357c478bdstevel@tonic-gate**
9367c478bdstevel@tonic-gate**	See also BSD defines.
9377c478bdstevel@tonic-gate*/
9387c478bdstevel@tonic-gate
9397c478bdstevel@tonic-gate# if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
9407c478bdstevel@tonic-gate#  include <paths.h>
9417c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(3) call */
9427c478bdstevel@tonic-gate#  define HASSETSID	1	/* has POSIX setsid(2) call */
9437c478bdstevel@tonic-gate#  define USESETEUID	1	/* has usable seteuid(2) call */
9447c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
9457c478bdstevel@tonic-gate#  define HASFCHOWN	1	/* has fchown(2) syscall */
9467c478bdstevel@tonic-gate#  define HASUNAME	1	/* has uname(2) syscall */
9477c478bdstevel@tonic-gate#  define HASSTRERROR	1	/* has strerror(3) */
9487c478bdstevel@tonic-gate#  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
9497c478bdstevel@tonic-gate#  define NEED_PRINTF_PERCENTQ	1	/* doesn't have %lld */
9507c478bdstevel@tonic-gate#  include <sys/cdefs.h>
9517c478bdstevel@tonic-gate#  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
9527c478bdstevel@tonic-gate#  define BSD4_4_SOCKADDR	/* has sa_len */
9537c478bdstevel@tonic-gate#  define NETLINK	1	/* supports AF_LINK */
9547c478bdstevel@tonic-gate#  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
9557c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
95649218d4jbeck#  define QUAD_T	unsigned long long
95749218d4jbeck#  define HASSNPRINTF	1	/* has snprintf(3) (all versions?) */
9587c478bdstevel@tonic-gate#  ifndef LA_TYPE
9597c478bdstevel@tonic-gate#   define LA_TYPE	LA_SUBR
9607c478bdstevel@tonic-gate#  endif /* ! LA_TYPE */
961445f247jbeck#  if defined(__NetBSD__) && defined(__NetBSD_Version__) && \
962445f247jbeck    ((__NetBSD_Version__ >= 200040000 && __NetBSD_Version__ < 200090000) || \
963445f247jbeck    (__NetBSD_Version__ >= 299000900))
9647c478bdstevel@tonic-gate#   undef SFS_TYPE
9657c478bdstevel@tonic-gate#   define SFS_TYPE	SFS_STATVFS
9667c478bdstevel@tonic-gate#  else
9677c478bdstevel@tonic-gate#   define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
9687c478bdstevel@tonic-gate#  endif
9697c478bdstevel@tonic-gate#  if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1)
9707c478bdstevel@tonic-gate#   undef SPT_TYPE
9717c478bdstevel@tonic-gate#   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
9727c478bdstevel@tonic-gate#  endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */
9737c478bdstevel@tonic-gate#  if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3))
9747c478bdstevel@tonic-gate#   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
9757c478bdstevel@tonic-gate#  endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */
9767c478bdstevel@tonic-gate#  if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104170000
9777c478bdstevel@tonic-gate#   define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
9787c478bdstevel@tonic-gate#  endif
979445f247jbeck#  if defined(__NetBSD__) && defined(__NetBSD_Version__) && \
980445f247jbeck    ((__NetBSD_Version__ >= 200060000 && __NetBSD_Version__ < 200090000) || \
981445f247jbeck    (__NetBSD_Version__ >= 299000900))
9827c478bdstevel@tonic-gate#   define HASCLOSEFROM	1	/* closefrom(3) added in 2.0F */
9837c478bdstevel@tonic-gate#  endif
9847c478bdstevel@tonic-gate#  if defined(__NetBSD__)
9857c478bdstevel@tonic-gate#   define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
9867c478bdstevel@tonic-gate#   include <sys/param.h>
9877c478bdstevel@tonic-gate#   include <sys/sysctl.h>
9887c478bdstevel@tonic-gate#  endif
9897c478bdstevel@tonic-gate#  if defined(__DragonFly__)
9907c478bdstevel@tonic-gate#   define HASSETLOGIN		1	/* has setlogin(2) */
9917c478bdstevel@tonic-gate#   define HASSRANDOMDEV	1	/* has srandomdev(3) */
9927c478bdstevel@tonic-gate#   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
9937c478bdstevel@tonic-gate#   undef SPT_TYPE
9947c478bdstevel@tonic-gate#   include <libutil.h>
9957c478bdstevel@tonic-gate#   define SPT_TYPE		SPT_BUILTIN
9967c478bdstevel@tonic-gate#   define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
9977c478bdstevel@tonic-gate#   ifndef SMRSH_CMDDIR
9987c478bdstevel@tonic-gate#    define SMRSH_CMDDIR	"/usr/libexec/sm.bin"
9997c478bdstevel@tonic-gate#   endif /* ! SMRSH_CMDDIR */
10007c478bdstevel@tonic-gate#   ifndef SMRSH_PATH
10017c478bdstevel@tonic-gate#    define SMRSH_PATH		"/bin:/usr/bin"
10027c478bdstevel@tonic-gate#   endif /* ! SMRSH_PATH */
10037c478bdstevel@tonic-gate#  define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
10047c478bdstevel@tonic-gate#  include <sys/sysctl.h>
10057c478bdstevel@tonic-gate#  endif /* defined(__DragonFly__) */
10067c478bdstevel@tonic-gate#  if defined(__FreeBSD__)
10077c478bdstevel@tonic-gate#   define HASSETLOGIN	1	/* has setlogin(2) */
10087c478bdstevel@tonic-gate#   if __FreeBSD_version >= 227001
10097c478bdstevel@tonic-gate#    define HASSRANDOMDEV	1	/* has srandomdev(3) */
10107c478bdstevel@tonic-gate#    define HASURANDOMDEV	1	/* has /dev/urandom(4) */
10117c478bdstevel@tonic-gate#   endif /* __FreeBSD_version >= 227001 */
10127c478bdstevel@tonic-gate#   undef SPT_TYPE
10137c478bdstevel@tonic-gate#   if __FreeBSD__ >= 2
10147c478bdstevel@tonic-gate#    include <osreldate.h>
10157c478bdstevel@tonic-gate#    if __FreeBSD_version >= 199512	/* 2.2-current when it appeared */
10167c478bdstevel@tonic-gate#     include <libutil.h>
10177c478bdstevel@tonic-gate#     define SPT_TYPE	SPT_BUILTIN
10187c478bdstevel@tonic-gate#    endif /* __FreeBSD_version >= 199512 */
10197c478bdstevel@tonic-gate#    if __FreeBSD_version >= 222000	/* 2.2.2-release and later */
10207c478bdstevel@tonic-gate#     define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
10217c478bdstevel@tonic-gate#    endif /* __FreeBSD_version >= 222000 */
10227c478bdstevel@tonic-gate#    if __FreeBSD_version >= 330000	/* 3.3.0-release and later */
10237c478bdstevel@tonic-gate#     ifndef SMRSH_CMDDIR
10247c478bdstevel@tonic-gate#      define SMRSH_CMDDIR	"/usr/libexec/sm.bin"
10257c478bdstevel@tonic-gate#     endif /* ! SMRSH_CMDDIR */
10267c478bdstevel@tonic-gate#     ifndef SMRSH_PATH
10277c478bdstevel@tonic-gate#      define SMRSH_PATH	"/bin:/usr/bin"
10287c478bdstevel@tonic-gate#     endif /* ! SMRSH_PATH */
10297c478bdstevel@tonic-gate#    endif /* __FreeBSD_version >= 330000 */
1030e9af4bcJohn Beck#    if __FreeBSD_version >= 430000	/* 4.3.0-release and later */
1031e9af4bcJohn Beck#     define SOCKADDR_LEN_T	socklen_t	/* e.g., arg#3 to accept, getsockname */
1032e9af4bcJohn Beck#     define SOCKOPT_LEN_T	socklen_t	/* arg#5 to getsockopt */
1033e9af4bcJohn Beck#    endif /* __FreeBSD_version >= 430000 */
10347c478bdstevel@tonic-gate#    define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
10357c478bdstevel@tonic-gate#    include <sys/sysctl.h>
10367c478bdstevel@tonic-gate#   endif /* __FreeBSD__ >= 2 */
10377c478bdstevel@tonic-gate#   ifndef SPT_TYPE
10387c478bdstevel@tonic-gate#    define SPT_TYPE	SPT_REUSEARGV
10397c478bdstevel@tonic-gate#    define SPT_PADCHAR	'\0'		/* pad process title with nulls */
10407c478bdstevel@tonic-gate#   endif /* ! SPT_TYPE */
10417c478bdstevel@tonic-gate#  endif /* defined(__FreeBSD__) */
10427c478bdstevel@tonic-gate#  if defined(__OpenBSD__)
10437c478bdstevel@tonic-gate#   undef SPT_TYPE
10447c478bdstevel@tonic-gate#   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
10457c478bdstevel@tonic-gate#   define HASSETLOGIN	1	/* has setlogin(2) */
10467c478bdstevel@tonic-gate#   if OpenBSD < 200305
10477c478bdstevel@tonic-gate#    define HASSETREUID	0	/* setreuid(2) broken in OpenBSD < 3.3 */
10487c478bdstevel@tonic-gate#   endif /* OpenBSD < 200305 */
10497c478bdstevel@tonic-gate#   define HASSETEGID	1	/* use setegid(2) to set saved gid */
10507c478bdstevel@tonic-gate#   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
10517c478bdstevel@tonic-gate#   if OpenBSD >= 200006
10527c478bdstevel@tonic-gate#    define HASSRANDOMDEV	1	/* has srandomdev(3) */
10537c478bdstevel@tonic-gate#   endif /* OpenBSD >= 200006 */
10547c478bdstevel@tonic-gate#   if OpenBSD >= 200012
10557c478bdstevel@tonic-gate#    define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
10567c478bdstevel@tonic-gate#   endif /* OpenBSD >= 200012 */
10577c478bdstevel@tonic-gate#   if OpenBSD >= 200405
10587c478bdstevel@tonic-gate#    define HASCLOSEFROM	1	/* closefrom(3) added in 3.5 */
10597c478bdstevel@tonic-gate#   endif /* OpenBSD >= 200405 */
106049218d4jbeck#   if OpenBSD >= 200505
106149218d4jbeck#    undef NETISO	/* iso.h removed in 3.7 */
106249218d4jbeck#   endif /* OpenBSD >= 200505 */
10637c478bdstevel@tonic-gate#  endif /* defined(__OpenBSD__) */
10647c478bdstevel@tonic-gate# endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */
10657c478bdstevel@tonic-gate
10667c478bdstevel@tonic-gate
10677c478bdstevel@tonic-gate/*
10687c478bdstevel@tonic-gate**  Mach386
10697c478bdstevel@tonic-gate**
10707c478bdstevel@tonic-gate**	For mt Xinu's Mach386 system.
10717c478bdstevel@tonic-gate*/
10727c478bdstevel@tonic-gate
10737c478bdstevel@tonic-gate# if defined(MACH) && defined(i386) && !defined(__GNU__)
10747c478bdstevel@tonic-gate#  define MACH386	1
10757c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(3) call */
10767c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
10777c478bdstevel@tonic-gate#  ifndef HASFLOCK
10787c478bdstevel@tonic-gate#   define HASFLOCK	1	/* has flock(2) call */
10797c478bdstevel@tonic-gate#  endif /* ! HASFLOCK */
10807c478bdstevel@tonic-gate#  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
10817c478bdstevel@tonic-gate#  define NEEDSTRTOL	1	/* need the strtol() function */
10827c478bdstevel@tonic-gate#  define setpgid	setpgrp
10837c478bdstevel@tonic-gate#  ifndef LA_TYPE
10847c478bdstevel@tonic-gate#   define LA_TYPE	LA_FLOAT
10857c478bdstevel@tonic-gate#  endif /* ! LA_TYPE */
10867c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
10877c478bdstevel@tonic-gate#  undef HASSETVBUF		/* don't actually have setvbuf(3) */
10887c478bdstevel@tonic-gate#  undef WEXITSTATUS
10897c478bdstevel@tonic-gate#  undef WIFEXITED
10907c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
10917c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
10927c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
10937c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
10947c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
10957c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
10967c478bdstevel@tonic-gate# endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */
10977c478bdstevel@tonic-gate
10987c478bdstevel@tonic-gate
10997c478bdstevel@tonic-gate
11007c478bdstevel@tonic-gate/*
11017c478bdstevel@tonic-gate**  GNU OS (hurd)
11027c478bdstevel@tonic-gate**	Largely BSD & posix compatible.
11037c478bdstevel@tonic-gate**	Port contributed by Miles Bader <miles@gnu.ai.mit.edu>.
11047c478bdstevel@tonic-gate**	Updated by Mark Kettenis <kettenis@wins.uva.nl>.
11057c478bdstevel@tonic-gate*/
11067c478bdstevel@tonic-gate
11077c478bdstevel@tonic-gate# if defined(__GNU__) && !defined(NeXT)
11087c478bdstevel@tonic-gate#  include <paths.h>
11097c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) call */
11107c478bdstevel@tonic-gate#  define HASFCHOWN	1	/* has fchown(2) call */
11117c478bdstevel@tonic-gate#  define HASUNAME	1	/* has uname(2) call */
11127c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(3) call */
11137c478bdstevel@tonic-gate#  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
11147c478bdstevel@tonic-gate#  define HASSTRERROR	1	/* has strerror(3) */
11157c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
11167c478bdstevel@tonic-gate#  define SOCKADDR_LEN_T	socklen_t
11177c478bdstevel@tonic-gate#  define SOCKOPT_LEN_T	socklen_t
11187c478bdstevel@tonic-gate#  if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2
11197c478bdstevel@tonic-gate#   define LA_TYPE	LA_SUBR
11207c478bdstevel@tonic-gate#  else /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
11217c478bdstevel@tonic-gate#   define LA_TYPE	LA_MACH
11227c478bdstevel@tonic-gate   /* GNU uses mach[34], which renames some rpcs from mach2.x. */
11237c478bdstevel@tonic-gate#   define host_self	mach_host_self
11247c478bdstevel@tonic-gate#  endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
11257c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_STATFS
11267c478bdstevel@tonic-gate#  define SPT_TYPE	SPT_CHANGEARGV
11277c478bdstevel@tonic-gate#  define ERRLIST_PREDEFINED	1	/* don't declare sys_errlist */
11287c478bdstevel@tonic-gate#  define BSD4_4_SOCKADDR	1	/* has sa_len */
11297c478bdstevel@tonic-gate#  define SIOCGIFCONF_IS_BROKEN  1	/* SIOCGFCONF doesn't work */
11307c478bdstevel@tonic-gate#  define HAS_IN_H	1	/* GNU has netinet/in.h. */
11317c478bdstevel@tonic-gate/* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */
11327c478bdstevel@tonic-gate#  define MAXPATHLEN	2048
11337c478bdstevel@tonic-gate# endif /* defined(__GNU__) && !defined(NeXT) */
11347c478bdstevel@tonic-gate
11357c478bdstevel@tonic-gate/*
11367c478bdstevel@tonic-gate**  4.3 BSD -- this is for very old systems
11377c478bdstevel@tonic-gate**
11387c478bdstevel@tonic-gate**	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
11397c478bdstevel@tonic-gate**
11407c478bdstevel@tonic-gate**	You'll also have to install a new resolver library.
11417c478bdstevel@tonic-gate**	I don't guarantee that support for this environment is complete.
11427c478bdstevel@tonic-gate*/
11437c478bdstevel@tonic-gate
11447c478bdstevel@tonic-gate# if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
11457c478bdstevel@tonic-gate#  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
11467c478bdstevel@tonic-gate#  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
11477c478bdstevel@tonic-gate#  define ARBPTR_T	char *
11487c478bdstevel@tonic-gate#  define setpgid	setpgrp
11497c478bdstevel@tonic-gate#  ifndef LA_TYPE
11507c478bdstevel@tonic-gate#   define LA_TYPE	LA_FLOAT
11517c478bdstevel@tonic-gate#  endif /* ! LA_TYPE */
11527c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
11537c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
11547c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
11557c478bdstevel@tonic-gate#  ifndef IDENTPROTO
11567c478bdstevel@tonic-gate#   define IDENTPROTO	0	/* TCP/IP implementation is broken */
11577c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
11587c478bdstevel@tonic-gate#  undef WEXITSTATUS
11597c478bdstevel@tonic-gate#  undef WIFEXITED
11607c478bdstevel@tonic-gatetypedef short		pid_t;
11617c478bdstevel@tonic-gate# endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */
11627c478bdstevel@tonic-gate
11637c478bdstevel@tonic-gate
11647c478bdstevel@tonic-gate/*
11657c478bdstevel@tonic-gate**  SCO Unix
11667c478bdstevel@tonic-gate**
11677c478bdstevel@tonic-gate**	This includes three parts:
11687c478bdstevel@tonic-gate**
11697c478bdstevel@tonic-gate**	The first is for SCO OpenServer 5.
11707c478bdstevel@tonic-gate**	(Contributed by Keith Reynolds <keithr@sco.COM>).
11717c478bdstevel@tonic-gate**
11727c478bdstevel@tonic-gate**		SCO OpenServer 5 has a compiler version number macro,
11737c478bdstevel@tonic-gate**		which we can use to figure out what version we're on.
11747c478bdstevel@tonic-gate**		This may have to change in future releases.
11757c478bdstevel@tonic-gate**
11767c478bdstevel@tonic-gate**	The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0.
11777c478bdstevel@tonic-gate**	(Contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
11787c478bdstevel@tonic-gate**
11797c478bdstevel@tonic-gate**	The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier.
11807c478bdstevel@tonic-gate*/
11817c478bdstevel@tonic-gate
11827c478bdstevel@tonic-gate/* SCO OpenServer 5 */
11837c478bdstevel@tonic-gate# if _SCO_DS >= 1
11847c478bdstevel@tonic-gate#  include <paths.h>
11857c478bdstevel@tonic-gate#  define SIOCGIFNUM_IS_BROKEN 1	/* SIOCGIFNUM returns bogus value */
11867c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) call */
11877c478bdstevel@tonic-gate#  define HASFCHOWN	1	/* has fchown(2) call */
11887c478bdstevel@tonic-gate#  define HASSETRLIMIT	1	/* has setrlimit(2) call */
11897c478bdstevel@tonic-gate#  define USESETEUID	1	/* has seteuid(2) call */
11907c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
11917c478bdstevel@tonic-gate#  define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
11927c478bdstevel@tonic-gate#  define RLIMIT_NEEDS_SYS_TIME_H	1
11937c478bdstevel@tonic-gate#  define LDA_USE_LOCKF	1
11947c478bdstevel@tonic-gate#  ifndef LA_TYPE
11957c478bdstevel@tonic-gate#   define LA_TYPE	LA_DEVSHORT
11967c478bdstevel@tonic-gate#  endif /* ! LA_TYPE */
11977c478bdstevel@tonic-gate#  define _PATH_AVENRUN	"/dev/table/avenrun"
11987c478bdstevel@tonic-gate#  ifndef _SCO_unix_4_2
11997c478bdstevel@tonic-gate#   define _SCO_unix_4_2
12007c478bdstevel@tonic-gate#  else /* ! _SCO_unix_4_2 */
12017c478bdstevel@tonic-gate#   define SOCKADDR_LEN_T	size_t	/* e.g., arg#3 to accept, getsockname */
12027c478bdstevel@tonic-gate#   define SOCKOPT_LEN_T	size_t	/* arg#5 to getsockopt */
12037c478bdstevel@tonic-gate#  endif /* ! _SCO_unix_4_2 */
12047c478bdstevel@tonic-gate# endif /* _SCO_DS >= 1 */
12057c478bdstevel@tonic-gate
12067c478bdstevel@tonic-gate/* SCO UNIX 3.2v4.2/Open Desktop 3.0 */
12077c478bdstevel@tonic-gate# ifdef _SCO_unix_4_2
12087c478bdstevel@tonic-gate#  define _SCO_unix_
12097c478bdstevel@tonic-gate#  define HASSETREUID	1	/* has setreuid(2) call */
12107c478bdstevel@tonic-gate# endif /* _SCO_unix_4_2 */
12117c478bdstevel@tonic-gate
12127c478bdstevel@tonic-gate/* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */
12137c478bdstevel@tonic-gate# ifdef _SCO_unix_
12147c478bdstevel@tonic-gate#  include <sys/stream.h>	/* needed for IP_SRCROUTE */
12157c478bdstevel@tonic-gate#  define SYSTEM5	1	/* include all the System V defines */
12167c478bdstevel@tonic-gate#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
12177c478bdstevel@tonic-gate#  define NOFTRUNCATE	0	/* has (simulated) ftruncate call */
12187c478bdstevel@tonic-gate#  ifndef USE_SIGLONGJMP
12197c478bdstevel@tonic-gate#   define USE_SIGLONGJMP	1 /* sigsetjmp needed for signal handling */
12207c478bdstevel@tonic-gate#  endif /* ! USE_SIGLONGJMP */
12217c478bdstevel@tonic-gate#  define MAXPATHLEN	PATHSIZE
12227c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
12237c478bdstevel@tonic-gate#  define SFS_BAVAIL	f_bfree		/* alternate field name */
12247c478bdstevel@tonic-gate#  define SPT_TYPE	SPT_SCO		/* write kernel u. area */
12257c478bdstevel@tonic-gate#  define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
12267c478bdstevel@tonic-gate#  define UID_T		uid_t
12277c478bdstevel@tonic-gate#  define GID_T		gid_t
12287c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
12297c478bdstevel@tonic-gate#  define _PATH_UNIX		"/unix"
12307c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
12317c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
12327c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
12337c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
12347c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
12357c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
12367c478bdstevel@tonic-gate
12377c478bdstevel@tonic-gate/* stuff fixed in later releases */
12387c478bdstevel@tonic-gate#  ifndef _SCO_unix_4_2
12397c478bdstevel@tonic-gate#   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
12407c478bdstevel@tonic-gate#  endif /* ! _SCO_unix_4_2 */
12417c478bdstevel@tonic-gate
12427c478bdstevel@tonic-gate#  ifndef _SCO_DS
12437c478bdstevel@tonic-gate#   define ftruncate	chsize	/* use chsize(2) to emulate ftruncate */
12447c478bdstevel@tonic-gate#   define NEEDFSYNC	1	/* needs the fsync(2) call stub */
12457c478bdstevel@tonic-gate#   define NETUNIX	0	/* no unix domain socket support */
12467c478bdstevel@tonic-gate#   define LA_TYPE	LA_SHORT
12477c478bdstevel@tonic-gate#  endif /* ! _SCO_DS */
12487c478bdstevel@tonic-gate
12497c478bdstevel@tonic-gate# endif /* _SCO_unix_ */
12507c478bdstevel@tonic-gate
12517c478bdstevel@tonic-gate/*
12527c478bdstevel@tonic-gate**  ISC (SunSoft) Unix.
12537c478bdstevel@tonic-gate**
12547c478bdstevel@tonic-gate**	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
12557c478bdstevel@tonic-gate*/
12567c478bdstevel@tonic-gate
12577c478bdstevel@tonic-gate# ifdef ISC_UNIX
12587c478bdstevel@tonic-gate#  include <net/errno.h>
12597c478bdstevel@tonic-gate#  include <sys/stream.h>	/* needed for IP_SRCROUTE */
12607c478bdstevel@tonic-gate#  include <sys/bsdtypes.h>
12617c478bdstevel@tonic-gate#  define SYSTEM5	1	/* include all the System V defines */
12627c478bdstevel@tonic-gate#  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
12637c478bdstevel@tonic-gate#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
12647c478bdstevel@tonic-gate#  define HASSETREUID	1	/* has setreuid(2) call */
12657c478bdstevel@tonic-gate#  define NEEDFSYNC	1	/* needs the fsync(2) call stub */
12667c478bdstevel@tonic-gate#  define NETUNIX	0	/* no unix domain socket support */
12677c478bdstevel@tonic-gate#  define MAXPATHLEN	1024
12687c478bdstevel@tonic-gate#  define LA_TYPE	LA_SHORT
12697c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
12707c478bdstevel@tonic-gate#  define SFS_BAVAIL	f_bfree		/* alternate field name */
12717c478bdstevel@tonic-gate#  define _PATH_UNIX		"/unix"
12727c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
12737c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
12747c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
12757c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
12767c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
12777c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
12787c478bdstevel@tonic-gate# endif /* ISC_UNIX */
12797c478bdstevel@tonic-gate
12807c478bdstevel@tonic-gate
12817c478bdstevel@tonic-gate/*
12827c478bdstevel@tonic-gate**  Altos System V (5.3.1)
12837c478bdstevel@tonic-gate**	Contributed by Tim Rice <tim@trr.metro.net>.
12847c478bdstevel@tonic-gate*/
12857c478bdstevel@tonic-gate
12867c478bdstevel@tonic-gate# ifdef ALTOS_SYSTEM_V
12877c478bdstevel@tonic-gate#  include <sys/stream.h>
12887c478bdstevel@tonic-gate#  include <limits.h>
12897c478bdstevel@tonic-gate#  define SYSTEM5	1	/* include all the System V defines */
12907c478bdstevel@tonic-gate#  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
12917c478bdstevel@tonic-gate#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
12927c478bdstevel@tonic-gate#  define WAITUNION	1	/* use "union wait" as wait argument type */
12937c478bdstevel@tonic-gate#  define NEEDFSYNC	1	/* no fsync(2) in system library */
12947c478bdstevel@tonic-gate#  define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
12957c478bdstevel@tonic-gate#  define NOFTRUNCATE	1	/* do not have ftruncate(2) */
12967c478bdstevel@tonic-gate#  define MAXPATHLEN	PATH_MAX
12977c478bdstevel@tonic-gate#  define LA_TYPE	LA_SHORT
12987c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
12997c478bdstevel@tonic-gate#  define SFS_BAVAIL	f_bfree		/* alternate field name */
13007c478bdstevel@tonic-gate#  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
13017c478bdstevel@tonic-gate#  define NETUNIX	0	/* no unix domain socket support */
13027c478bdstevel@tonic-gate#  undef WIFEXITED
13037c478bdstevel@tonic-gate#  undef WEXITSTATUS
13047c478bdstevel@tonic-gate#  define strtoul	strtol	/* gcc library bogosity */
13057c478bdstevel@tonic-gate
13067c478bdstevel@tonic-gatetypedef unsigned short	uid_t;
13077c478bdstevel@tonic-gatetypedef unsigned short	gid_t;
13087c478bdstevel@tonic-gatetypedef short		pid_t;
13097c478bdstevel@tonic-gatetypedef unsigned long	mode_t;
13107c478bdstevel@tonic-gate
13117c478bdstevel@tonic-gate/* some stuff that should have been in the include files */
13127c478bdstevel@tonic-gateextern char		*malloc();
13137c478bdstevel@tonic-gateextern struct passwd	*getpwent();
13147c478bdstevel@tonic-gateextern struct passwd	*getpwnam();
13157c478bdstevel@tonic-gateextern struct passwd	*getpwuid();
13167c478bdstevel@tonic-gateextern char		*getenv();
13177c478bdstevel@tonic-gateextern struct group	*getgrgid();
13187c478bdstevel@tonic-gateextern struct group	*getgrnam();
13197c478bdstevel@tonic-gate
13207c478bdstevel@tonic-gate# endif /* ALTOS_SYSTEM_V */
13217c478bdstevel@tonic-gate
13227c478bdstevel@tonic-gate
13237c478bdstevel@tonic-gate/*
13247c478bdstevel@tonic-gate**  ConvexOS 11.0 and later
13257c478bdstevel@tonic-gate**
13267c478bdstevel@tonic-gate**	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
13277c478bdstevel@tonic-gate**	works on 9.1 as well.
13287c478bdstevel@tonic-gate**
13297c478bdstevel@tonic-gate**  ConvexOS 11.5 and later, should work on 11.0 as defined.
13307c478bdstevel@tonic-gate**  For pre-ConvexOOS 11.0, define SM_CONF_GETOPT=0, undef IDENTPROTO
13317c478bdstevel@tonic-gate**
13327c478bdstevel@tonic-gate**	Eric Schnoebelen (eric@cirr.com) For CONVEX Computer Corp.
13337c478bdstevel@tonic-gate**		(now the CONVEX Technologies Center of Hewlett Packard)
13347c478bdstevel@tonic-gate*/
13357c478bdstevel@tonic-gate
13367c478bdstevel@tonic-gate# ifdef _CONVEX_SOURCE
13377c478bdstevel@tonic-gate#  define HASGETDTABLESIZE	1	/* has getdtablesize(2) */
13387c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) */
13397c478bdstevel@tonic-gate#  define HASUNAME	1	/* use System V uname(2) system call */
13407c478bdstevel@tonic-gate#  define HASSETSID	1	/* has POSIX setsid(2) call */
13417c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(3) */
13427c478bdstevel@tonic-gate#  define HASFLOCK	1	/* has flock(2) */
13437c478bdstevel@tonic-gate#  define HASSETRLIMIT	1	/* has setrlimit(2) */
13447c478bdstevel@tonic-gate#  define HASSETREUID	1	/* has setreuid(2) */
13457c478bdstevel@tonic-gate#  define BROKEN_RES_SEARCH	1	/* res_search(unknown) returns h_error=0 */
13467c478bdstevel@tonic-gate#  define NEEDPUTENV	1	/* needs putenv (written in terms of setenv) */
13477c478bdstevel@tonic-gate#  define SM_CONF_GETOPT	1	/* need a replacement for getopt(3) */
13487c478bdstevel@tonic-gate#  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
13497c478bdstevel@tonic-gate#  define LA_TYPE	LA_FLOAT
13507c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
13517c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
13527c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
13537c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
13547c478bdstevel@tonic-gate#  ifndef S_IREAD
13557c478bdstevel@tonic-gate#   define S_IREAD	_S_IREAD
13567c478bdstevel@tonic-gate#   define S_IWRITE	_S_IWRITE
13577c478bdstevel@tonic-gate#   define S_IEXEC	_S_IEXEC
13587c478bdstevel@tonic-gate#   define S_IFMT	_S_IFMT
13597c478bdstevel@tonic-gate#   define S_IFCHR	_S_IFCHR
13607c478bdstevel@tonic-gate#   define S_IFBLK	_S_IFBLK
13617c478bdstevel@tonic-gate#  endif /* ! S_IREAD */
13627c478bdstevel@tonic-gate#  ifndef TZ_TYPE
13637c478bdstevel@tonic-gate#   define TZ_TYPE	TZ_TIMEZONE
13647c478bdstevel@tonic-gate#  endif /* ! TZ_TYPE */
13657c478bdstevel@tonic-gate#  ifndef IDENTPROTO
13667c478bdstevel@tonic-gate#   define IDENTPROTO	1
13677c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
13687c478bdstevel@tonic-gate#  ifndef SHARE_V1
13697c478bdstevel@tonic-gate#   define SHARE_V1	1	/* version 1 of the fair share scheduler */
13707c478bdstevel@tonic-gate#  endif /* ! SHARE_V1 */
13717c478bdstevel@tonic-gate#  if !defined(__GNUC__ )
13727c478bdstevel@tonic-gate#   define UID_T	int		/* GNUC gets it right, ConvexC botches */
13737c478bdstevel@tonic-gate#   define GID_T	int		/* GNUC gets it right, ConvexC botches */
13747c478bdstevel@tonic-gate#  endif /* !defined(__GNUC__ ) */
13757c478bdstevel@tonic-gate#  if SECUREWARE
13767c478bdstevel@tonic-gate#   define FORK	fork		/* SecureWare wants the real fork! */
13777c478bdstevel@tonic-gate#  else /* SECUREWARE */
13787c478bdstevel@tonic-gate#   define FORK	vfork		/* the rest of the OS versions don't care */
13797c478bdstevel@tonic-gate#  endif /* SECUREWARE */
13807c478bdstevel@tonic-gate# endif /* _CONVEX_SOURCE */
13817c478bdstevel@tonic-gate
13827c478bdstevel@tonic-gate
13837c478bdstevel@tonic-gate/*
13847c478bdstevel@tonic-gate**  RISC/os 4.52
13857c478bdstevel@tonic-gate**
13867c478bdstevel@tonic-gate**	Gives a ton of warning messages, but otherwise compiles.
13877c478bdstevel@tonic-gate*/
13887c478bdstevel@tonic-gate
13897c478bdstevel@tonic-gate# ifdef RISCOS
13907c478bdstevel@tonic-gate
13917c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(3) call */
13927c478bdstevel@tonic-gate#  ifndef HASFLOCK
13937c478bdstevel@tonic-gate#   define HASFLOCK	1	/* has flock(2) call */
13947c478bdstevel@tonic-gate#  endif /* ! HASFLOCK */
13957c478bdstevel@tonic-gate#  define WAITUNION	1	/* use "union wait" as wait argument type */
13967c478bdstevel@tonic-gate#  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
13977c478bdstevel@tonic-gate#  define NEEDPUTENV	1	/* need putenv(3) call */
13987c478bdstevel@tonic-gate#  define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
13997c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
14007c478bdstevel@tonic-gate#  define LA_TYPE	LA_INT
14017c478bdstevel@tonic-gate#  define LA_AVENRUN	"avenrun"
14027c478bdstevel@tonic-gate#  define _PATH_UNIX	"/unix"
14037c478bdstevel@tonic-gate#  undef WIFEXITED
14047c478bdstevel@tonic-gate
14057c478bdstevel@tonic-gate#  define setpgid	setpgrp
14067c478bdstevel@tonic-gate
14077c478bdstevel@tonic-gatetypedef int		pid_t;
14087c478bdstevel@tonic-gate#  define SIGFUNC_DEFINED
14097c478bdstevel@tonic-gate#  define SIGFUNC_RETURN	(0)
14107c478bdstevel@tonic-gate#  define SIGFUNC_DECL	int
14117c478bdstevel@tonic-gatetypedef int		(*sigfunc_t)();
14127c478bdstevel@tonic-gateextern char		*getenv();
14137c478bdstevel@tonic-gateextern void		*malloc();
14147c478bdstevel@tonic-gate
14157c478bdstevel@tonic-gate/* added for RISC/os 4.01...which is dumber than 4.50 */
14167c478bdstevel@tonic-gate#  ifdef RISCOS_4_0
14177c478bdstevel@tonic-gate#   ifndef ARBPTR_T
14187c478bdstevel@tonic-gate#    define ARBPTR_T	char *
14197c478bdstevel@tonic-gate#   endif /* ! ARBPTR_T */
14207c478bdstevel@tonic-gate#   undef HASFLOCK
14217c478bdstevel@tonic-gate#   define HASFLOCK	0
14227c478bdstevel@tonic-gate#  endif /* RISCOS_4_0 */
14237c478bdstevel@tonic-gate
14247c478bdstevel@tonic-gate#  include <sys/time.h>
14257c478bdstevel@tonic-gate
14267c478bdstevel@tonic-gate# endif /* RISCOS */
14277c478bdstevel@tonic-gate
14287c478bdstevel@tonic-gate
14297c478bdstevel@tonic-gate/*
14307c478bdstevel@tonic-gate**  Linux 0.99pl10 and above...
14317c478bdstevel@tonic-gate**
14327c478bdstevel@tonic-gate**  Thanks to, in reverse order of contact:
14337c478bdstevel@tonic-gate**
14347c478bdstevel@tonic-gate**	John Kennedy <warlock@csuchico.edu>
14357c478bdstevel@tonic-gate**	Andrew Pam <avatar@aus.xanadu.com>
14367c478bdstevel@tonic-gate**	Florian La Roche <rzsfl@rz.uni-sb.de>
14377c478bdstevel@tonic-gate**	Karl London <karl@borg.demon.co.uk>
14387c478bdstevel@tonic-gate**
14397c478bdstevel@tonic-gate**  NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style
14407c478bdstevel@tonic-gate**	file locking is no longer allowed.  In particular, make sure
14417c478bdstevel@tonic-gate**	your DBM library and sendmail are both using either flock(2)
14427c478bdstevel@tonic-gate**	*or* fcntl(2) file locking, but not both.
14437c478bdstevel@tonic-gate*/
14447c478bdstevel@tonic-gate
14457c478bdstevel@tonic-gate# ifdef __linux__
14467c478bdstevel@tonic-gate#  include <linux/version.h>
14477c478bdstevel@tonic-gate#  if !defined(KERNEL_VERSION)	/* not defined in 2.0.x kernel series */
14487c478bdstevel@tonic-gate#   define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
14497c478bdstevel@tonic-gate#  endif /* !defined(KERNEL_VERSION) */
14507c478bdstevel@tonic-gate#  define BSD		1	/* include BSD defines */
14517c478bdstevel@tonic-gate#  define HASSETREGID	1	/* use setregid(2) to set saved gid */
14527c478bdstevel@tonic-gate#  ifndef REQUIRES_DIR_FSYNC
14537c478bdstevel@tonic-gate#   define REQUIRES_DIR_FSYNC	1	/* requires fsync() on directory */
14547c478bdstevel@tonic-gate#  endif /* REQUIRES_DIR_FSYNC */
14557c478bdstevel@tonic-gate#  ifndef USESETEUID
14567c478bdstevel@tonic-gate#   define USESETEUID	0	/* has it due to POSIX, but doesn't work */
14577c478bdstevel@tonic-gate#  endif /* USESETEUID */
14587c478bdstevel@tonic-gate#  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
14597c478bdstevel@tonic-gate#  define HASUNAME	1	/* use System V uname(2) system call */
14607c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(3) call */
14617c478bdstevel@tonic-gate#  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
14627c478bdstevel@tonic-gate#  define GIDSET_T	gid_t	/* from <linux/types.h> */
14637c478bdstevel@tonic-gate#  ifndef HASGETUSERSHELL
14647c478bdstevel@tonic-gate#   define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
14657c478bdstevel@tonic-gate#  endif /* HASGETUSERSHELL */
14667c478bdstevel@tonic-gate#  ifndef IP_SRCROUTE
14677c478bdstevel@tonic-gate#   define IP_SRCROUTE	0	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
14687c478bdstevel@tonic-gate#  endif /* ! IP_SRCROUTE */
14697c478bdstevel@tonic-gate#  ifndef HAS_IN_H
14707c478bdstevel@tonic-gate#   define HAS_IN_H	1	/* use netinet/in.h */
14717c478bdstevel@tonic-gate#  endif /* ! HAS_IN_H */
14727c478bdstevel@tonic-gate#  ifndef USE_SIGLONGJMP
14737c478bdstevel@tonic-gate#   define USE_SIGLONGJMP	1 /* sigsetjmp needed for signal handling */
14747c478bdstevel@tonic-gate#  endif /* ! USE_SIGLONGJMP */
14757c478bdstevel@tonic-gate#  ifndef HASFLOCK
14767c478bdstevel@tonic-gate#   if LINUX_VERSION_CODE < 66399
14777c478bdstevel@tonic-gate#    define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
14787c478bdstevel@tonic-gate#   else /* LINUX_VERSION_CODE < 66399 */
14797c478bdstevel@tonic-gate#     if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
14807c478bdstevel@tonic-gate#      define HASFLOCK	1	/* flock(2) fixed after 1.3.95 */
14817c478bdstevel@tonic-gate#     else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
14827c478bdstevel@tonic-gate#      define HASFLOCK	0	/* flock(2) is broken (again) after 2.4.0 */
14837c478bdstevel@tonic-gate#     endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
14847c478bdstevel@tonic-gate#   endif /* LINUX_VERSION_CODE < 66399 */
14857c478bdstevel@tonic-gate#  endif /* ! HASFLOCK */
14867c478bdstevel@tonic-gate#  ifndef LA_TYPE
14877c478bdstevel@tonic-gate#   define LA_TYPE	LA_PROCSTR
14887c478bdstevel@tonic-gate#  endif /* ! LA_TYPE */
14897c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
14907c478bdstevel@tonic-gate#  define SPT_PADCHAR	'\0'		/* pad process title with nulls */
14917c478bdstevel@tonic-gate#  if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0))
14927c478bdstevel@tonic-gate#   ifndef HASURANDOMDEV
14937c478bdstevel@tonic-gate#    define HASURANDOMDEV 1	/* 2.0 (at least) has linux/drivers/char/random.c */
14947c478bdstevel@tonic-gate#   endif /* ! HASURANDOMDEV */
14957c478bdstevel@tonic-gate#  endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) */
14967c478bdstevel@tonic-gate#  if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
14977c478bdstevel@tonic-gate#   define HASSTRERROR	1	/* has strerror(3) */
14987c478bdstevel@tonic-gate#  endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
14997c478bdstevel@tonic-gate#  ifndef TZ_TYPE
15007c478bdstevel@tonic-gate#   define TZ_TYPE	TZ_NONE		/* no standard for Linux */
15017c478bdstevel@tonic-gate#  endif /* ! TZ_TYPE */
15027c478bdstevel@tonic-gate#  if (__GLIBC__ >= 2)
15037c478bdstevel@tonic-gate#   include <paths.h>
15047c478bdstevel@tonic-gate#  endif /* (__GLIBC__ >= 2) */
15057c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
15067c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
15077c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
15087c478bdstevel@tonic-gate#  include <sys/sysmacros.h>
15097c478bdstevel@tonic-gate#  undef atol			/* wounded in <stdlib.h> */
15107c478bdstevel@tonic-gate#  if NETINET6
15117c478bdstevel@tonic-gate   /*
15127c478bdstevel@tonic-gate   **  Linux doesn't have a good way to tell userland what interfaces are
15137c478bdstevel@tonic-gate   **  IPv6-capable.  Therefore, the BIND resolver can not determine if there
15147c478bdstevel@tonic-gate   **  are IPv6 interfaces to honor AI_ADDRCONFIG.  Unfortunately, it assumes
15157c478bdstevel@tonic-gate   **  that none are present.  (Excuse the macro name ADDRCONFIG_IS_BROKEN.)
15167c478bdstevel@tonic-gate   */
15177c478bdstevel@tonic-gate#   define ADDRCONFIG_IS_BROKEN	1
15187c478bdstevel@tonic-gate
15197c478bdstevel@tonic-gate   /*
15207c478bdstevel@tonic-gate   **  Indirectly included from glibc's <feature.h>.  IPv6 support is native
15217c478bdstevel@tonic-gate   **  in 2.1 and later, but the APIs appear before the functions.
15227c478bdstevel@tonic-gate   */
15237c478bdstevel@tonic-gate#   if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
15247c478bdstevel@tonic-gate#    define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__)
15257c478bdstevel@tonic-gate#    if (GLIBC_VERSION >= 0x201)
15267c478bdstevel@tonic-gate#     undef IPPROTO_ICMPV6	/* linux #defines, glibc enums */
15277c478bdstevel@tonic-gate#    else /* (GLIBC_VERSION >= 0x201) */
15287c478bdstevel@tonic-gate#     include <linux/in6.h>	/* IPv6 support */
15297c478bdstevel@tonic-gate#    endif /* (GLIBC_VERSION >= 0x201) */
15307c478bdstevel@tonic-gate#    if (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE))
15317c478bdstevel@tonic-gate     /* Have APIs in <netdb.h>, but no support in glibc */
15327c478bdstevel@tonic-gate#     define NEEDSGETIPNODE	1
15337c478bdstevel@tonic-gate#    endif /* (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) */
15347c478bdstevel@tonic-gate#    undef GLIBC_VERSION
15357c478bdstevel@tonic-gate#   endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
15367c478bdstevel@tonic-gate#  endif /* NETINET6 */
15377c478bdstevel@tonic-gate#  ifndef HASFCHOWN
15387c478bdstevel@tonic-gate#   define HASFCHOWN	1	/* fchown(2) */
15397c478bdstevel@tonic-gate#  endif /* ! HASFCHOWN */
15407c478bdstevel@tonic-gate#  if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD)
15417c478bdstevel@tonic-gate#    define HASFCHMOD	1	/* fchmod(2) */
15427c478bdstevel@tonic-gate#  endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) */
15437c478bdstevel@tonic-gate# endif /* __linux__ */
15447c478bdstevel@tonic-gate
15457c478bdstevel@tonic-gate
15467c478bdstevel@tonic-gate/*
15477c478bdstevel@tonic-gate**  DELL SVR4 Issue 2.2, and others
15487c478bdstevel@tonic-gate**	From Kimmo Suominen <kim@grendel.lut.fi>
15497c478bdstevel@tonic-gate**
15507c478bdstevel@tonic-gate**	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
15517c478bdstevel@tonic-gate**	defined, and the definitions conflict.
15527c478bdstevel@tonic-gate**
15537c478bdstevel@tonic-gate**	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
15547c478bdstevel@tonic-gate**	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
15557c478bdstevel@tonic-gate**	(SVR4.0/386 version 3.0).
15567c478bdstevel@tonic-gate*/
15577c478bdstevel@tonic-gate
15587c478bdstevel@tonic-gate# ifdef DELL_SVR4
15597c478bdstevel@tonic-gate				/* no changes necessary */
15607c478bdstevel@tonic-gate				/* see general __svr4__ defines below */
15617c478bdstevel@tonic-gate# endif /* DELL_SVR4 */
15627c478bdstevel@tonic-gate
15637c478bdstevel@tonic-gate
15647c478bdstevel@tonic-gate/*
15657c478bdstevel@tonic-gate**  Apple A/UX 3.0
15667c478bdstevel@tonic-gate*/
15677c478bdstevel@tonic-gate
15687c478bdstevel@tonic-gate# ifdef _AUX_SOURCE
15697c478bdstevel@tonic-gate#  include <sys/sysmacros.h>
15707c478bdstevel@tonic-gate#  define BSD			/* has BSD routines */
15717c478bdstevel@tonic-gate#  define HASSETRLIMIT	0	/* ... but not setrlimit(2) */
15727c478bdstevel@tonic-gate#  define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
15737c478bdstevel@tonic-gate#  define BOGUS_O_EXCL	1	/* exclusive open follows symlinks */
15747c478bdstevel@tonic-gate#  define HASUNAME	1	/* use System V uname(2) system call */
15757c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
15767c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
15777c478bdstevel@tonic-gate#  define HASSETVBUF	1	/* has setvbuf(3) in libc */
15787c478bdstevel@tonic-gate#  define HASSTRERROR	1	/* has strerror(3) */
15797c478bdstevel@tonic-gate#  define SIGFUNC_DEFINED	/* sigfunc_t already defined */
15807c478bdstevel@tonic-gate#  define SIGFUNC_RETURN		/* POSIX-mode */
15817c478bdstevel@tonic-gate#  define SIGFUNC_DECL	void	/* POSIX-mode */
15827c478bdstevel@tonic-gate#  define ERRLIST_PREDEFINED	1
15837c478bdstevel@tonic-gate#  ifndef IDENTPROTO
15847c478bdstevel@tonic-gate#   define IDENTPROTO	0	/* TCP/IP implementation is broken */
15857c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
15867c478bdstevel@tonic-gate#  ifndef LA_TYPE
15877c478bdstevel@tonic-gate#   define LA_TYPE	LA_INT
15887c478bdstevel@tonic-gate#   define FSHIFT	16
15897c478bdstevel@tonic-gate#  endif /* ! LA_TYPE */
15907c478bdstevel@tonic-gate#  define LA_AVENRUN	"avenrun"
15917c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
15927c478bdstevel@tonic-gate#  define TZ_TYPE	TZ_TZNAME
15937c478bdstevel@tonic-gate#  ifndef _PATH_UNIX
15947c478bdstevel@tonic-gate#   define _PATH_UNIX		"/unix"		/* should be in <paths.h> */
15957c478bdstevel@tonic-gate#  endif /* ! _PATH_UNIX */
15967c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
15977c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
15987c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
15997c478bdstevel@tonic-gate#  undef WIFEXITED
16007c478bdstevel@tonic-gate#  undef WEXITSTATUS
16017c478bdstevel@tonic-gate# endif /* _AUX_SOURCE */
16027c478bdstevel@tonic-gate
16037c478bdstevel@tonic-gate
16047c478bdstevel@tonic-gate/*
16057c478bdstevel@tonic-gate**  Encore UMAX V
16067c478bdstevel@tonic-gate**
16077c478bdstevel@tonic-gate**	Not extensively tested.
16087c478bdstevel@tonic-gate*/
16097c478bdstevel@tonic-gate
16107c478bdstevel@tonic-gate# ifdef UMAXV
16117c478bdstevel@tonic-gate#  define HASUNAME	1	/* use System V uname(2) system call */
16127c478bdstevel@tonic-gate#  define HASSETVBUF	1	/* we have setvbuf(3) in libc */
16137c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
16147c478bdstevel@tonic-gate#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
16157c478bdstevel@tonic-gate#  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
16167c478bdstevel@tonic-gate#  define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
16177c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
16187c478bdstevel@tonic-gate#  define MAXPATHLEN	PATH_MAX
16197c478bdstevel@tonic-gateextern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
16207c478bdstevel@tonic-gateextern struct group	*getgrent(), *getgrnam(), *getgrgid();
16217c478bdstevel@tonic-gate#  undef WIFEXITED
16227c478bdstevel@tonic-gate#  undef WEXITSTATUS
16237c478bdstevel@tonic-gate# endif /* UMAXV */
16247c478bdstevel@tonic-gate
16257c478bdstevel@tonic-gate
16267c478bdstevel@tonic-gate/*
16277c478bdstevel@tonic-gate**  Stardent Titan 3000 running TitanOS 4.2.
16287c478bdstevel@tonic-gate**
16297c478bdstevel@tonic-gate**	Must be compiled in "cc -43" mode.
16307c478bdstevel@tonic-gate**
16317c478bdstevel@tonic-gate**	From Kate Hedstrom <kate@ahab.rutgers.edu>.
16327c478bdstevel@tonic-gate**
16337c478bdstevel@tonic-gate**	Note the tweaking below after the BSD defines are set.
16347c478bdstevel@tonic-gate*/
16357c478bdstevel@tonic-gate
16367c478bdstevel@tonic-gate# ifdef titan
16377c478bdstevel@tonic-gate#  define setpgid	setpgrp
16387c478bdstevel@tonic-gatetypedef int		pid_t;
16397c478bdstevel@tonic-gate#  undef WIFEXITED
16407c478bdstevel@tonic-gate#  undef WEXITSTATUS
16417c478bdstevel@tonic-gate# endif /* titan */
16427c478bdstevel@tonic-gate
16437c478bdstevel@tonic-gate
16447c478bdstevel@tonic-gate/*
16457c478bdstevel@tonic-gate**  Sequent DYNIX 3.2.0
16467c478bdstevel@tonic-gate**
16477c478bdstevel@tonic-gate**	From Jim Davis <jdavis@cs.arizona.edu>.
16487c478bdstevel@tonic-gate*/
16497c478bdstevel@tonic-gate
16507c478bdstevel@tonic-gate# ifdef sequent
16517c478bdstevel@tonic-gate
16527c478bdstevel@tonic-gate#  define BSD		1
16537c478bdstevel@tonic-gate#  define HASUNSETENV	1
16547c478bdstevel@tonic-gate#  define BSD4_3		1	/* to get signal() in conf.c */
16557c478bdstevel@tonic-gate#  define WAITUNION	1
16567c478bdstevel@tonic-gate#  define LA_TYPE	LA_FLOAT
16577c478bdstevel@tonic-gate#  ifdef _POSIX_VERSION
16587c478bdstevel@tonic-gate#   undef _POSIX_VERSION		/* set in <unistd.h> */
16597c478bdstevel@tonic-gate#  endif /* _POSIX_VERSION */
16607c478bdstevel@tonic-gate#  undef HASSETVBUF		/* don't actually have setvbuf(3) */
16617c478bdstevel@tonic-gate#  define setpgid	setpgrp
16627c478bdstevel@tonic-gate
16637c478bdstevel@tonic-gate/* Have to redefine WIFEXITED to take an int, to work with waitfor() */
16647c478bdstevel@tonic-gate#  undef	WIFEXITED
16657c478bdstevel@tonic-gate#  define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
16667c478bdstevel@tonic-gate			 ((union wait*)&(s))->w_termsig == 0)
16677c478bdstevel@tonic-gate#  define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
16687c478bdstevel@tonic-gatetypedef int		pid_t;
16697c478bdstevel@tonic-gate#  define isgraph(c)	(isprint(c) && (c != ' '))
16707c478bdstevel@tonic-gate
16717c478bdstevel@tonic-gate#  ifndef IDENTPROTO
16727c478bdstevel@tonic-gate#   define IDENTPROTO	0	/* TCP/IP implementation is broken */
16737c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
16747c478bdstevel@tonic-gate
16757c478bdstevel@tonic-gate#  ifndef _PATH_UNIX
16767c478bdstevel@tonic-gate#   define _PATH_UNIX		"/dynix"
16777c478bdstevel@tonic-gate#  endif /* ! _PATH_UNIX */
16787c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
16797c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
16807c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
16817c478bdstevel@tonic-gate# endif /* sequent */
16827c478bdstevel@tonic-gate
16837c478bdstevel@tonic-gate
16847c478bdstevel@tonic-gate/*
16857c478bdstevel@tonic-gate**  Sequent DYNIX/ptx v2.0 (and higher)
16867c478bdstevel@tonic-gate**
16877c478bdstevel@tonic-gate**	For DYNIX/ptx v1.x, undefine HASSETREUID.
16887c478bdstevel@tonic-gate**
16897c478bdstevel@tonic-gate**	From Tim Wright <timw@sequent.com>.
16907c478bdstevel@tonic-gate**	Update from Jack Woolley <jwoolley@sctcorp.com>, 26 Dec 1995,
16917c478bdstevel@tonic-gate**		for DYNIX/ptx 4.0.2.
16927c478bdstevel@tonic-gate*/
16937c478bdstevel@tonic-gate
16947c478bdstevel@tonic-gate# ifdef _SEQUENT_
16957c478bdstevel@tonic-gate#  include <sys/stream.h>
16967c478bdstevel@tonic-gate#  define SYSTEM5	1	/* include all the System V defines */
16977c478bdstevel@tonic-gate#  define HASSETSID	1	/* has POSIX setsid(2) call */
16987c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
16997c478bdstevel@tonic-gate#  define HASSETREUID	1	/* has setreuid(2) call */
17007c478bdstevel@tonic-gate#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
17017c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
17027c478bdstevel@tonic-gate#  define LA_TYPE	LA_INT
17037c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
17047c478bdstevel@tonic-gate#  define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
17057c478bdstevel@tonic-gate#  ifndef IDENTPROTO
17067c478bdstevel@tonic-gate#   define IDENTPROTO	0	/* TCP/IP implementation is broken */
17077c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
17087c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
17097c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
17107c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
17117c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
17127c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
17137c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
17147c478bdstevel@tonic-gate# endif /* _SEQUENT_ */
17157c478bdstevel@tonic-gate
17167c478bdstevel@tonic-gate/*
17177c478bdstevel@tonic-gate**  Cray UNICOS, UNICOS/mk, and UNICOS/mp
17187c478bdstevel@tonic-gate**
17197c478bdstevel@tonic-gate**    UNICOS:
17207c478bdstevel@tonic-gate**	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
17217c478bdstevel@tonic-gate**	Update Brian Ginsbach <ginsbach@cray.com>
17227c478bdstevel@tonic-gate**    UNICOS/mk (Cray T3E):
17237c478bdstevel@tonic-gate**	Contributed by Manu Mahonen <mailadm@csc.fi>
17247c478bdstevel@tonic-gate**	of Center for Scientific Computing.
17257c478bdstevel@tonic-gate**	Update Brian Ginsbach <ginsbach@cray.com>
17267c478bdstevel@tonic-gate**    UNICOS/mp:
17277c478bdstevel@tonic-gate**	From Aaron Davis <awd@cray.com> & Brian Ginsbach <ginsbach@cray.com>
17287c478bdstevel@tonic-gate*/
17297c478bdstevel@tonic-gate
17307c478bdstevel@tonic-gate# if defined(_CRAY) || defined(UNICOS) || defined(_UNICOSMP)
17317c478bdstevel@tonic-gate#  define SYSTEM5	1	/* include all the System V defines */
17327c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
17337c478bdstevel@tonic-gate#  define HASFCHOWN	1	/* has fchown(2) */
17347c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(3) call */
17357c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
17367c478bdstevel@tonic-gate#  define HASSETREUID	1	/* has setreuid(2) call */
17377c478bdstevel@tonic-gate#  define USESETEUID	1	/* has usable seteuid(2) call */
17387c478bdstevel@tonic-gate#  define HASGETDTABLESIZE 1	/* has getdtablesize(2) syscall */
17397c478bdstevel@tonic-gate#  define HASSTRERROR	1	/* has strerror(3) */
17407c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
17417c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
17427c478bdstevel@tonic-gate#  define SFS_BAVAIL	f_bfree	/* alternate field name */
17437c478bdstevel@tonic-gate#  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
17447c478bdstevel@tonic-gate#  ifdef UNICOS
17457c478bdstevel@tonic-gate#   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
17467c478bdstevel@tonic-gate#   define LA_TYPE	LA_ZERO
17477c478bdstevel@tonic-gate#   define _PATH_MAILDIR	"/usr/spool/mail"
17487c478bdstevel@tonic-gate#   define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst)
17497c478bdstevel@tonic-gate#   ifndef MAXPATHLEN
17507c478bdstevel@tonic-gate#    define MAXPATHLEN PATHSIZE
17517c478bdstevel@tonic-gate#   endif /* ! MAXPATHLEN */
17527c478bdstevel@tonic-gate#   ifndef _PATH_UNIX
17537c478bdstevel@tonic-gate#    ifdef UNICOSMK
17547c478bdstevel@tonic-gate#     define _PATH_UNIX		"/unicosmk.ar"
17557c478bdstevel@tonic-gate#    else
17567c478bdstevel@tonic-gate#     define _PATH_UNIX		"/unicos"
17577c478bdstevel@tonic-gate#    endif /* UNICOSMK */
17587c478bdstevel@tonic-gate#   endif /* ! _PATH_UNIX */
17597c478bdstevel@tonic-gate#   ifndef _PATH_VENDOR_CF
17607c478bdstevel@tonic-gate#    define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
17617c478bdstevel@tonic-gate#   endif /* ! _PATH_VENDOR_CF */
17627c478bdstevel@tonic-gate#  endif /* UNICOS */
17637c478bdstevel@tonic-gate#  ifdef _UNICOSMP
17647c478bdstevel@tonic-gate#  if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
17657c478bdstevel@tonic-gate    /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */
17667c478bdstevel@tonic-gate#   define _SC_NPROCESSORS_ONLN  _SC_NPROC_ONLN
17677c478bdstevel@tonic-gate#  endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */
17687c478bdstevel@tonic-gate#   define HASGETUSERSHELL 0		/* does not have getusershell(3) call */
17697c478bdstevel@tonic-gate#   define HASSETRLIMIT	   1		/* has setrlimit(2) syscall */
17707c478bdstevel@tonic-gate#   define LA_TYPE	LA_IRIX6	/* figure out at run time */
17717c478bdstevel@tonic-gate#   include <sys/cdefs.h>
17727c478bdstevel@tonic-gate#   include <paths.h>
17737c478bdstevel@tonic-gate#   define ARGV_T char *const *
17747c478bdstevel@tonic-gate#  endif /* _UNICOSMP */
17757c478bdstevel@tonic-gate# endif /* _CRAY */
17767c478bdstevel@tonic-gate
17777c478bdstevel@tonic-gate/*
17787c478bdstevel@tonic-gate**  Apollo DomainOS
17797c478bdstevel@tonic-gate**
17807c478bdstevel@tonic-gate**  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
17817c478bdstevel@tonic-gate**
17827c478bdstevel@tonic-gate**  15 Jan 1994; updated 2 Aug 1995
17837c478bdstevel@tonic-gate**
17847c478bdstevel@tonic-gate*/
17857c478bdstevel@tonic-gate
17867c478bdstevel@tonic-gate# ifdef apollo
17877c478bdstevel@tonic-gate#  define HASSETREUID	1	/* has setreuid(2) call */
17887c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(2) call */
17897c478bdstevel@tonic-gate#  define IP_SRCROUTE	0	/* does not have <netinet/ip_var.h> */
17907c478bdstevel@tonic-gate#  define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
17917c478bdstevel@tonic-gate#  define LA_TYPE	LA_SUBR		/* use getloadavg.c */
17927c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
17937c478bdstevel@tonic-gate#  define SFS_BAVAIL	f_bfree		/* alternate field name */
17947c478bdstevel@tonic-gate#  define TZ_TYPE	TZ_TZNAME
17957c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
17967c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
17977c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
17987c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
17997c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
18007c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
18017c478bdstevel@tonic-gate#  undef	 S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
18027c478bdstevel@tonic-gate#  undef	 S_IFIFO
18037c478bdstevel@tonic-gate#  define S_IFIFO	0010000
18047c478bdstevel@tonic-gate#  ifndef IDENTPROTO
18057c478bdstevel@tonic-gate#   define IDENTPROTO	0	/* TCP/IP implementation is broken */
18067c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
18077c478bdstevel@tonic-gate#  define RLIMIT_NEEDS_SYS_TIME_H	1
18087c478bdstevel@tonic-gate#  if defined(NGROUPS_MAX) && !NGROUPS_MAX
18097c478bdstevel@tonic-gate#   undef NGROUPS_MAX
18107c478bdstevel@tonic-gate#  endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */
18117c478bdstevel@tonic-gate# endif /* apollo */
18127c478bdstevel@tonic-gate
18137c478bdstevel@tonic-gate/*
18147c478bdstevel@tonic-gate**  MPE-iX
18157c478bdstevel@tonic-gate**
18167c478bdstevel@tonic-gate**	Requires MPE 6.0 or greater.  See sendmail/README for more info.
18177c478bdstevel@tonic-gate**
18187c478bdstevel@tonic-gate**	From Mark Bixby <mark_bixby@hp.com> or <mark@bixby.org>.
18197c478bdstevel@tonic-gate*/
18207c478bdstevel@tonic-gate
18217c478bdstevel@tonic-gate# ifdef MPE
18227c478bdstevel@tonic-gate
18237c478bdstevel@tonic-gate#  include <sys/sysmacros.h>
18247c478bdstevel@tonic-gate#  include <fcntl.h>
18257c478bdstevel@tonic-gate
18267c478bdstevel@tonic-gate/* Sendmail stuff */
18277c478bdstevel@tonic-gate#  define HASFCHOWN		0	/* lacks fchown() */
18287c478bdstevel@tonic-gate#  define HASGETUSERSHELL	0	/* lacks getusershell() */
18297c478bdstevel@tonic-gate#  ifdef HASNICE
18307c478bdstevel@tonic-gate#   undef  HASNICE
18317c478bdstevel@tonic-gate#  endif /* HASNICE */
18327c478bdstevel@tonic-gate#  define HASNICE		0	/* lacks nice() */
18337c478bdstevel@tonic-gate#  define HASRANDOM		0	/* lacks random() */
18347c478bdstevel@tonic-gate#  ifdef HASRRESVPORT
18357c478bdstevel@tonic-gate#   undef HASRRESVPORT
18367c478bdstevel@tonic-gate#  endif /* HASRRESVPORT */
18377c478bdstevel@tonic-gate#  define HASRRESVPORT		0	/* lacks rresvport() */
18387c478bdstevel@tonic-gate#  define IP_SRCROUTE		0	/* lacks IP source routing fields */
18397c478bdstevel@tonic-gate#  ifdef MATCHGECOS
18407c478bdstevel@tonic-gate#   undef MATCHGECOS
18417c478bdstevel@tonic-gate#  endif /* MATCHGECOS */
18427c478bdstevel@tonic-gate#  define MATCHGECOS		0	/* lacks an initialized GECOS field */
18437c478bdstevel@tonic-gate#  define NEEDFSYNC		1	/* use sendmail's fsync() */
18447c478bdstevel@tonic-gate#  define NEEDLINK		1	/* use sendmail's link() */
18457c478bdstevel@tonic-gate#  define NOFTRUNCATE		1	/* lacks ftruncate() */
18467c478bdstevel@tonic-gate#  define SFS_TYPE		SFS_NONE /* can't determine disk space */
18477c478bdstevel@tonic-gate#  define SM_CONF_SYSLOG	0	/* use sendmail decl of syslog() */
18487c478bdstevel@tonic-gate#  define USE_DOUBLE_FORK	0	/* don't fork an intermediate zombie */
18497c478bdstevel@tonic-gate#  define USE_ENVIRON		1	/* use environ instead of envp */
18507c478bdstevel@tonic-gate
18517c478bdstevel@tonic-gate/* Missing header stuff */
18527c478bdstevel@tonic-gate#  define AF_UNSPEC		0
18537c478bdstevel@tonic-gate#  define AF_MAX		AF_INET
18547c478bdstevel@tonic-gate#  define IFF_LOOPBACK		0x8
18557c478bdstevel@tonic-gate#  define IN_LOOPBACKNET	127
18567c478bdstevel@tonic-gate#  define MAXNAMLEN		NAME_MAX
18577c478bdstevel@tonic-gate#  define S_IEXEC		S_IXUSR
18587c478bdstevel@tonic-gate#  define S_IREAD		S_IRUSR
18597c478bdstevel@tonic-gate#  define S_IWRITE		S_IWUSR
18607c478bdstevel@tonic-gate
18617c478bdstevel@tonic-gate/* Present header stuff that needs to be missing */
18627c478bdstevel@tonic-gate#  undef NGROUPS_MAX
18637c478bdstevel@tonic-gate
18647c478bdstevel@tonic-gate/* Shadow functions */
18657c478bdstevel@tonic-gate#  define bind		sendmail_mpe_bind
18667c478bdstevel@tonic-gate#  define _exit		sendmail_mpe__exit
18677c478bdstevel@tonic-gate#  define exit		sendmail_mpe_exit
18687c478bdstevel@tonic-gate#  define fcntl		sendmail_mpe_fcntl
18697c478bdstevel@tonic-gate#  define getegid	sendmail_mpe_getegid
18707c478bdstevel@tonic-gate#  define geteuid	sendmail_mpe_geteuid
18717c478bdstevel@tonic-gate#  define getpwnam	sendmail_mpe_getpwnam
18727c478bdstevel@tonic-gate#  define getpwuid	sendmail_mpe_getpwuid
18737c478bdstevel@tonic-gate#  define setgid	sendmail_mpe_setgid
18747c478bdstevel@tonic-gate#  define setuid	sendmail_mpe_setuid
18757c478bdstevel@tonic-gateextern int		sendmail_mpe_fcntl __P((int, int, ...));
18767c478bdstevel@tonic-gateextern struct passwd *	sendmail_mpe_getpwnam __P((const char *));
18777c478bdstevel@tonic-gateextern struct passwd *	sendmail_mpe_getpwuid __P((uid_t));
18787c478bdstevel@tonic-gate# endif /* MPE */
18797c478bdstevel@tonic-gate
18807c478bdstevel@tonic-gate/*
18817c478bdstevel@tonic-gate**  System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native)
18827c478bdstevel@tonic-gate**
18837c478bdstevel@tonic-gate**	Contributed by Paul Gampe <paulg@apnic.net>
18847c478bdstevel@tonic-gate*/
18857c478bdstevel@tonic-gate
18867c478bdstevel@tonic-gate# ifdef __svr5__
18877c478bdstevel@tonic-gate#  include <sys/mkdev.h>
18887c478bdstevel@tonic-gate#  define __svr4__
18897c478bdstevel@tonic-gate#  define SYS5SIGNALS		1
18907c478bdstevel@tonic-gate#  define HASFCHOWN		1	/* has fchown(2) call */
18917c478bdstevel@tonic-gate#  define HASSETSID	1	/* has POSIX setsid(2) call */
18927c478bdstevel@tonic-gate#  define HASSETREUID		1
18937c478bdstevel@tonic-gate#  define HASWAITPID		1
18947c478bdstevel@tonic-gate#  define HASGETDTABLESIZE	1
18957c478bdstevel@tonic-gate#  define GIDSET_T		gid_t
18967c478bdstevel@tonic-gate#  define SOCKADDR_LEN_T	size_t
18977c478bdstevel@tonic-gate#  define SOCKOPT_LEN_T		size_t
18987c478bdstevel@tonic-gate#  ifndef _PATH_UNIX
18997c478bdstevel@tonic-gate#   define _PATH_UNIX		"/stand/unix"
19007c478bdstevel@tonic-gate#  endif /* ! _PATH_UNIX */
19017c478bdstevel@tonic-gate#  define SPT_PADCHAR		'\0'	/* pad process title with nulls */
19027c478bdstevel@tonic-gate#  ifndef SYSLOG_BUFSIZE
19037c478bdstevel@tonic-gate#   define SYSLOG_BUFSIZE	1024	/* unsure */
19047c478bdstevel@tonic-gate#  endif /* ! SYSLOG_BUFSIZE */
19057c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
19067c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/etc/sendmail.cf"
19077c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
19087c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
19097c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
19107c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
19117c478bdstevel@tonic-gate#  undef offsetof		/* avoid stddefs.h, sys/sysmacros.h conflict */
19127c478bdstevel@tonic-gate#if !defined(SM_SET_H_ERRNO) && defined(_REENTRANT)
19137c478bdstevel@tonic-gate# define SM_SET_H_ERRNO(err)	set_h_errno((err))
19147c478bdstevel@tonic-gate#endif /* ! SM_SET_H_ERRNO && _REENTRANT */
19157c478bdstevel@tonic-gate# endif /* __svr5__ */
19167c478bdstevel@tonic-gate
19177c478bdstevel@tonic-gate/* ###################################################################### */
19187c478bdstevel@tonic-gate
19197c478bdstevel@tonic-gate/*
19207c478bdstevel@tonic-gate**  UnixWare 2.x
19217c478bdstevel@tonic-gate*/
19227c478bdstevel@tonic-gate
19237c478bdstevel@tonic-gate# ifdef UNIXWARE2
19247c478bdstevel@tonic-gate#  define UNIXWARE	1
19257c478bdstevel@tonic-gate#  undef offsetof		/* avoid stddefs.h, sys/sysmacros.h conflict */
19267c478bdstevel@tonic-gate# endif /* UNIXWARE2 */
19277c478bdstevel@tonic-gate
19287c478bdstevel@tonic-gate
19297c478bdstevel@tonic-gate/*
19307c478bdstevel@tonic-gate**  UnixWare 1.1.2.
19317c478bdstevel@tonic-gate**
19327c478bdstevel@tonic-gate**	Updated by Petr Lampa <lampa@fee.vutbr.cz>.
19337c478bdstevel@tonic-gate**	From Evan Champion <evanc@spatial.synapse.org>.
19347c478bdstevel@tonic-gate*/
19357c478bdstevel@tonic-gate
19367c478bdstevel@tonic-gate# ifdef UNIXWARE
19377c478bdstevel@tonic-gate#  include <sys/mkdev.h>
19387c478bdstevel@tonic-gate#  define SYSTEM5		1
19397c478bdstevel@tonic-gate#  define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
19407c478bdstevel@tonic-gate#  define HASSETREUID		1
19417c478bdstevel@tonic-gate#  define HASSETSID	1	/* has POSIX setsid(2) call */
19427c478bdstevel@tonic-gate#  define HASINITGROUPS		1
19437c478bdstevel@tonic-gate#  define GIDSET_T		gid_t
19447c478bdstevel@tonic-gate#  define SLEEP_T		unsigned
19457c478bdstevel@tonic-gate#  define SFS_TYPE		SFS_STATVFS
19467c478bdstevel@tonic-gate#  define LA_TYPE		LA_ZERO
19477c478bdstevel@tonic-gate#  undef WIFEXITED
19487c478bdstevel@tonic-gate#  undef WEXITSTATUS
19497c478bdstevel@tonic-gate#  ifndef _PATH_UNIX
19507c478bdstevel@tonic-gate#   define _PATH_UNIX		"/unix"
19517c478bdstevel@tonic-gate#  endif /* ! _PATH_UNIX */
19527c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
19537c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
19547c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
19557c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
19567c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
19577c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
19587c478bdstevel@tonic-gate#  define SYSLOG_BUFSIZE	128
19597c478bdstevel@tonic-gate# endif /* UNIXWARE */
19607c478bdstevel@tonic-gate
19617c478bdstevel@tonic-gate
19627c478bdstevel@tonic-gate/*
19637c478bdstevel@tonic-gate**  Intergraph CLIX 3.1
19647c478bdstevel@tonic-gate**
19657c478bdstevel@tonic-gate**	From Paul Southworth <pauls@locust.cic.net>
19667c478bdstevel@tonic-gate*/
19677c478bdstevel@tonic-gate
19687c478bdstevel@tonic-gate# ifdef CLIX
19697c478bdstevel@tonic-gate#  define SYSTEM5	1	/* looks like System V */
19707c478bdstevel@tonic-gate#  ifndef HASGETUSERSHELL
19717c478bdstevel@tonic-gate#   define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
19727c478bdstevel@tonic-gate#  endif /* ! HASGETUSERSHELL */
19737c478bdstevel@tonic-gate#  define DEV_BSIZE	512	/* device block size not defined */
19747c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
19757c478bdstevel@tonic-gate#  undef LOG			/* syslog not available */
19767c478bdstevel@tonic-gate#  define NEEDFSYNC	1	/* no fsync in system library */
19777c478bdstevel@tonic-gate#  define GETSHORT	_getshort
19787c478bdstevel@tonic-gate# endif /* CLIX */
19797c478bdstevel@tonic-gate
19807c478bdstevel@tonic-gate
19817c478bdstevel@tonic-gate/*
19827c478bdstevel@tonic-gate**  NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP
19837c478bdstevel@tonic-gate**
19847c478bdstevel@tonic-gate**	From Kevin Darcy <kevin@tech.mis.cfc.com>.
19857c478bdstevel@tonic-gate*/
19867c478bdstevel@tonic-gate
19877c478bdstevel@tonic-gate# ifdef NCR_MP_RAS2
19887c478bdstevel@tonic-gate#  include <sys/sockio.h>
19897c478bdstevel@tonic-gate#  define __svr4__
19907c478bdstevel@tonic-gate#  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
19917c478bdstevel@tonic-gate#  define SYSLOG_BUFSIZE	1024
19927c478bdstevel@tonic-gate#  define SPT_TYPE  SPT_NONE
19937c478bdstevel@tonic-gate# endif /* NCR_MP_RAS2 */
19947c478bdstevel@tonic-gate
19957c478bdstevel@tonic-gate
19967c478bdstevel@tonic-gate/*
19977c478bdstevel@tonic-gate**  NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP
19987c478bdstevel@tonic-gate**
19997c478bdstevel@tonic-gate**	From Tom Moore <Tom.Moore@DaytonOH.NCR.COM>
20007c478bdstevel@tonic-gate*/
20017c478bdstevel@tonic-gate
20027c478bdstevel@tonic-gate# ifdef NCR_MP_RAS3
20037c478bdstevel@tonic-gate#  define __svr4__
20047c478bdstevel@tonic-gate#  define HASFCHOWN		1	/* has fchown(2) call */
20057c478bdstevel@tonic-gate#  define LDA_USE_LOCKF		1
20067c478bdstevel@tonic-gate#  define SIOCGIFNUM_IS_BROKEN	1	/* SIOCGIFNUM has non-std interface */
20077c478bdstevel@tonic-gate#  define SO_REUSEADDR_IS_BROKEN	1	/* doesn't work if accept() fails */
20087c478bdstevel@tonic-gate#  define SYSLOG_BUFSIZE	1024
20097c478bdstevel@tonic-gate#  define SPT_TYPE	SPT_NONE
20107c478bdstevel@tonic-gate#  define _PATH_MAILDIR	"/var/mail"
20117c478bdstevel@tonic-gate#  ifndef _XOPEN_SOURCE
20127c478bdstevel@tonic-gate#   define _XOPEN_SOURCE
20137c478bdstevel@tonic-gate#   define _XOPEN_SOURCE_EXTENDED 1
20147c478bdstevel@tonic-gate#   include <sys/resource.h>
20157c478bdstevel@tonic-gate#   undef _XOPEN_SOURCE
20167c478bdstevel@tonic-gate#   undef _XOPEN_SOURCE_EXTENDED
20177c478bdstevel@tonic-gate#  endif /* ! _XOPEN_SOURCE */
20187c478bdstevel@tonic-gate# endif /* NCR_MP_RAS3 */
20197c478bdstevel@tonic-gate
20207c478bdstevel@tonic-gate
20217c478bdstevel@tonic-gate/*
20227c478bdstevel@tonic-gate**  Tandem NonStop-UX SVR4
20237c478bdstevel@tonic-gate**
20247c478bdstevel@tonic-gate**	From Rick McCarty <mccarty@mpd.tandem.com>.
20257c478bdstevel@tonic-gate*/
20267c478bdstevel@tonic-gate
20277c478bdstevel@tonic-gate# ifdef NonStop_UX_BXX
20287c478bdstevel@tonic-gate#  define __svr4__
20297c478bdstevel@tonic-gate# endif /* NonStop_UX_BXX */
20307c478bdstevel@tonic-gate
20317c478bdstevel@tonic-gate
20327c478bdstevel@tonic-gate/*
20337c478bdstevel@tonic-gate**  Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2.
20347c478bdstevel@tonic-gate**
20357c478bdstevel@tonic-gate**	Tested for 1.04, 1.03
20367c478bdstevel@tonic-gate**	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
20377c478bdstevel@tonic-gate**
20387c478bdstevel@tonic-gate**	Tested for 4.02, 6.10 and 7.10
20397c478bdstevel@tonic-gate**	From Motonori NAKAMURA <motonori@media.kyoto-u.ac.jp>.
20407c478bdstevel@tonic-gate*/
20417c478bdstevel@tonic-gate
20427c478bdstevel@tonic-gate# if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE))
20437c478bdstevel@tonic-gate#  define SYSTEM5	1	/* include all the System V defines */
20447c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
20457c478bdstevel@tonic-gate#  define HASFCHMOD	1	/* has fchmod(2) syscall */
20467c478bdstevel@tonic-gate#  define setreuid(r, e)	setresuid(r, e, -1)
20477c478bdstevel@tonic-gate#  define LA_TYPE	LA_FLOAT
20487c478bdstevel@tonic-gate#  define SPT_TYPE	SPT_PSTAT
20497c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
20507c478bdstevel@tonic-gate#  ifndef HASSETVBUF
20517c478bdstevel@tonic-gate#   define HASSETVBUF	/* HI-UX has no setlinebuf */
20527c478bdstevel@tonic-gate#  endif /* ! HASSETVBUF */
20537c478bdstevel@tonic-gate#  ifndef GIDSET_T
20547c478bdstevel@tonic-gate#   define GIDSET_T	gid_t
20557c478bdstevel@tonic-gate#  endif /* ! GIDSET_T */
20567c478bdstevel@tonic-gate#  ifndef _PATH_UNIX
20577c478bdstevel@tonic-gate#   define _PATH_UNIX		"/HI-UX"
20587c478bdstevel@tonic-gate#  endif /* ! _PATH_UNIX */
20597c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
20607c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
20617c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
20627c478bdstevel@tonic-gate#  ifndef IDENTPROTO
20637c478bdstevel@tonic-gate#   define IDENTPROTO	0	/* TCP/IP implementation is broken */
20647c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
20657c478bdstevel@tonic-gate#  ifndef HASGETUSERSHELL
20667c478bdstevel@tonic-gate#   define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
20677c478bdstevel@tonic-gate#  endif /* ! HASGETUSERSHELL */
20687c478bdstevel@tonic-gate#  define FDSET_CAST	(int *)	/* cast for fd_set parameters to select */
20697c478bdstevel@tonic-gate
20707c478bdstevel@tonic-gate/*
20717c478bdstevel@tonic-gate**  avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h
20727c478bdstevel@tonic-gate**  on HIUX 3050
20737c478bdstevel@tonic-gate*/
20747c478bdstevel@tonic-gate#  undef m_flags
20757c478bdstevel@tonic-gate
20767c478bdstevel@tonic-gate#  define SM_CONF_SYSLOG	0
20777c478bdstevel@tonic-gate
20787c478bdstevel@tonic-gate# endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */
20797c478bdstevel@tonic-gate
20807c478bdstevel@tonic-gate
20817c478bdstevel@tonic-gate/*
20827c478bdstevel@tonic-gate**  Amdahl UTS System V 2.1.5 (SVr3-based)
20837c478bdstevel@tonic-gate**
20847c478bdstevel@tonic-gate**    From: Janet Jackson <janet@dialix.oz.au>.
20857c478bdstevel@tonic-gate*/
20867c478bdstevel@tonic-gate
20877c478bdstevel@tonic-gate# ifdef _UTS
20887c478bdstevel@tonic-gate#  include <sys/sysmacros.h>
20897c478bdstevel@tonic-gate#  undef HASLSTAT		/* has symlinks, but they cause problems */
20907c478bdstevel@tonic-gate#  define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
20917c478bdstevel@tonic-gate#  define SYS5SIGNALS	1	/* System V signal semantics */
20927c478bdstevel@tonic-gate#  define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
20937c478bdstevel@tonic-gate#  define HASUNAME	1	/* use System V uname(2) system call */
20947c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) function */
20957c478bdstevel@tonic-gate#  define HASSETVBUF	1	/* has setvbuf(3) function */
20967c478bdstevel@tonic-gate#  ifndef HASGETUSERSHELL
20977c478bdstevel@tonic-gate#   define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
20987c478bdstevel@tonic-gate#  endif /* ! HASGETUSERSHELL */
20997c478bdstevel@tonic-gate#  define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
21007c478bdstevel@tonic-gate#  define LA_TYPE	LA_ZERO		/* doesn't have load average */
21017c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
21027c478bdstevel@tonic-gate#  define SFS_BAVAIL	f_bfree		/* alternate field name */
21037c478bdstevel@tonic-gate#  define _PATH_UNIX		"/unix"
21047c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
21057c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
21067c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
21077c478bdstevel@tonic-gate# endif /* _UTS */
21087c478bdstevel@tonic-gate
21097c478bdstevel@tonic-gate/*
21107c478bdstevel@tonic-gate**  Cray Computer Corporation's CSOS
21117c478bdstevel@tonic-gate**
21127c478bdstevel@tonic-gate**	From Scott Bolte <scott@craycos.com>.
21137c478bdstevel@tonic-gate*/
21147c478bdstevel@tonic-gate
21157c478bdstevel@tonic-gate# ifdef _CRAYCOM
21167c478bdstevel@tonic-gate#  define SYSTEM5	1	/* include all the System V defines */
21177c478bdstevel@tonic-gate#  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
21187c478bdstevel@tonic-gate#  define NEEDFSYNC	1	/* no fsync in system library */
21197c478bdstevel@tonic-gate#  define MAXPATHLEN	PATHSIZE
21207c478bdstevel@tonic-gate#  define LA_TYPE	LA_ZERO
21217c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
21227c478bdstevel@tonic-gate#  define SFS_BAVAIL	f_bfree		/* alternate field name */
21237c478bdstevel@tonic-gate#  define _POSIX_CHOWN_RESTRICTED	-1
21247c478bdstevel@tonic-gateextern struct group	*getgrent(), *getgrnam(), *getgrgid();
21257c478bdstevel@tonic-gate# endif /* _CRAYCOM */
21267c478bdstevel@tonic-gate
21277c478bdstevel@tonic-gate
21287c478bdstevel@tonic-gate/*
21297c478bdstevel@tonic-gate**  Sony NEWS-OS 4.2.1R and 6.0.3
21307c478bdstevel@tonic-gate**
21317c478bdstevel@tonic-gate**	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
21327c478bdstevel@tonic-gate*/
21337c478bdstevel@tonic-gate
21347c478bdstevel@tonic-gate# ifdef sony_news
21357c478bdstevel@tonic-gate#  ifndef __svr4
21367c478bdstevel@tonic-gate			/* NEWS-OS 4.2.1R */
21377c478bdstevel@tonic-gate#   ifndef BSD
21387c478bdstevel@tonic-gate#    define BSD			/* has BSD routines */
21397c478bdstevel@tonic-gate#   endif /* ! BSD */
21407c478bdstevel@tonic-gate#   define HASUNSETENV	1	/* has unsetenv(2) call */
21417c478bdstevel@tonic-gate#   undef HASSETVBUF		/* don't actually have setvbuf(3) */
21427c478bdstevel@tonic-gate#   define WAITUNION	1	/* use "union wait" as wait argument type */
21437c478bdstevel@tonic-gate#   define LA_TYPE	LA_INT
21447c478bdstevel@tonic-gate#   define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
21457c478bdstevel@tonic-gate#   ifndef HASFLOCK
21467c478bdstevel@tonic-gate#    define HASFLOCK	1	/* has flock(2) call */
21477c478bdstevel@tonic-gate#   endif /* ! HASFLOCK */
21487c478bdstevel@tonic-gate#   define setpgid	setpgrp
21497c478bdstevel@tonic-gate#   undef WIFEXITED
21507c478bdstevel@tonic-gate#   undef WEXITSTATUS
21517c478bdstevel@tonic-gate#   define MODE_T	int	/* system include files have no mode_t */
21527c478bdstevel@tonic-gatetypedef int		pid_t;
21537c478bdstevel@tonic-gatetypedef int		(*sigfunc_t)();
21547c478bdstevel@tonic-gate#   define SIGFUNC_DEFINED
21557c478bdstevel@tonic-gate#   define SIGFUNC_RETURN	(0)
21567c478bdstevel@tonic-gate#   define SIGFUNC_DECL		int
21577c478bdstevel@tonic-gate
21587c478bdstevel@tonic-gate#  else /* ! __svr4 */
21597c478bdstevel@tonic-gate			/* NEWS-OS 6.0.3 with /bin/cc */
21607c478bdstevel@tonic-gate#   ifndef __svr4__
21617c478bdstevel@tonic-gate#    define __svr4__		/* use all System V Release 4 defines below */
21627c478bdstevel@tonic-gate#   endif /* ! __svr4__ */
21637c478bdstevel@tonic-gate#   define HASSETSID	1	/* has POSIX setsid(2) call */
21647c478bdstevel@tonic-gate#   define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
21657c478bdstevel@tonic-gate#   define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
21667c478bdstevel@tonic-gate#   ifndef SPT_TYPE
21677c478bdstevel@tonic-gate#    define SPT_TYPE	SPT_SYSMIPS	/* use sysmips() (OS 6.0.2 or later) */
21687c478bdstevel@tonic-gate#   endif /* ! SPT_TYPE */
21697c478bdstevel@tonic-gate#   define GIDSET_T	gid_t
21707c478bdstevel@tonic-gate#   undef WIFEXITED
21717c478bdstevel@tonic-gate#   undef WEXITSTATUS
21727c478bdstevel@tonic-gate#   ifndef SYSLOG_BUFSIZE
21737c478bdstevel@tonic-gate#    define SYSLOG_BUFSIZE	256
21747c478bdstevel@tonic-gate#   endif /* ! SYSLOG_BUFSIZE */
21757c478bdstevel@tonic-gate#   define _PATH_UNIX		"/stand/unix"
21767c478bdstevel@tonic-gate#   ifndef _PATH_VENDOR_CF
21777c478bdstevel@tonic-gate#    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
21787c478bdstevel@tonic-gate#   endif /* ! _PATH_VENDOR_CF */
21797c478bdstevel@tonic-gate#   ifndef _PATH_SENDMAILPID
21807c478bdstevel@tonic-gate#    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
21817c478bdstevel@tonic-gate#   endif /* ! _PATH_SENDMAILPID */
21827c478bdstevel@tonic-gate
21837c478bdstevel@tonic-gate#  endif /* ! __svr4 */
21847c478bdstevel@tonic-gate# endif /* sony_news */
21857c478bdstevel@tonic-gate
21867c478bdstevel@tonic-gate
21877c478bdstevel@tonic-gate/*
21887c478bdstevel@tonic-gate**  Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
21897c478bdstevel@tonic-gate**
21907c478bdstevel@tonic-gate**	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
21917c478bdstevel@tonic-gate*/
21927c478bdstevel@tonic-gate
21937c478bdstevel@tonic-gate# ifdef luna
21947c478bdstevel@tonic-gate#  ifndef IDENTPROTO
21957c478bdstevel@tonic-gate#   define IDENTPROTO	0	/* TCP/IP implementation is broken */
21967c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
21977c478bdstevel@tonic-gate#  define HASUNSETENV	1	/* has unsetenv(2) call */
21987c478bdstevel@tonic-gate#  define NEEDPUTENV	1	/* need putenv(3) call */
21997c478bdstevel@tonic-gate#  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
22007c478bdstevel@tonic-gate#  define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
22017c478bdstevel@tonic-gate#  define WAITUNION	1	/* use "union wait" as wait argument type */
22027c478bdstevel@tonic-gate#  ifdef uniosb
22037c478bdstevel@tonic-gate#   include <sys/time.h>
22047c478bdstevel@tonic-gate#   define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
22057c478bdstevel@tonic-gate#   define LA_TYPE	LA_INT
22067c478bdstevel@tonic-gate#   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
22077c478bdstevel@tonic-gate#  endif /* uniosb */
22087c478bdstevel@tonic-gate#  ifdef luna2
22097c478bdstevel@tonic-gate#   define LA_TYPE	LA_SUBR
22107c478bdstevel@tonic-gate#   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
22117c478bdstevel@tonic-gate#  endif /* luna2 */
22127c478bdstevel@tonic-gate#  ifdef luna88k
22137c478bdstevel@tonic-gate#   define LA_TYPE	LA_INT
22147c478bdstevel@tonic-gate#  endif /* luna88k */
22157c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
22167c478bdstevel@tonic-gate#  define setpgid	setpgrp
22177c478bdstevel@tonic-gate#  undef WIFEXITED
22187c478bdstevel@tonic-gate#  undef WEXITSTATUS
22197c478bdstevel@tonic-gatetypedef int		pid_t;
22207c478bdstevel@tonic-gatetypedef int		(*sigfunc_t)();
22217c478bdstevel@tonic-gate#  define SIGFUNC_DEFINED
22227c478bdstevel@tonic-gate#  define SIGFUNC_RETURN	(0)
22237c478bdstevel@tonic-gate#  define SIGFUNC_DECL	int
22247c478bdstevel@tonic-gateextern char	*getenv();
22257c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
22267c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
22277c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
22287c478bdstevel@tonic-gate# endif /* luna */
22297c478bdstevel@tonic-gate
22307c478bdstevel@tonic-gate
22317c478bdstevel@tonic-gate/*
22327c478bdstevel@tonic-gate**  NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
22337c478bdstevel@tonic-gate**
22347c478bdstevel@tonic-gate**	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
22357c478bdstevel@tonic-gate*/
22367c478bdstevel@tonic-gate
22377c478bdstevel@tonic-gate# if defined(nec_ews_svr4) || defined(_nec_ews_svr4)
22387c478bdstevel@tonic-gate#  ifndef __svr4__
22397c478bdstevel@tonic-gate#   define __svr4__		/* use all System V Release 4 defines below */
22407c478bdstevel@tonic-gate#  endif /* ! __svr4__ */
22417c478bdstevel@tonic-gate#  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
22427c478bdstevel@tonic-gate#  define HASSETSID	1	/* has POSIX setsid(2) call */
22437c478bdstevel@tonic-gate#  define LA_TYPE	LA_READKSYM	/* use MIOC_READSYM ioctl */
22447c478bdstevel@tonic-gate#  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
22457c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
22467c478bdstevel@tonic-gate#  undef WIFEXITED
22477c478bdstevel@tonic-gate#  undef WEXITSTATUS
22487c478bdstevel@tonic-gate#  define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
22497c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
22507c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
22517c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
22527c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
22537c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
22547c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
22557c478bdstevel@tonic-gate#  ifndef SYSLOG_BUFSIZE
22567c478bdstevel@tonic-gate#   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
22577c478bdstevel@tonic-gate#  endif /* ! SYSLOG_BUFSIZE */
22587c478bdstevel@tonic-gate# endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */
22597c478bdstevel@tonic-gate
22607c478bdstevel@tonic-gate
22617c478bdstevel@tonic-gate/*
22627c478bdstevel@tonic-gate**  Fujitsu/ICL UXP/DS (For the DS/90 Series)
22637c478bdstevel@tonic-gate**
22647c478bdstevel@tonic-gate**	From Diego R. Lopez <drlopez@cica.es>.
22657c478bdstevel@tonic-gate**	Additional changes from Fumio Moriya and Toshiaki Nomura of the
22667c478bdstevel@tonic-gate**		Fujitsu Fresoftware group <dsfrsoft@oai6.yk.fujitsu.co.jp>.
22677c478bdstevel@tonic-gate*/
22687c478bdstevel@tonic-gate
22697c478bdstevel@tonic-gate# ifdef __uxp__
22707c478bdstevel@tonic-gate#  include <arpa/nameser.h>
22717c478bdstevel@tonic-gate#  include <sys/sysmacros.h>
22727c478bdstevel@tonic-gate#  include <sys/mkdev.h>
22737c478bdstevel@tonic-gate#  define __svr4__
22747c478bdstevel@tonic-gate#  define HASGETUSERSHELL	0
22757c478bdstevel@tonic-gate#  define HASFLOCK		0
22767c478bdstevel@tonic-gate#  define _PATH_UNIX		"/stand/unix"
22777c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
22787c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
22797c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
22807c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
22817c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
22827c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
22837c478bdstevel@tonic-gate# endif /* __uxp__ */
22847c478bdstevel@tonic-gate
22857c478bdstevel@tonic-gate/*
22867c478bdstevel@tonic-gate**  Pyramid DC/OSx
22877c478bdstevel@tonic-gate**
22887c478bdstevel@tonic-gate**	From Earle Ake <akee@wpdiss1.wpafb.af.mil>.
22897c478bdstevel@tonic-gate*/
22907c478bdstevel@tonic-gate
22917c478bdstevel@tonic-gate# ifdef DCOSx
22927c478bdstevel@tonic-gate#  define GIDSET_T	gid_t
22937c478bdstevel@tonic-gate#  ifndef IDENTPROTO
22947c478bdstevel@tonic-gate#   define IDENTPROTO	0	/* TCP/IP implementation is broken */
22957c478bdstevel@tonic-gate#  endif /* ! IDENTPROTO */
22967c478bdstevel@tonic-gate# endif /* DCOSx */
22977c478bdstevel@tonic-gate
22987c478bdstevel@tonic-gate/*
22997c478bdstevel@tonic-gate**  Concurrent Computer Corporation Maxion
23007c478bdstevel@tonic-gate**
23017c478bdstevel@tonic-gate**	From Donald R. Laster Jr. <laster@access.digex.net>.
23027c478bdstevel@tonic-gate*/
23037c478bdstevel@tonic-gate
23047c478bdstevel@tonic-gate# ifdef __MAXION__
23057c478bdstevel@tonic-gate
23067c478bdstevel@tonic-gate#  include <sys/stream.h>
23077c478bdstevel@tonic-gate#  define __svr4__		1	/* SVR4.2MP */
23087c478bdstevel@tonic-gate#  define HASSETREUID		1	/* have setreuid(2) */
23097c478bdstevel@tonic-gate#  define HASLSTAT		1	/* have lstat(2) */
23107c478bdstevel@tonic-gate#  define HASSETRLIMIT		1	/* have setrlimit(2) */
23117c478bdstevel@tonic-gate#  define HASGETDTABLESIZE	1	/* have getdtablesize(2) */
23127c478bdstevel@tonic-gate#  define HASGETUSERSHELL	1	/* have getusershell(3) */
23137c478bdstevel@tonic-gate#  define NOFTRUNCATE		1	/* do not have ftruncate(2) */
23147c478bdstevel@tonic-gate#  define SLEEP_T		unsigned
23157c478bdstevel@tonic-gate#  define SFS_TYPE		SFS_STATVFS
23167c478bdstevel@tonic-gate#  define SFS_BAVAIL		f_bavail
23177c478bdstevel@tonic-gate#  ifndef SYSLOG_BUFSIZE
23187c478bdstevel@tonic-gate#   define SYSLOG_BUFSIZE	256	/* Use 256 bytes */
23197c478bdstevel@tonic-gate#  endif /* ! SYSLOG_BUFSIZE */
23207c478bdstevel@tonic-gate
23217c478bdstevel@tonic-gate#  undef WUNTRACED
23227c478bdstevel@tonic-gate#  undef WIFEXITED
23237c478bdstevel@tonic-gate#  undef WIFSIGNALED
23247c478bdstevel@tonic-gate#  undef WIFSTOPPED
23257c478bdstevel@tonic-gate#  undef WEXITSTATUS
23267c478bdstevel@tonic-gate#  undef WTERMSIG
23277c478bdstevel@tonic-gate#  undef WSTOPSIG
23287c478bdstevel@tonic-gate
23297c478bdstevel@tonic-gate# endif /* __MAXION__ */
23307c478bdstevel@tonic-gate
23317c478bdstevel@tonic-gate/*
23327c478bdstevel@tonic-gate**  Harris Nighthawk PowerUX (nh6000 box)
23337c478bdstevel@tonic-gate**
23347c478bdstevel@tonic-gate**  Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com>
23357c478bdstevel@tonic-gate*/
23367c478bdstevel@tonic-gate
23377c478bdstevel@tonic-gate# ifdef _PowerUX
23387c478bdstevel@tonic-gate#  ifndef __svr4__
23397c478bdstevel@tonic-gate#   define __svr4__
23407c478bdstevel@tonic-gate#  endif /* ! __svr4__ */
23417c478bdstevel@tonic-gate#  ifndef _PATH_VENDOR_CF
23427c478bdstevel@tonic-gate#   define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
23437c478bdstevel@tonic-gate#  endif /* ! _PATH_VENDOR_CF */
23447c478bdstevel@tonic-gate#  ifndef _PATH_SENDMAILPID
23457c478bdstevel@tonic-gate#   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
23467c478bdstevel@tonic-gate#  endif /* ! _PATH_SENDMAILPID */
23477c478bdstevel@tonic-gate#  define SYSLOG_BUFSIZE		1024
23487c478bdstevel@tonic-gate#  define LA_TYPE		LA_ZERO
23497c478bdstevel@tonic-gatetypedef struct msgb		mblk_t;
23507c478bdstevel@tonic-gate#  undef offsetof	/* avoid stddefs.h and sys/sysmacros.h conflict */
23517c478bdstevel@tonic-gate# endif /* _PowerUX */
23527c478bdstevel@tonic-gate
23537c478bdstevel@tonic-gate/*
23547c478bdstevel@tonic-gate**  Siemens Nixdorf Informationssysteme AG SINIX
23557c478bdstevel@tonic-gate**
23567c478bdstevel@tonic-gate**	Contributed by Gerald Rinske of Siemens Business Services VAS.
23577c478bdstevel@tonic-gate*/
23587c478bdstevel@tonic-gate# ifdef sinix
23597c478bdstevel@tonic-gate#  define HASRANDOM		0	/* has random(3) */
23607c478bdstevel@tonic-gate#  define SYSLOG_BUFSIZE	1024
23617c478bdstevel@tonic-gate#  define SM_INT32		int	/* 32bit integer */
23627c478bdstevel@tonic-gate# endif /* sinix */
23637c478bdstevel@tonic-gate
23647c478bdstevel@tonic-gate
23657c478bdstevel@tonic-gate/*
23667c478bdstevel@tonic-gate**  Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3
23677c478bdstevel@tonic-gate**
23687c478bdstevel@tonic-gate**	Contributed by Sergey Rusanov <rsm@utfoms.udmnet.ru>
23697c478bdstevel@tonic-gate*/
23707c478bdstevel@tonic-gate
23717c478bdstevel@tonic-gate# ifdef MOTO
23727c478bdstevel@tonic-gate#  define HASFCHMOD		1
23737c478bdstevel@tonic-gate#  define HASSETRLIMIT		0
23747c478bdstevel@tonic-gate#  define HASSETSID	1	/* has POSIX setsid(2) call */
23757c478bdstevel@tonic-gate#  define HASSETREUID		1
23767c478bdstevel@tonic-gate#  define HASULIMIT		1
23777c478bdstevel@tonic-gate#  define HASWAITPID		1
23787c478bdstevel@tonic-gate#  define HASGETDTABLESIZE	1
23797c478bdstevel@tonic-gate#  define HASGETUSERSHELL	1
23807c478bdstevel@tonic-gate#  define IP_SRCROUTE		0
23817c478bdstevel@tonic-gate#  define IDENTPROTO		0
23827c478bdstevel@tonic-gate#  define RES_DNSRCH_VARIABLE	_res_dnsrch
23837c478bdstevel@tonic-gate#  define _PATH_UNIX		"/unix"
23847c478bdstevel@tonic-gate#  define _PATH_VENDOR_CF	"/etc/sendmail.cf"
23857c478bdstevel@tonic-gate#  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
23867c478bdstevel@tonic-gate# endif /* MOTO */
23877c478bdstevel@tonic-gate
23887c478bdstevel@tonic-gate/*
23897c478bdstevel@tonic-gate**  Interix
23907c478bdstevel@tonic-gate**	Contributed by Nedelcho Stanev <nedelcho.stanev@atlanticsky.com>
23917c478bdstevel@tonic-gate**
23927c478bdstevel@tonic-gate**	Used for Interix support.
23937c478bdstevel@tonic-gate*/
23947c478bdstevel@tonic-gate
23957c478bdstevel@tonic-gate# if defined(__INTERIX)
23967c478bdstevel@tonic-gate#  define HASURANDOMDEV		1
23977c478bdstevel@tonic-gate#  define HASGETUSERSHELL	0
23987c478bdstevel@tonic-gate#  define HASSTRERROR		1
23997c478bdstevel@tonic-gate#  define HASUNSETENV		1
24007c478bdstevel@tonic-gate#  define HASFCHOWN		1
24017c478bdstevel@tonic-gate#  undef HAVE_SYS_ERRLIST
24027c478bdstevel@tonic-gate#  define sys_errlist		__sys_errlist
24037c478bdstevel@tonic-gate#  define sys_nerr		__sys_nerr
24047c478bdstevel@tonic-gate#  include <sys/mkdev.h>
24057c478bdstevel@tonic-gate#  ifndef major
24067c478bdstevel@tonic-gate#   define major(dev)		((int)(((dev) >> 8) & 0xff))
24077c478bdstevel@tonic-gate#  endif /* ! major */
24087c478bdstevel@tonic-gate#  ifndef minor
24097c478bdstevel@tonic-gate#   define minor(dev)		((int)((dev) & 0xff))
24107c478bdstevel@tonic-gate#  endif /* ! minor */
24117c478bdstevel@tonic-gate# endif /* defined(__INTERIX) */
24127c478bdstevel@tonic-gate
24137c478bdstevel@tonic-gate
24147c478bdstevel@tonic-gate/**********************************************************************
24157c478bdstevel@tonic-gate**  End of Per-Operating System defines
24167c478bdstevel@tonic-gate**********************************************************************/
24177c478bdstevel@tonic-gate/**********************************************************************
24187c478bdstevel@tonic-gate**  More general defines
24197c478bdstevel@tonic-gate**********************************************************************/
24207c478bdstevel@tonic-gate
24217c478bdstevel@tonic-gate/* general BSD defines */
24227c478bdstevel@tonic-gate# ifdef BSD
24237c478bdstevel@tonic-gate#  define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
24247c478bdstevel@tonic-gate#  ifndef HASSETREUID
24257c478bdstevel@tonic-gate#   define HASSETREUID	1	/* has setreuid(2) call */
24267c478bdstevel@tonic-gate#  endif /* ! HASSETREUID */
24277c478bdstevel@tonic-gate#  define HASINITGROUPS	1	/* has initgroups(3) call */
24287c478bdstevel@tonic-gate#  ifndef IP_SRCROUTE
24297c478bdstevel@tonic-gate#   define IP_SRCROUTE	1	/* can check IP source routing */
24307c478bdstevel@tonic-gate#  endif /* ! IP_SRCROUTE */
24317c478bdstevel@tonic-gate#  ifndef HASSETRLIMIT
24327c478bdstevel@tonic-gate#   define HASSETRLIMIT	1	/* has setrlimit(2) call */
24337c478bdstevel@tonic-gate#  endif /* ! HASSETRLIMIT */
24347c478bdstevel@tonic-gate#  ifndef HASFLOCK
24357c478bdstevel@tonic-gate#   define HASFLOCK	1	/* has flock(2) call */
24367c478bdstevel@tonic-gate#  endif /* ! HASFLOCK */
24377c478bdstevel@tonic-gate#  ifndef TZ_TYPE
24387c478bdstevel@tonic-gate#   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
24397c478bdstevel@tonic-gate#  endif /* ! TZ_TYPE */
24407c478bdstevel@tonic-gate# endif /* BSD */
24417c478bdstevel@tonic-gate
24427c478bdstevel@tonic-gate/* general System V Release 4 defines */
24437c478bdstevel@tonic-gate# ifdef __svr4__
24447c478bdstevel@tonic-gate#  define SYSTEM5	1
24457c478bdstevel@tonic-gate#  define USESETEUID	1	/* has usable seteuid(2) call */
24467c478bd