xref: /illumos-gate/usr/src/cmd/sendmail/include/sm/conf.h (revision 7c478bd95313f5f23a4c958a745db2134aa0324)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1998-2005 Sendmail, Inc. and its suppliers.
3*7c478bd9Sstevel@tonic-gate  *	All rights reserved.
4*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
5*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1988, 1993
6*7c478bd9Sstevel@tonic-gate  *	The Regents of the University of California.  All rights reserved.
7*7c478bd9Sstevel@tonic-gate  *
8*7c478bd9Sstevel@tonic-gate  * By using this file, you agree to the terms and conditions set
9*7c478bd9Sstevel@tonic-gate  * forth in the LICENSE file which can be found at the top level of
10*7c478bd9Sstevel@tonic-gate  * the sendmail distribution.
11*7c478bd9Sstevel@tonic-gate  *
12*7c478bd9Sstevel@tonic-gate  *
13*7c478bd9Sstevel@tonic-gate  *	$Id: conf.h,v 1.120 2005/03/22 22:07:53 ca Exp $
14*7c478bd9Sstevel@tonic-gate  */
15*7c478bd9Sstevel@tonic-gate 
16*7c478bd9Sstevel@tonic-gate /*
17*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
18*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
19*7c478bd9Sstevel@tonic-gate  */
20*7c478bd9Sstevel@tonic-gate 
21*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
22*7c478bd9Sstevel@tonic-gate 
23*7c478bd9Sstevel@tonic-gate /*
24*7c478bd9Sstevel@tonic-gate **  CONF.H -- All user-configurable parameters for sendmail
25*7c478bd9Sstevel@tonic-gate **
26*7c478bd9Sstevel@tonic-gate **	Send updates to sendmail@Sendmail.ORG so they will be
27*7c478bd9Sstevel@tonic-gate **	included in the next release.
28*7c478bd9Sstevel@tonic-gate */
29*7c478bd9Sstevel@tonic-gate 
30*7c478bd9Sstevel@tonic-gate #ifndef SM_CONF_H
31*7c478bd9Sstevel@tonic-gate # define SM_CONF_H 1
32*7c478bd9Sstevel@tonic-gate 
33*7c478bd9Sstevel@tonic-gate 
34*7c478bd9Sstevel@tonic-gate # include <sm/config.h>
35*7c478bd9Sstevel@tonic-gate # include <sm/varargs.h>
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate /*
38*7c478bd9Sstevel@tonic-gate **  General "standard C" defines.
39*7c478bd9Sstevel@tonic-gate **
40*7c478bd9Sstevel@tonic-gate **	These may be undone later, to cope with systems that claim to
41*7c478bd9Sstevel@tonic-gate **	be Standard C but aren't.  Gcc is the biggest offender -- it
42*7c478bd9Sstevel@tonic-gate **	doesn't realize that the library is part of the language.
43*7c478bd9Sstevel@tonic-gate **
44*7c478bd9Sstevel@tonic-gate **	Life would be much easier if we could get rid of this sort
45*7c478bd9Sstevel@tonic-gate **	of bozo problems.
46*7c478bd9Sstevel@tonic-gate */
47*7c478bd9Sstevel@tonic-gate 
48*7c478bd9Sstevel@tonic-gate # ifdef __STDC__
49*7c478bd9Sstevel@tonic-gate #  define HASSETVBUF	1	/* we have setvbuf(3) in libc */
50*7c478bd9Sstevel@tonic-gate # endif /* __STDC__ */
51*7c478bd9Sstevel@tonic-gate 
52*7c478bd9Sstevel@tonic-gate /*
53*7c478bd9Sstevel@tonic-gate **  Assume you have standard calls; can be #undefed below if necessary.
54*7c478bd9Sstevel@tonic-gate */
55*7c478bd9Sstevel@tonic-gate 
56*7c478bd9Sstevel@tonic-gate # ifndef HASLSTAT
57*7c478bd9Sstevel@tonic-gate #  define HASLSTAT	1	/* has lstat(2) call */
58*7c478bd9Sstevel@tonic-gate # endif /* ! HASLSTAT */
59*7c478bd9Sstevel@tonic-gate 
60*7c478bd9Sstevel@tonic-gate # ifndef HASNICE
61*7c478bd9Sstevel@tonic-gate #  define HASNICE	1	/* has nice(2) call */
62*7c478bd9Sstevel@tonic-gate # endif /* ! HASNICE */
63*7c478bd9Sstevel@tonic-gate 
64*7c478bd9Sstevel@tonic-gate # ifndef HASRRESVPORT
65*7c478bd9Sstevel@tonic-gate #  define HASRRESVPORT	1	/* has rrsevport(3) call */
66*7c478bd9Sstevel@tonic-gate # endif /* ! HASRRESVPORT */
67*7c478bd9Sstevel@tonic-gate 
68*7c478bd9Sstevel@tonic-gate /**********************************************************************
69*7c478bd9Sstevel@tonic-gate **  "Hard" compilation options.
70*7c478bd9Sstevel@tonic-gate **	#define these if they are available; comment them out otherwise.
71*7c478bd9Sstevel@tonic-gate **  These cannot be overridden from the Makefile, and should really not
72*7c478bd9Sstevel@tonic-gate **  be turned off unless absolutely necessary.
73*7c478bd9Sstevel@tonic-gate **********************************************************************/
74*7c478bd9Sstevel@tonic-gate 
75*7c478bd9Sstevel@tonic-gate #define LOG		1	/* enable logging -- don't turn off */
76*7c478bd9Sstevel@tonic-gate 
77*7c478bd9Sstevel@tonic-gate /**********************************************************************
78*7c478bd9Sstevel@tonic-gate **  Operating system configuration.
79*7c478bd9Sstevel@tonic-gate **
80*7c478bd9Sstevel@tonic-gate **	Unless you are porting to a new OS, you shouldn't have to
81*7c478bd9Sstevel@tonic-gate **	change these.
82*7c478bd9Sstevel@tonic-gate **********************************************************************/
83*7c478bd9Sstevel@tonic-gate 
84*7c478bd9Sstevel@tonic-gate /*
85*7c478bd9Sstevel@tonic-gate **  HP-UX -- tested for 8.07, 9.00, and 9.01.
86*7c478bd9Sstevel@tonic-gate **
87*7c478bd9Sstevel@tonic-gate **	If V4FS is defined, compile for HP-UX 10.0.
88*7c478bd9Sstevel@tonic-gate **	11.x support from Richard Allen <ra@hp.is>.
89*7c478bd9Sstevel@tonic-gate */
90*7c478bd9Sstevel@tonic-gate 
91*7c478bd9Sstevel@tonic-gate # ifdef __hpux
92*7c478bd9Sstevel@tonic-gate 		/* common definitions for HP-UX 9.x and 10.x */
93*7c478bd9Sstevel@tonic-gate #  undef m_flags		/* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */
94*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* include all the System V defines */
95*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
96*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
97*7c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
98*7c478bd9Sstevel@tonic-gate #  define HASSETRESGID	1	/* use setresgid(2) to set saved gid */
99*7c478bd9Sstevel@tonic-gate #  define BOGUS_O_EXCL	1	/* exclusive open follows symlinks */
100*7c478bd9Sstevel@tonic-gate #  define seteuid(e)	setresuid(-1, e, -1)
101*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	1	/* can check IP source routing */
102*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_HPUX
103*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_PSTAT
104*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
105*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
106*7c478bd9Sstevel@tonic-gate #  define LDA_USE_LOCKF	1
107*7c478bd9Sstevel@tonic-gate #  ifndef HASGETUSERSHELL
108*7c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
109*7c478bd9Sstevel@tonic-gate #  endif /* ! HASGETUSERSHELL */
110*7c478bd9Sstevel@tonic-gate #  ifdef HPUX10
111*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAIL	"/usr/sbin/sendmail"
112*7c478bd9Sstevel@tonic-gate #   ifndef SMRSH_CMDDIR
113*7c478bd9Sstevel@tonic-gate #    define SMRSH_CMDDIR	"/var/adm/sm.bin"
114*7c478bd9Sstevel@tonic-gate #   endif /* ! SMRSH_CMDDIR */
115*7c478bd9Sstevel@tonic-gate #  endif /* HPUX10 */
116*7c478bd9Sstevel@tonic-gate #  ifdef HPUX11
117*7c478bd9Sstevel@tonic-gate #   define HASSETREUID	1	/* setreuid(2) works on HP-UX 11.x */
118*7c478bd9Sstevel@tonic-gate #   define HASFCHOWN	1	/* has fchown(2) */
119*7c478bd9Sstevel@tonic-gate #   ifndef BROKEN_RES_SEARCH
120*7c478bd9Sstevel@tonic-gate #    define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
121*7c478bd9Sstevel@tonic-gate #   endif /* ! BROKEN_RES_SEARCH */
122*7c478bd9Sstevel@tonic-gate #   ifndef SMRSH_CMDDIR
123*7c478bd9Sstevel@tonic-gate #    define SMRSH_CMDDIR	"/var/adm/sm.bin"
124*7c478bd9Sstevel@tonic-gate #   endif /* ! SMRSH_CMDDIR */
125*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAIL	"/usr/sbin/sendmail"
126*7c478bd9Sstevel@tonic-gate #  else /* HPUX11 */
127*7c478bd9Sstevel@tonic-gate #   ifndef NOT_SENDMAIL
128*7c478bd9Sstevel@tonic-gate #    define syslog	hard_syslog
129*7c478bd9Sstevel@tonic-gate #   endif /* ! NOT_SENDMAIL */
130*7c478bd9Sstevel@tonic-gate #  endif /* HPUX11 */
131*7c478bd9Sstevel@tonic-gate #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
132*7c478bd9Sstevel@tonic-gate 
133*7c478bd9Sstevel@tonic-gate #  ifdef V4FS
134*7c478bd9Sstevel@tonic-gate 		/* HP-UX 10.x */
135*7c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/stand/vmunix"
136*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_VENDOR_CF
137*7c478bd9Sstevel@tonic-gate #    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
138*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_VENDOR_CF */
139*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_SENDMAILPID
140*7c478bd9Sstevel@tonic-gate #    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
141*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_SENDMAILPID */
142*7c478bd9Sstevel@tonic-gate #   ifndef IDENTPROTO
143*7c478bd9Sstevel@tonic-gate #    define IDENTPROTO	1	/* TCP/IP implementation fixed in 10.0 */
144*7c478bd9Sstevel@tonic-gate #   endif /* ! IDENTPROTO */
145*7c478bd9Sstevel@tonic-gate #   include <sys/mpctl.h>	/* for mpctl() in get_num_procs_online() */
146*7c478bd9Sstevel@tonic-gate #  else /* V4FS */
147*7c478bd9Sstevel@tonic-gate 		/* HP-UX 9.x */
148*7c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/hp-ux"
149*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_VENDOR_CF
150*7c478bd9Sstevel@tonic-gate #    define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
151*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_VENDOR_CF */
152*7c478bd9Sstevel@tonic-gate #   ifndef IDENTPROTO
153*7c478bd9Sstevel@tonic-gate #    define IDENTPROTO	0	/* TCP/IP implementation is broken */
154*7c478bd9Sstevel@tonic-gate #   endif /* ! IDENTPROTO */
155*7c478bd9Sstevel@tonic-gate #   ifdef __STDC__
156*7c478bd9Sstevel@tonic-gate extern void	hard_syslog(int, char *, ...);
157*7c478bd9Sstevel@tonic-gate #   else /* __STDC__ */
158*7c478bd9Sstevel@tonic-gate extern void	hard_syslog();
159*7c478bd9Sstevel@tonic-gate #   endif /* __STDC__ */
160*7c478bd9Sstevel@tonic-gate #   define FDSET_CAST	(int *)	/* cast for fd_set parameters to select */
161*7c478bd9Sstevel@tonic-gate #  endif /* V4FS */
162*7c478bd9Sstevel@tonic-gate 
163*7c478bd9Sstevel@tonic-gate # endif /* __hpux */
164*7c478bd9Sstevel@tonic-gate 
165*7c478bd9Sstevel@tonic-gate /*
166*7c478bd9Sstevel@tonic-gate **  IBM AIX 5.x
167*7c478bd9Sstevel@tonic-gate */
168*7c478bd9Sstevel@tonic-gate 
169*7c478bd9Sstevel@tonic-gate # ifdef _AIX5
170*7c478bd9Sstevel@tonic-gate #  define _AIX4		40300
171*7c478bd9Sstevel@tonic-gate #  define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */
172*7c478bd9Sstevel@tonic-gate #  define SOCKOPT_LEN_T	socklen_t /* arg#5 to getsockopt */
173*7c478bd9Sstevel@tonic-gate #  if _AIX5 >= 50200
174*7c478bd9Sstevel@tonic-gate #   define HASUNSETENV	1	/* has unsetenv(3) call */
175*7c478bd9Sstevel@tonic-gate #  endif /* _AIX5 >= 50200 */
176*7c478bd9Sstevel@tonic-gate # endif /* _AIX5 */
177*7c478bd9Sstevel@tonic-gate 
178*7c478bd9Sstevel@tonic-gate /*
179*7c478bd9Sstevel@tonic-gate **  IBM AIX 4.x
180*7c478bd9Sstevel@tonic-gate */
181*7c478bd9Sstevel@tonic-gate 
182*7c478bd9Sstevel@tonic-gate # ifdef _AIX4
183*7c478bd9Sstevel@tonic-gate #  define _AIX3		1	/* pull in AIX3 stuff */
184*7c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR	/* has sa_len */
185*7c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* seteuid(2) works */
186*7c478bd9Sstevel@tonic-gate #  define TZ_TYPE	TZ_NAME	/* use tzname[] vector */
187*7c478bd9Sstevel@tonic-gate #  ifndef SOCKOPT_LEN_T
188*7c478bd9Sstevel@tonic-gate #   define SOCKOPT_LEN_T	size_t	/* arg#5 to getsockopt */
189*7c478bd9Sstevel@tonic-gate #  endif /* SOCKOPT_LEN_T */
190*7c478bd9Sstevel@tonic-gate #  if _AIX4 >= 40200
191*7c478bd9Sstevel@tonic-gate #   define HASSETREUID	1	/* setreuid(2) works as of AIX 4.2 */
192*7c478bd9Sstevel@tonic-gate #   ifndef SOCKADDR_LEN_T
193*7c478bd9Sstevel@tonic-gate #    define SOCKADDR_LEN_T	size_t	/* e.g., arg#3 to accept, getsockname */
194*7c478bd9Sstevel@tonic-gate #   endif /* SOCKADDR_LEN_T */
195*7c478bd9Sstevel@tonic-gate #  endif /* _AIX4 >= 40200 */
196*7c478bd9Sstevel@tonic-gate #  if defined(_ILS_MACROS)	/* IBM versions aren't side-effect clean */
197*7c478bd9Sstevel@tonic-gate #   undef isascii
198*7c478bd9Sstevel@tonic-gate #   define isascii(c)		!(c & ~0177)
199*7c478bd9Sstevel@tonic-gate #   undef isdigit
200*7c478bd9Sstevel@tonic-gate #   define isdigit(__a)		(_IS(__a,_ISDIGIT))
201*7c478bd9Sstevel@tonic-gate #   undef isspace
202*7c478bd9Sstevel@tonic-gate #   define isspace(__a)		(_IS(__a,_ISSPACE))
203*7c478bd9Sstevel@tonic-gate #  endif /* defined(_ILS_MACROS) */
204*7c478bd9Sstevel@tonic-gate # endif /* _AIX4 */
205*7c478bd9Sstevel@tonic-gate 
206*7c478bd9Sstevel@tonic-gate 
207*7c478bd9Sstevel@tonic-gate /*
208*7c478bd9Sstevel@tonic-gate **  IBM AIX 3.x -- actually tested for 3.2.3
209*7c478bd9Sstevel@tonic-gate */
210*7c478bd9Sstevel@tonic-gate 
211*7c478bd9Sstevel@tonic-gate # ifdef _AIX3
212*7c478bd9Sstevel@tonic-gate #  include <paths.h>
213*7c478bd9Sstevel@tonic-gate #  include <sys/machine.h>	/* to get byte order */
214*7c478bd9Sstevel@tonic-gate #  include <sys/select.h>
215*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) */
216*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
217*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
218*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
219*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
220*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
221*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
222*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
223*7c478bd9Sstevel@tonic-gate #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
224*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
225*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
226*7c478bd9Sstevel@tonic-gate #  endif /* LA_TYPE */
227*7c478bd9Sstevel@tonic-gate #  define FSHIFT	16
228*7c478bd9Sstevel@tonic-gate #  define LA_AVENRUN	"avenrun"
229*7c478bd9Sstevel@tonic-gate #  if !defined(_AIX4) || _AIX4 < 40300
230*7c478bd9Sstevel@tonic-gate #   ifndef __BIT_TYPES_DEFINED__
231*7c478bd9Sstevel@tonic-gate #    define SM_INT32	int
232*7c478bd9Sstevel@tonic-gate #   endif /* __BIT_TYPES_DEFINED__ */
233*7c478bd9Sstevel@tonic-gate #  endif /* !defined(_AIX4) || _AIX4 < 40300 */
234*7c478bd9Sstevel@tonic-gate #  if !defined(_AIX4) || _AIX4 < 40200
235*7c478bd9Sstevel@tonic-gate #   define SM_CONF_SYSLOG	0
236*7c478bd9Sstevel@tonic-gate #  endif /* !defined(_AIX4) || _AIX4 < 40200 */
237*7c478bd9Sstevel@tonic-gate # endif /* _AIX3 */
238*7c478bd9Sstevel@tonic-gate 
239*7c478bd9Sstevel@tonic-gate 
240*7c478bd9Sstevel@tonic-gate /*
241*7c478bd9Sstevel@tonic-gate **  IBM AIX 2.2.1 -- actually tested for osupdate level 2706+1773
242*7c478bd9Sstevel@tonic-gate **
243*7c478bd9Sstevel@tonic-gate **	From Mark Whetzel <markw@wg.waii.com>.
244*7c478bd9Sstevel@tonic-gate */
245*7c478bd9Sstevel@tonic-gate 
246*7c478bd9Sstevel@tonic-gate # ifdef AIX			/* AIX/RT compiler pre-defines this */
247*7c478bd9Sstevel@tonic-gate #  include <paths.h>
248*7c478bd9Sstevel@tonic-gate #  include <sys/time.h>		/* AIX/RT resource.h does NOT include this */
249*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
250*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
251*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
252*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	0	/* does not have fchmod(2) syscall */
253*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* use setreuid(2) -lbsd system call */
254*7c478bd9Sstevel@tonic-gate #  define HASSETVBUF	1	/* use setvbuf(2) system call */
255*7c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT	0	/* does not have setrlimit call */
256*7c478bd9Sstevel@tonic-gate #  define HASFLOCK	0	/* does not have flock call - use fcntl */
257*7c478bd9Sstevel@tonic-gate #  define HASULIMIT	1	/* use ulimit instead of setrlimit call */
258*7c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	0	/* Do we need theirs or ours */
259*7c478bd9Sstevel@tonic-gate #  define SYS5SETPGRP	1	/* don't have setpgid on AIX/RT */
260*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
261*7c478bd9Sstevel@tonic-gate #  define BSD4_3		1	/* NOT bsd 4.4 or posix signals */
262*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	int
263*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
264*7c478bd9Sstevel@tonic-gate #  define SPT_PADCHAR	'\0'		/* pad process title with nulls */
265*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_SUBR		/* use our ported loadavgd daemon */
266*7c478bd9Sstevel@tonic-gate #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
267*7c478bd9Sstevel@tonic-gate #  define ARBPTR_T	int *
268*7c478bd9Sstevel@tonic-gate #  define void		int
269*7c478bd9Sstevel@tonic-gate typedef int		pid_t;
270*7c478bd9Sstevel@tonic-gate /* RTisms for BSD compatibility, specified in the Makefile
271*7c478bd9Sstevel@tonic-gate   define BSD		1
272*7c478bd9Sstevel@tonic-gate   define BSD_INCLUDES		1
273*7c478bd9Sstevel@tonic-gate   define BSD_REMAP_SIGNAL_TO_SIGVEC
274*7c478bd9Sstevel@tonic-gate     RTisms needed above */
275*7c478bd9Sstevel@tonic-gate /* make this sendmail in a completely different place */
276*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
277*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/local/newmail/sendmail.cf"
278*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
279*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
280*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/usr/local/newmail/sendmail.pid"
281*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
282*7c478bd9Sstevel@tonic-gate # endif /* AIX */
283*7c478bd9Sstevel@tonic-gate 
284*7c478bd9Sstevel@tonic-gate # if defined(_AIX)
285*7c478bd9Sstevel@tonic-gate #  define LDA_USE_LOCKF		1
286*7c478bd9Sstevel@tonic-gate #  define LDA_USE_SETEUID	1
287*7c478bd9Sstevel@tonic-gate # endif /* defined(_AIX) */
288*7c478bd9Sstevel@tonic-gate 
289*7c478bd9Sstevel@tonic-gate /*
290*7c478bd9Sstevel@tonic-gate **  Silicon Graphics IRIX
291*7c478bd9Sstevel@tonic-gate **
292*7c478bd9Sstevel@tonic-gate **	Compiles on 4.0.1.
293*7c478bd9Sstevel@tonic-gate **
294*7c478bd9Sstevel@tonic-gate **	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
295*7c478bd9Sstevel@tonic-gate **	Use IRIX5 instead of IRIX for IRIX 5.x.
296*7c478bd9Sstevel@tonic-gate **
297*7c478bd9Sstevel@tonic-gate **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
298*7c478bd9Sstevel@tonic-gate **	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
299*7c478bd9Sstevel@tonic-gate */
300*7c478bd9Sstevel@tonic-gate 
301*7c478bd9Sstevel@tonic-gate # ifdef IRIX
302*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* this is a System-V derived system */
303*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
304*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
305*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
306*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
307*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	1	/* can check IP source routing */
308*7c478bd9Sstevel@tonic-gate #  define setpgid	BSDsetpgrp
309*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
310*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
311*7c478bd9Sstevel@tonic-gate #  define SFS_BAVAIL	f_bfree		/* alternate field name */
312*7c478bd9Sstevel@tonic-gate #  define SYSLOG_BUFSIZE 512
313*7c478bd9Sstevel@tonic-gate #  if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
314*7c478bd9Sstevel@tonic-gate     /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */
315*7c478bd9Sstevel@tonic-gate #   define _SC_NPROCESSORS_ONLN	_SC_NPROC_ONLN
316*7c478bd9Sstevel@tonic-gate #  endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */
317*7c478bd9Sstevel@tonic-gate #  ifdef IRIX6
318*7c478bd9Sstevel@tonic-gate #   define STAT64	1
319*7c478bd9Sstevel@tonic-gate #   define QUAD_T	unsigned long long
320*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_IRIX6	/* figure out at run time */
321*7c478bd9Sstevel@tonic-gate #   define SAFENFSPATHCONF 0	/* pathconf(2) lies on NFS filesystems */
322*7c478bd9Sstevel@tonic-gate #  else /* IRIX6 */
323*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
324*7c478bd9Sstevel@tonic-gate 
325*7c478bd9Sstevel@tonic-gate #   ifdef IRIX64
326*7c478bd9Sstevel@tonic-gate #    define STAT64	1
327*7c478bd9Sstevel@tonic-gate #    define QUAD_T	unsigned long long
328*7c478bd9Sstevel@tonic-gate #    define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
329*7c478bd9Sstevel@tonic-gate #   else /* IRIX64 */
330*7c478bd9Sstevel@tonic-gate #    define STAT64	0
331*7c478bd9Sstevel@tonic-gate #    define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
332*7c478bd9Sstevel@tonic-gate #   endif /* IRIX64 */
333*7c478bd9Sstevel@tonic-gate #  endif /* IRIX6 */
334*7c478bd9Sstevel@tonic-gate #  if defined(IRIX64) || defined(IRIX5) || defined(IRIX6)
335*7c478bd9Sstevel@tonic-gate #   include <sys/cdefs.h>
336*7c478bd9Sstevel@tonic-gate #   include <paths.h>
337*7c478bd9Sstevel@tonic-gate #   define ARGV_T	char *const *
338*7c478bd9Sstevel@tonic-gate #   define HASFCHOWN	1	/* has fchown(2) */
339*7c478bd9Sstevel@tonic-gate #   define HASSETRLIMIT	1	/* has setrlimit(2) syscall */
340*7c478bd9Sstevel@tonic-gate #   define HASGETDTABLESIZE 1	/* has getdtablesize(2) syscall */
341*7c478bd9Sstevel@tonic-gate #   define HASSTRERROR	1	/* has strerror(3) */
342*7c478bd9Sstevel@tonic-gate #  else /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
343*7c478bd9Sstevel@tonic-gate #   define ARGV_T	const char **
344*7c478bd9Sstevel@tonic-gate #   define WAITUNION	1	/* use "union wait" as wait argument type */
345*7c478bd9Sstevel@tonic-gate #  endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
346*7c478bd9Sstevel@tonic-gate # endif /* IRIX */
347*7c478bd9Sstevel@tonic-gate 
348*7c478bd9Sstevel@tonic-gate 
349*7c478bd9Sstevel@tonic-gate /*
350*7c478bd9Sstevel@tonic-gate **  SunOS and Solaris
351*7c478bd9Sstevel@tonic-gate **
352*7c478bd9Sstevel@tonic-gate **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
353*7c478bd9Sstevel@tonic-gate **	Solaris 2.4 (a.k.a. SunOS 5.4).
354*7c478bd9Sstevel@tonic-gate */
355*7c478bd9Sstevel@tonic-gate 
356*7c478bd9Sstevel@tonic-gate # if defined(sun) && !defined(BSD)
357*7c478bd9Sstevel@tonic-gate 
358*7c478bd9Sstevel@tonic-gate #  include <sys/time.h>
359*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
360*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
361*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
362*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	1	/* can check IP source routing */
363*7c478bd9Sstevel@tonic-gate #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
364*7c478bd9Sstevel@tonic-gate #  ifndef HASFCHOWN
365*7c478bd9Sstevel@tonic-gate #   define HASFCHOWN	1	/* fchown(2) */
366*7c478bd9Sstevel@tonic-gate #  endif /* ! HASFCHOWN */
367*7c478bd9Sstevel@tonic-gate 
368*7c478bd9Sstevel@tonic-gate #  ifdef __svr4__
369*7c478bd9Sstevel@tonic-gate #   define LDA_USE_LOCKF		1
370*7c478bd9Sstevel@tonic-gate #   define LDA_USE_SETEUID	1
371*7c478bd9Sstevel@tonic-gate #   define _PATH_MAILDIR		"/var/mail"
372*7c478bd9Sstevel@tonic-gate #  endif /* __svr4__ */
373*7c478bd9Sstevel@tonic-gate 
374*7c478bd9Sstevel@tonic-gate #  ifdef SOLARIS_2_3
375*7c478bd9Sstevel@tonic-gate #   define SOLARIS	20300	/* for back compat only -- use -DSOLARIS=20300 */
376*7c478bd9Sstevel@tonic-gate #  endif /* SOLARIS_2_3 */
377*7c478bd9Sstevel@tonic-gate 
378*7c478bd9Sstevel@tonic-gate #  if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4))
379*7c478bd9Sstevel@tonic-gate #   define SOLARIS	1	/* unknown Solaris version */
380*7c478bd9Sstevel@tonic-gate #  endif /* defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) */
381*7c478bd9Sstevel@tonic-gate 
382*7c478bd9Sstevel@tonic-gate #  ifdef SOLARIS
383*7c478bd9Sstevel@tonic-gate 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
384*7c478bd9Sstevel@tonic-gate #   ifndef __svr4__
385*7c478bd9Sstevel@tonic-gate #    define __svr4__		/* use all System V Release 4 defines below */
386*7c478bd9Sstevel@tonic-gate #   endif /* ! __svr4__ */
387*7c478bd9Sstevel@tonic-gate #   define GIDSET_T	gid_t
388*7c478bd9Sstevel@tonic-gate #   define USE_SA_SIGACTION	1	/* use sa_sigaction field */
389*7c478bd9Sstevel@tonic-gate #   define BROKEN_PTHREAD_SLEEP	1	/* sleep after pthread_create() fails */
390*7c478bd9Sstevel@tonic-gate #   define HASSTRERROR	1	/* has strerror(3) */
391*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_UNIX
392*7c478bd9Sstevel@tonic-gate #    define _PATH_UNIX		"/dev/ksyms"
393*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_UNIX */
394*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_VENDOR_CF
395*7c478bd9Sstevel@tonic-gate #    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
396*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_VENDOR_CF */
397*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_SENDMAILPID
398*7c478bd9Sstevel@tonic-gate #    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
399*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_SENDMAILPID */
400*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_HOSTS
401*7c478bd9Sstevel@tonic-gate #    define _PATH_HOSTS		"/etc/inet/hosts"
402*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_HOSTS */
403*7c478bd9Sstevel@tonic-gate #   ifndef SYSLOG_BUFSIZE
404*7c478bd9Sstevel@tonic-gate #    define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
405*7c478bd9Sstevel@tonic-gate #   endif /* ! SYSLOG_BUFSIZE */
406*7c478bd9Sstevel@tonic-gate #   ifndef TZ_TYPE
407*7c478bd9Sstevel@tonic-gate #    define TZ_TYPE	TZ_TZNAME
408*7c478bd9Sstevel@tonic-gate #   endif /* ! TZ_TYPE */
409*7c478bd9Sstevel@tonic-gate #   if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203)
410*7c478bd9Sstevel@tonic-gate #    define USESETEUID		1	/* seteuid works as of 2.3 */
411*7c478bd9Sstevel@tonic-gate #    define LDA_CONTENTLENGTH	1	/* Needs the Content-Length header */
412*7c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */
413*7c478bd9Sstevel@tonic-gate #   if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205)
414*7c478bd9Sstevel@tonic-gate #    define HASSETREUID	1		/* setreuid works as of 2.5 */
415*7c478bd9Sstevel@tonic-gate #    define HASSETREGID	1	/* use setregid(2) to set saved gid */
416*7c478bd9Sstevel@tonic-gate #    if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700)
417*7c478bd9Sstevel@tonic-gate #     ifndef LA_TYPE
418*7c478bd9Sstevel@tonic-gate #      define LA_TYPE	LA_KSTAT	/* use kstat(3k) -- may work in < 2.5 */
419*7c478bd9Sstevel@tonic-gate #     endif /* ! LA_TYPE */
420*7c478bd9Sstevel@tonic-gate #     ifndef RANDOMSHIFT		/* random() doesn't work well (sometimes) */
421*7c478bd9Sstevel@tonic-gate #      define RANDOMSHIFT	8
422*7c478bd9Sstevel@tonic-gate #     endif /* ! RANDOMSHIFT */
423*7c478bd9Sstevel@tonic-gate #    endif /* SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) */
424*7c478bd9Sstevel@tonic-gate #   else /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */
425*7c478bd9Sstevel@tonic-gate #    ifndef HASRANDOM
426*7c478bd9Sstevel@tonic-gate #     define HASRANDOM	0		/* doesn't have random(3) */
427*7c478bd9Sstevel@tonic-gate #    endif /* ! HASRANDOM */
428*7c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */
429*7c478bd9Sstevel@tonic-gate #   if (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206
430*7c478bd9Sstevel@tonic-gate #    define SM_INT32	int	/* 32bit integer */
431*7c478bd9Sstevel@tonic-gate #   endif /* (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206 */
432*7c478bd9Sstevel@tonic-gate #   if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207)
433*7c478bd9Sstevel@tonic-gate #    ifndef LA_TYPE
434*7c478bd9Sstevel@tonic-gate #     include <sys/loadavg.h>
435*7c478bd9Sstevel@tonic-gate #     if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
436*7c478bd9Sstevel@tonic-gate #      include <sys/pset.h>
437*7c478bd9Sstevel@tonic-gate #      define LA_TYPE	LA_PSET	/* pset_getloadavg(3c) appears in 2.9 */
438*7c478bd9Sstevel@tonic-gate #     else /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
439*7c478bd9Sstevel@tonic-gate #      define LA_TYPE	LA_SUBR	/* getloadavg(3c) appears in 2.7 */
440*7c478bd9Sstevel@tonic-gate #     endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
441*7c478bd9Sstevel@tonic-gate #    endif /* ! LA_TYPE */
442*7c478bd9Sstevel@tonic-gate #    define HASGETUSERSHELL 1	/* getusershell(3c) bug fixed in 2.7 */
443*7c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */
444*7c478bd9Sstevel@tonic-gate #   if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208)
445*7c478bd9Sstevel@tonic-gate #    undef _PATH_SENDMAILPID	/* tmpfs /var/run added in 2.8 */
446*7c478bd9Sstevel@tonic-gate #    define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
447*7c478bd9Sstevel@tonic-gate #    ifndef SMRSH_CMDDIR
448*7c478bd9Sstevel@tonic-gate #     define SMRSH_CMDDIR	"/var/adm/sm.bin"
449*7c478bd9Sstevel@tonic-gate #    endif /* ! SMRSH_CMDDIR */
450*7c478bd9Sstevel@tonic-gate #    define SL_FUDGE	34	/* fudge offset for SyslogPrefixLen */
451*7c478bd9Sstevel@tonic-gate #    define HASLDAPGETALIASBYNAME	1	/* added in S8 */
452*7c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */
453*7c478bd9Sstevel@tonic-gate #   if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
454*7c478bd9Sstevel@tonic-gate #    define HASURANDOMDEV	1	/* /dev/[u]random added in S9 */
455*7c478bd9Sstevel@tonic-gate #    define HASCLOSEFROM	1	/* closefrom(3c) added in S9 */
456*7c478bd9Sstevel@tonic-gate #    define HASFDWALK		1	/* fdwalk(3c) added in S9 */
457*7c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
458*7c478bd9Sstevel@tonic-gate #   if SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210)
459*7c478bd9Sstevel@tonic-gate #    define HASUNSETENV 1       /* unsetenv() added in S10 */
460*7c478bd9Sstevel@tonic-gate #   endif /* SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) */
461*7c478bd9Sstevel@tonic-gate #   ifndef HASGETUSERSHELL
462*7c478bd9Sstevel@tonic-gate #    define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps pre-2.7 */
463*7c478bd9Sstevel@tonic-gate #   endif /* ! HASGETUSERSHELL */
464*7c478bd9Sstevel@tonic-gate 
465*7c478bd9Sstevel@tonic-gate #  else /* SOLARIS */
466*7c478bd9Sstevel@tonic-gate 			/* SunOS 4.0.3 or 4.1.x */
467*7c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
468*7c478bd9Sstevel@tonic-gate #   define HASSETREUID	1	/* has setreuid(2) call */
469*7c478bd9Sstevel@tonic-gate #   ifndef HASFLOCK
470*7c478bd9Sstevel@tonic-gate #    define HASFLOCK	1	/* has flock(2) call */
471*7c478bd9Sstevel@tonic-gate #   endif /* ! HASFLOCK */
472*7c478bd9Sstevel@tonic-gate #   define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
473*7c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
474*7c478bd9Sstevel@tonic-gate #   include <memory.h>
475*7c478bd9Sstevel@tonic-gate #   include <vfork.h>
476*7c478bd9Sstevel@tonic-gate #   ifdef __GNUC__
477*7c478bd9Sstevel@tonic-gate #    define strtoul	strtol	/* gcc library bogosity */
478*7c478bd9Sstevel@tonic-gate #   endif /* __GNUC__ */
479*7c478bd9Sstevel@tonic-gate #   define memmove(d, s, l)	(bcopy((s), (d), (l)))
480*7c478bd9Sstevel@tonic-gate #   define atexit(f)	on_exit((f), 0)	/* ugly hack for SunOS */
481*7c478bd9Sstevel@tonic-gate #   define SM_INT32	int	/* 32bit integer */
482*7c478bd9Sstevel@tonic-gate #   define SM_ALIGN_SIZE (sizeof(long))
483*7c478bd9Sstevel@tonic-gate #   define GIDSET_T	int
484*7c478bd9Sstevel@tonic-gate #   define SM_CONF_SYSLOG	0
485*7c478bd9Sstevel@tonic-gate 
486*7c478bd9Sstevel@tonic-gate #   ifdef SUNOS403
487*7c478bd9Sstevel@tonic-gate 			/* special tweaking for SunOS 4.0.3 */
488*7c478bd9Sstevel@tonic-gate #    include <malloc.h>
489*7c478bd9Sstevel@tonic-gate #    define BSD4_3	1	/* 4.3 BSD-based */
490*7c478bd9Sstevel@tonic-gate #    define NEEDSTRSTR	1	/* need emulation of strstr(3) routine */
491*7c478bd9Sstevel@tonic-gate #    define WAITUNION	1	/* use "union wait" as wait argument type */
492*7c478bd9Sstevel@tonic-gate #    undef WIFEXITED
493*7c478bd9Sstevel@tonic-gate #    undef WEXITSTATUS
494*7c478bd9Sstevel@tonic-gate #    undef HASUNAME
495*7c478bd9Sstevel@tonic-gate #    define setpgid	setpgrp
496*7c478bd9Sstevel@tonic-gate #    define MODE_T	int
497*7c478bd9Sstevel@tonic-gate typedef int		pid_t;
498*7c478bd9Sstevel@tonic-gate extern char		*getenv();
499*7c478bd9Sstevel@tonic-gate 
500*7c478bd9Sstevel@tonic-gate #   else /* SUNOS403 */
501*7c478bd9Sstevel@tonic-gate 			/* 4.1.x specifics */
502*7c478bd9Sstevel@tonic-gate #    define HASSETSID	1	/* has POSIX setsid(2) call */
503*7c478bd9Sstevel@tonic-gate #    define HASSETVBUF	1	/* we have setvbuf(3) in libc */
504*7c478bd9Sstevel@tonic-gate 
505*7c478bd9Sstevel@tonic-gate #   endif /* SUNOS403 */
506*7c478bd9Sstevel@tonic-gate #  endif /* SOLARIS */
507*7c478bd9Sstevel@tonic-gate 
508*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
509*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
510*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
511*7c478bd9Sstevel@tonic-gate 
512*7c478bd9Sstevel@tonic-gate # endif /* defined(sun) && !defined(BSD) */
513*7c478bd9Sstevel@tonic-gate 
514*7c478bd9Sstevel@tonic-gate /*
515*7c478bd9Sstevel@tonic-gate **  DG/UX
516*7c478bd9Sstevel@tonic-gate **
517*7c478bd9Sstevel@tonic-gate **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
518*7c478bd9Sstevel@tonic-gate **	older support.
519*7c478bd9Sstevel@tonic-gate **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
520*7c478bd9Sstevel@tonic-gate */
521*7c478bd9Sstevel@tonic-gate 
522*7c478bd9Sstevel@tonic-gate # ifdef DGUX_5_4_2
523*7c478bd9Sstevel@tonic-gate #  define DGUX		1
524*7c478bd9Sstevel@tonic-gate # endif /* DGUX_5_4_2 */
525*7c478bd9Sstevel@tonic-gate 
526*7c478bd9Sstevel@tonic-gate # ifdef DGUX
527*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1
528*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_DGUX
529*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
530*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
531*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
532*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
533*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	0	/* does not have <netinet/ip_var.h> */
534*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) */
535*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
536*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
537*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
538*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
539*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
540*7c478bd9Sstevel@tonic-gate #  define LDA_USE_LOCKF		1
541*7c478bd9Sstevel@tonic-gate 
542*7c478bd9Sstevel@tonic-gate /* these include files must be included early on DG/UX */
543*7c478bd9Sstevel@tonic-gate #  include <netinet/in.h>
544*7c478bd9Sstevel@tonic-gate #  include <arpa/inet.h>
545*7c478bd9Sstevel@tonic-gate 
546*7c478bd9Sstevel@tonic-gate /* compiler doesn't understand const? */
547*7c478bd9Sstevel@tonic-gate #  define const
548*7c478bd9Sstevel@tonic-gate 
549*7c478bd9Sstevel@tonic-gate #  ifdef DGUX_5_4_2
550*7c478bd9Sstevel@tonic-gate #   define inet_addr	dgux_inet_addr
551*7c478bd9Sstevel@tonic-gate extern long	dgux_inet_addr();
552*7c478bd9Sstevel@tonic-gate #  endif /* DGUX_5_4_2 */
553*7c478bd9Sstevel@tonic-gate # endif /* DGUX */
554*7c478bd9Sstevel@tonic-gate 
555*7c478bd9Sstevel@tonic-gate 
556*7c478bd9Sstevel@tonic-gate /*
557*7c478bd9Sstevel@tonic-gate **  Digital Ultrix 4.2 - 4.5
558*7c478bd9Sstevel@tonic-gate **
559*7c478bd9Sstevel@tonic-gate **	Apparently, fcntl locking is broken on 4.2A, in that locks are
560*7c478bd9Sstevel@tonic-gate **	not dropped when the process exits.  This causes major problems,
561*7c478bd9Sstevel@tonic-gate **	so flock is the only alternative.
562*7c478bd9Sstevel@tonic-gate */
563*7c478bd9Sstevel@tonic-gate 
564*7c478bd9Sstevel@tonic-gate # ifdef ultrix
565*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
566*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
567*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
568*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
569*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
570*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) syscall */
571*7c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
572*7c478bd9Sstevel@tonic-gate #   define HASFLOCK	1	/* has flock(2) call */
573*7c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
574*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
575*7c478bd9Sstevel@tonic-gate #  ifndef BROKEN_RES_SEARCH
576*7c478bd9Sstevel@tonic-gate #   define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
577*7c478bd9Sstevel@tonic-gate #  endif /* ! BROKEN_RES_SEARCH */
578*7c478bd9Sstevel@tonic-gate #  if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621
579*7c478bd9Sstevel@tonic-gate #   define NEEDLOCAL_HOSTNAME_LENGTH	1	/* see sendmail/README */
580*7c478bd9Sstevel@tonic-gate #  endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */
581*7c478bd9Sstevel@tonic-gate #  ifdef vax
582*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_FLOAT
583*7c478bd9Sstevel@tonic-gate #  else /* vax */
584*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
585*7c478bd9Sstevel@tonic-gate #   define LA_AVENRUN	"avenrun"
586*7c478bd9Sstevel@tonic-gate #  endif /* vax */
587*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
588*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
589*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
590*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
591*7c478bd9Sstevel@tonic-gate #  define SYSLOG_BUFSIZE	256
592*7c478bd9Sstevel@tonic-gate #  define SM_CONF_SYSLOG	0
593*7c478bd9Sstevel@tonic-gate # endif /* ultrix */
594*7c478bd9Sstevel@tonic-gate 
595*7c478bd9Sstevel@tonic-gate 
596*7c478bd9Sstevel@tonic-gate /*
597*7c478bd9Sstevel@tonic-gate **  OSF/1 for KSR.
598*7c478bd9Sstevel@tonic-gate **
599*7c478bd9Sstevel@tonic-gate **	Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu>
600*7c478bd9Sstevel@tonic-gate */
601*7c478bd9Sstevel@tonic-gate 
602*7c478bd9Sstevel@tonic-gate # ifdef __ksr__
603*7c478bd9Sstevel@tonic-gate #  define __osf__	1	/* get OSF/1 defines below */
604*7c478bd9Sstevel@tonic-gate #  ifndef TZ_TYPE
605*7c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
606*7c478bd9Sstevel@tonic-gate #  endif /* ! TZ_TYPE */
607*7c478bd9Sstevel@tonic-gate # endif /* __ksr__ */
608*7c478bd9Sstevel@tonic-gate 
609*7c478bd9Sstevel@tonic-gate 
610*7c478bd9Sstevel@tonic-gate /*
611*7c478bd9Sstevel@tonic-gate **  OSF/1 for Intel Paragon.
612*7c478bd9Sstevel@tonic-gate **
613*7c478bd9Sstevel@tonic-gate **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
614*7c478bd9Sstevel@tonic-gate **	of Intel Scalable Systems Divison.
615*7c478bd9Sstevel@tonic-gate */
616*7c478bd9Sstevel@tonic-gate 
617*7c478bd9Sstevel@tonic-gate # ifdef __PARAGON__
618*7c478bd9Sstevel@tonic-gate #  define __osf__	1	/* get OSF/1 defines below */
619*7c478bd9Sstevel@tonic-gate #  ifndef TZ_TYPE
620*7c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
621*7c478bd9Sstevel@tonic-gate #  endif /* ! TZ_TYPE */
622*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
623*7c478bd9Sstevel@tonic-gate #  define MAXNAMLEN	NAME_MAX
624*7c478bd9Sstevel@tonic-gate # endif /* __PARAGON__ */
625*7c478bd9Sstevel@tonic-gate 
626*7c478bd9Sstevel@tonic-gate 
627*7c478bd9Sstevel@tonic-gate /*
628*7c478bd9Sstevel@tonic-gate **  Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1
629*7c478bd9Sstevel@tonic-gate **
630*7c478bd9Sstevel@tonic-gate **	Tested for 3.2 and 4.0.
631*7c478bd9Sstevel@tonic-gate */
632*7c478bd9Sstevel@tonic-gate 
633*7c478bd9Sstevel@tonic-gate # ifdef __osf__
634*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* has uname(2) call */
635*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
636*7c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
637*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
638*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
639*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) syscall */
640*7c478bd9Sstevel@tonic-gate #  define HASSETLOGIN	1	/* has setlogin(2) */
641*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	1	/* can check IP source routing */
642*7c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
643*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
644*7c478bd9Sstevel@tonic-gate #  define SM_INT32	int	/* 32bit integer */
645*7c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
646*7c478bd9Sstevel@tonic-gate #   include <standards.h>
647*7c478bd9Sstevel@tonic-gate #   if _XOPEN_SOURCE+0 >= 400
648*7c478bd9Sstevel@tonic-gate #    define HASFLOCK	0	/* 5.0 and later has bad flock(2) call */
649*7c478bd9Sstevel@tonic-gate #   else /* _XOPEN_SOURCE+0 >= 400 */
650*7c478bd9Sstevel@tonic-gate #    define HASFLOCK	1	/* has flock(2) call */
651*7c478bd9Sstevel@tonic-gate #   endif /* _XOPEN_SOURCE+0 >= 400 */
652*7c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
653*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_ALPHAOSF
654*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATVFS	/* use <sys/statvfs.h> statfs() impl */
655*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
656*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/var/adm/sendmail/sendmail.cf"
657*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
658*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
659*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
660*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
661*7c478bd9Sstevel@tonic-gate #  if _FFR_DIGUNIX_SAFECHOWN
662*7c478bd9Sstevel@tonic-gate /*
663*7c478bd9Sstevel@tonic-gate **  Testing on a Digital UNIX 4.0a system showed this to be the correct
664*7c478bd9Sstevel@tonic-gate **  setting but given the security consequences, more testing and
665*7c478bd9Sstevel@tonic-gate **  verification is needed.  Unfortunately, the man page offers no
666*7c478bd9Sstevel@tonic-gate **  assistance.
667*7c478bd9Sstevel@tonic-gate */
668*7c478bd9Sstevel@tonic-gate #   define IS_SAFE_CHOWN >= 0
669*7c478bd9Sstevel@tonic-gate #  endif /* _FFR_DIGUNIX_SAFECHOWN */
670*7c478bd9Sstevel@tonic-gate # endif /* __osf__ */
671*7c478bd9Sstevel@tonic-gate 
672*7c478bd9Sstevel@tonic-gate 
673*7c478bd9Sstevel@tonic-gate /*
674*7c478bd9Sstevel@tonic-gate **  NeXTstep
675*7c478bd9Sstevel@tonic-gate */
676*7c478bd9Sstevel@tonic-gate 
677*7c478bd9Sstevel@tonic-gate # ifdef NeXT
678*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
679*7c478bd9Sstevel@tonic-gate #  define NEEDPUTENV	2	/* need putenv(3) call; no setenv(3) call */
680*7c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
681*7c478bd9Sstevel@tonic-gate #   define HASFLOCK	1	/* has flock(2) call */
682*7c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
683*7c478bd9Sstevel@tonic-gate #  define UID_T		int	/* compiler gripes on uid_t */
684*7c478bd9Sstevel@tonic-gate #  define GID_T		int	/* ditto for gid_t */
685*7c478bd9Sstevel@tonic-gate #  define MODE_T	int	/* and mode_t */
686*7c478bd9Sstevel@tonic-gate #  define setpgid	setpgrp
687*7c478bd9Sstevel@tonic-gate #  ifndef NOT_SENDMAIL
688*7c478bd9Sstevel@tonic-gate #   define sleep		sleepX
689*7c478bd9Sstevel@tonic-gate #  endif /* ! NOT_SENDMAIL */
690*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
691*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_MACH
692*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
693*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
694*7c478bd9Sstevel@tonic-gate #  ifdef _POSIX_SOURCE
695*7c478bd9Sstevel@tonic-gate extern struct passwd	*getpwent();
696*7c478bd9Sstevel@tonic-gate #  else /* _POSIX_SOURCE */
697*7c478bd9Sstevel@tonic-gate #   define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
698*7c478bd9Sstevel@tonic-gate #   define WAITUNION	1	/* use "union wait" as wait argument type */
699*7c478bd9Sstevel@tonic-gate typedef int		pid_t;
700*7c478bd9Sstevel@tonic-gate #   undef WEXITSTATUS
701*7c478bd9Sstevel@tonic-gate #   undef WIFEXITED
702*7c478bd9Sstevel@tonic-gate #   undef WIFSTOPPED
703*7c478bd9Sstevel@tonic-gate #   undef WTERMSIG
704*7c478bd9Sstevel@tonic-gate #  endif /* _POSIX_SOURCE */
705*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
706*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/etc/sendmail/sendmail.cf"
707*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
708*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
709*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
710*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
711*7c478bd9Sstevel@tonic-gate #  define SM_INT32	int	/* 32bit integer */
712*7c478bd9Sstevel@tonic-gate 
713*7c478bd9Sstevel@tonic-gate #  ifdef TCPWRAPPERS
714*7c478bd9Sstevel@tonic-gate #   ifndef HASUNSETENV
715*7c478bd9Sstevel@tonic-gate #    define HASUNSETENV	1
716*7c478bd9Sstevel@tonic-gate #   endif /* ! HASUNSETENV */
717*7c478bd9Sstevel@tonic-gate #   undef NEEDPUTENV
718*7c478bd9Sstevel@tonic-gate #  endif /* TCPWRAPPERS */
719*7c478bd9Sstevel@tonic-gate #  ifndef __APPLE__
720*7c478bd9Sstevel@tonic-gate #   include <libc.h>
721*7c478bd9Sstevel@tonic-gate #   ifndef S_IRUSR
722*7c478bd9Sstevel@tonic-gate #    define S_IRUSR	S_IREAD
723*7c478bd9Sstevel@tonic-gate #   endif /* ! S_IRUSR */
724*7c478bd9Sstevel@tonic-gate #   ifndef S_IWUSR
725*7c478bd9Sstevel@tonic-gate #    define S_IWUSR	S_IWRITE
726*7c478bd9Sstevel@tonic-gate #   endif /* ! S_IWUSR */
727*7c478bd9Sstevel@tonic-gate #   define _PATH_MAILDIR	"/usr/spool/mail"
728*7c478bd9Sstevel@tonic-gate #  endif /* ! __APPLE__ */
729*7c478bd9Sstevel@tonic-gate #  ifndef isascii
730*7c478bd9Sstevel@tonic-gate #   define isascii(c)	((unsigned)(c) <= 0177)
731*7c478bd9Sstevel@tonic-gate #  endif /* ! isascii */
732*7c478bd9Sstevel@tonic-gate # endif /* NeXT */
733*7c478bd9Sstevel@tonic-gate 
734*7c478bd9Sstevel@tonic-gate /*
735*7c478bd9Sstevel@tonic-gate **  Apple Darwin
736*7c478bd9Sstevel@tonic-gate **      Contributed by Wilfredo Sanchez <wsanchez@mit.edu>
737*7c478bd9Sstevel@tonic-gate */
738*7c478bd9Sstevel@tonic-gate 
739*7c478bd9Sstevel@tonic-gate # if defined(DARWIN)
740*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD		1	/* has fchmod(2) */
741*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN		1	/* has fchown(2) */
742*7c478bd9Sstevel@tonic-gate #  define HASFLOCK		1	/* has flock(2) */
743*7c478bd9Sstevel@tonic-gate #  define HASUNAME		1	/* has uname(2) */
744*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV		1	/* has unsetenv(3) */
745*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
746*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) */
747*7c478bd9Sstevel@tonic-gate #  define HASSETVBUF		1	/* has setvbuf (3) */
748*7c478bd9Sstevel@tonic-gate #  define HASSETREUID		0	/* setreuid(2) unusable */
749*7c478bd9Sstevel@tonic-gate #  define HASSETEUID		1	/* has seteuid(2) */
750*7c478bd9Sstevel@tonic-gate #  define USESETEUID		1	/* has seteuid(2) */
751*7c478bd9Sstevel@tonic-gate #  define HASSETEGID		1	/* has setegid(2) */
752*7c478bd9Sstevel@tonic-gate #  define HASSETREGID		1	/* has setregid(2) */
753*7c478bd9Sstevel@tonic-gate #  define HASSETRESGID		0	/* no setresgid(2) */
754*7c478bd9Sstevel@tonic-gate #  define HASLSTAT		1	/* has lstat(2) */
755*7c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT		1	/* has setrlimit(2) */
756*7c478bd9Sstevel@tonic-gate #  define HASWAITPID		1	/* has waitpid(2) */
757*7c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE	1	/* has getdtablesize(2) */
758*7c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN		1	/* has st_gen field in struct stat */
759*7c478bd9Sstevel@tonic-gate #  define HASURANDOMDEV	1	/* has urandom(4) */
760*7c478bd9Sstevel@tonic-gate #  define HASSTRERROR		1	/* has strerror(3) */
761*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL	1	/* had getusershell(3) */
762*7c478bd9Sstevel@tonic-gate #  define GIDSET_T		gid_t	/* getgroups(2) takes gid_t */
763*7c478bd9Sstevel@tonic-gate #  define LA_TYPE		LA_SUBR	/* use getloadavg(3) */
764*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE		SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
765*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE		SPT_PSSTRINGS	/* use magic PS_STRINGS pointer for setproctitle */
766*7c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED		/* don't declare sys_errlist */
767*7c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR		/* struct sockaddr has sa_len */
768*7c478bd9Sstevel@tonic-gate #  define SAFENFSPATHCONF	0	/* unverified: pathconf(2) doesn't work on NFS */
769*7c478bd9Sstevel@tonic-gate #  define HAS_IN_H		1
770*7c478bd9Sstevel@tonic-gate #  define NETLINK		1	/* supports AF_LINK */
771*7c478bd9Sstevel@tonic-gate #  ifndef NOT_SENDMAIL
772*7c478bd9Sstevel@tonic-gate #   define sleep sleepX
773*7c478bd9Sstevel@tonic-gate extern unsigned int sleepX __P((unsigned int seconds));
774*7c478bd9Sstevel@tonic-gate #  endif /* ! NOT_SENDMAIL */
775*7c478bd9Sstevel@tonic-gate # endif /* defined(DARWIN) */
776*7c478bd9Sstevel@tonic-gate 
777*7c478bd9Sstevel@tonic-gate 
778*7c478bd9Sstevel@tonic-gate /*
779*7c478bd9Sstevel@tonic-gate **  4.4 BSD
780*7c478bd9Sstevel@tonic-gate **
781*7c478bd9Sstevel@tonic-gate **	See also BSD defines.
782*7c478bd9Sstevel@tonic-gate */
783*7c478bd9Sstevel@tonic-gate 
784*7c478bd9Sstevel@tonic-gate # if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__)
785*7c478bd9Sstevel@tonic-gate #  include <paths.h>
786*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
787*7c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
788*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
789*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) syscall */
790*7c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
791*7c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
792*7c478bd9Sstevel@tonic-gate #  include <sys/cdefs.h>
793*7c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
794*7c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR	/* has sa_len */
795*7c478bd9Sstevel@tonic-gate #  define NEED_PRINTF_PERCENTQ	1	/* doesn't have %lld */
796*7c478bd9Sstevel@tonic-gate #  define NETLINK	1	/* supports AF_LINK */
797*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
798*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_SUBR
799*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
800*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
801*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
802*7c478bd9Sstevel@tonic-gate # endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) */
803*7c478bd9Sstevel@tonic-gate 
804*7c478bd9Sstevel@tonic-gate 
805*7c478bd9Sstevel@tonic-gate /*
806*7c478bd9Sstevel@tonic-gate **  BSD/OS (was BSD/386) (all versions)
807*7c478bd9Sstevel@tonic-gate **	From Tony Sanders, BSDI
808*7c478bd9Sstevel@tonic-gate */
809*7c478bd9Sstevel@tonic-gate 
810*7c478bd9Sstevel@tonic-gate # ifdef __bsdi__
811*7c478bd9Sstevel@tonic-gate #  include <paths.h>
812*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has the unsetenv(3) call */
813*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	0	/* BSD-OS has broken setreuid(2) emulation */
814*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
815*7c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
816*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
817*7c478bd9Sstevel@tonic-gate #  define HASSETLOGIN	1	/* has setlogin(2) */
818*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* has uname(2) syscall */
819*7c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
820*7c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
821*7c478bd9Sstevel@tonic-gate #  include <sys/cdefs.h>
822*7c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
823*7c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR	/* has sa_len */
824*7c478bd9Sstevel@tonic-gate #  define NETLINK	1	/* supports AF_LINK */
825*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
826*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
827*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_SUBR
828*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
829*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
830*7c478bd9Sstevel@tonic-gate #  define QUAD_T		quad_t
831*7c478bd9Sstevel@tonic-gate #  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
832*7c478bd9Sstevel@tonic-gate 			/* version 1.1 or later */
833*7c478bd9Sstevel@tonic-gate #   undef SPT_TYPE
834*7c478bd9Sstevel@tonic-gate #   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
835*7c478bd9Sstevel@tonic-gate #  else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
836*7c478bd9Sstevel@tonic-gate 			/* version 1.0 or earlier */
837*7c478bd9Sstevel@tonic-gate #   define SPT_PADCHAR	'\0'	/* pad process title with nulls */
838*7c478bd9Sstevel@tonic-gate #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
839*7c478bd9Sstevel@tonic-gate #  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701	/* on 3.x */
840*7c478bd9Sstevel@tonic-gate #   define HASSETUSERCONTEXT 1	/* has setusercontext */
841*7c478bd9Sstevel@tonic-gate #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */
842*7c478bd9Sstevel@tonic-gate #  if defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701	/* 3.1 and earlier */
843*7c478bd9Sstevel@tonic-gate #   define MODE_T	int	/* va_arg() can't handle less than int */
844*7c478bd9Sstevel@tonic-gate #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 */
845*7c478bd9Sstevel@tonic-gate #  if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910	/* on 4.x */
846*7c478bd9Sstevel@tonic-gate #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
847*7c478bd9Sstevel@tonic-gate #  endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 */
848*7c478bd9Sstevel@tonic-gate # endif /* __bsdi__ */
849*7c478bd9Sstevel@tonic-gate 
850*7c478bd9Sstevel@tonic-gate 
851*7c478bd9Sstevel@tonic-gate /*
852*7c478bd9Sstevel@tonic-gate **  QNX 4.2x
853*7c478bd9Sstevel@tonic-gate **	Contributed by Glen McCready <glen@qnx.com>.
854*7c478bd9Sstevel@tonic-gate **
855*7c478bd9Sstevel@tonic-gate **	Should work with all versions of QNX.
856*7c478bd9Sstevel@tonic-gate */
857*7c478bd9Sstevel@tonic-gate 
858*7c478bd9Sstevel@tonic-gate # if defined(__QNX__)
859*7c478bd9Sstevel@tonic-gate #  include <unix.h>
860*7c478bd9Sstevel@tonic-gate #  include <sys/select.h>
861*7c478bd9Sstevel@tonic-gate #  undef NGROUPS_MAX
862*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
863*7c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
864*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
865*7c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
866*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
867*7c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
868*7c478bd9Sstevel@tonic-gate #  define HASFLOCK	0
869*7c478bd9Sstevel@tonic-gate #  undef HASINITGROUPS		/* has initgroups(3) call */
870*7c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
871*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	1	/* can check IP source routing */
872*7c478bd9Sstevel@tonic-gate #  define TZ_TYPE	TZ_TMNAME	/* use tmname variable */
873*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
874*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_ZERO
875*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_NONE
876*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_REUSEARGV
877*7c478bd9Sstevel@tonic-gate #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
878*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0
879*7c478bd9Sstevel@tonic-gate #  define E_PSEUDOBASE	512
880*7c478bd9Sstevel@tonic-gate #  define _FILE_H_INCLUDED
881*7c478bd9Sstevel@tonic-gate # endif /* defined(__QNX__) */
882*7c478bd9Sstevel@tonic-gate 
883*7c478bd9Sstevel@tonic-gate 
884*7c478bd9Sstevel@tonic-gate /*
885*7c478bd9Sstevel@tonic-gate **  DragonFly BSD/ FreeBSD / NetBSD / OpenBSD (all architectures, all versions)
886*7c478bd9Sstevel@tonic-gate **
887*7c478bd9Sstevel@tonic-gate **  4.3BSD clone, closer to 4.4BSD	for FreeBSD 1.x and NetBSD 0.9x
888*7c478bd9Sstevel@tonic-gate **  4.4BSD-Lite based			for FreeBSD 2.x and NetBSD 1.x
889*7c478bd9Sstevel@tonic-gate **
890*7c478bd9Sstevel@tonic-gate **	See also BSD defines.
891*7c478bd9Sstevel@tonic-gate */
892*7c478bd9Sstevel@tonic-gate 
893*7c478bd9Sstevel@tonic-gate # if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
894*7c478bd9Sstevel@tonic-gate #  include <paths.h>
895*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
896*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
897*7c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
898*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
899*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) syscall */
900*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* has uname(2) syscall */
901*7c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
902*7c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
903*7c478bd9Sstevel@tonic-gate #  define NEED_PRINTF_PERCENTQ	1	/* doesn't have %lld */
904*7c478bd9Sstevel@tonic-gate #  include <sys/cdefs.h>
905*7c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
906*7c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR	/* has sa_len */
907*7c478bd9Sstevel@tonic-gate #  define NETLINK	1	/* supports AF_LINK */
908*7c478bd9Sstevel@tonic-gate #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
909*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
910*7c478bd9Sstevel@tonic-gate #  define QUAD_T		unsigned long long
911*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
912*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_SUBR
913*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
914*7c478bd9Sstevel@tonic-gate #  if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 200040000
915*7c478bd9Sstevel@tonic-gate #   undef SFS_TYPE
916*7c478bd9Sstevel@tonic-gate #   define SFS_TYPE	SFS_STATVFS
917*7c478bd9Sstevel@tonic-gate #  else
918*7c478bd9Sstevel@tonic-gate #   define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
919*7c478bd9Sstevel@tonic-gate #  endif
920*7c478bd9Sstevel@tonic-gate #  if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1)
921*7c478bd9Sstevel@tonic-gate #   undef SPT_TYPE
922*7c478bd9Sstevel@tonic-gate #   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
923*7c478bd9Sstevel@tonic-gate #  endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */
924*7c478bd9Sstevel@tonic-gate #  if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3))
925*7c478bd9Sstevel@tonic-gate #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
926*7c478bd9Sstevel@tonic-gate #  endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */
927*7c478bd9Sstevel@tonic-gate #  if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104170000
928*7c478bd9Sstevel@tonic-gate #   define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
929*7c478bd9Sstevel@tonic-gate #  endif
930*7c478bd9Sstevel@tonic-gate #  if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 200060000
931*7c478bd9Sstevel@tonic-gate #   define HASCLOSEFROM	1	/* closefrom(3) added in 2.0F */
932*7c478bd9Sstevel@tonic-gate #  endif
933*7c478bd9Sstevel@tonic-gate #  if defined(__NetBSD__)
934*7c478bd9Sstevel@tonic-gate #   define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
935*7c478bd9Sstevel@tonic-gate #   include <sys/param.h>
936*7c478bd9Sstevel@tonic-gate #   include <sys/sysctl.h>
937*7c478bd9Sstevel@tonic-gate #  endif
938*7c478bd9Sstevel@tonic-gate #  if defined(__DragonFly__)
939*7c478bd9Sstevel@tonic-gate #   define HASSETLOGIN		1	/* has setlogin(2) */
940*7c478bd9Sstevel@tonic-gate #   define HASSRANDOMDEV	1	/* has srandomdev(3) */
941*7c478bd9Sstevel@tonic-gate #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
942*7c478bd9Sstevel@tonic-gate #   undef SPT_TYPE
943*7c478bd9Sstevel@tonic-gate #   include <libutil.h>
944*7c478bd9Sstevel@tonic-gate #   define SPT_TYPE		SPT_BUILTIN
945*7c478bd9Sstevel@tonic-gate #   define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
946*7c478bd9Sstevel@tonic-gate #   ifndef SMRSH_CMDDIR
947*7c478bd9Sstevel@tonic-gate #    define SMRSH_CMDDIR	"/usr/libexec/sm.bin"
948*7c478bd9Sstevel@tonic-gate #   endif /* ! SMRSH_CMDDIR */
949*7c478bd9Sstevel@tonic-gate #   ifndef SMRSH_PATH
950*7c478bd9Sstevel@tonic-gate #    define SMRSH_PATH		"/bin:/usr/bin"
951*7c478bd9Sstevel@tonic-gate #   endif /* ! SMRSH_PATH */
952*7c478bd9Sstevel@tonic-gate #  define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
953*7c478bd9Sstevel@tonic-gate #  include <sys/sysctl.h>
954*7c478bd9Sstevel@tonic-gate #  endif /* defined(__DragonFly__) */
955*7c478bd9Sstevel@tonic-gate #  if defined(__FreeBSD__)
956*7c478bd9Sstevel@tonic-gate #   define HASSETLOGIN	1	/* has setlogin(2) */
957*7c478bd9Sstevel@tonic-gate #   if __FreeBSD_version >= 227001
958*7c478bd9Sstevel@tonic-gate #    define HASSRANDOMDEV	1	/* has srandomdev(3) */
959*7c478bd9Sstevel@tonic-gate #    define HASURANDOMDEV	1	/* has /dev/urandom(4) */
960*7c478bd9Sstevel@tonic-gate #   endif /* __FreeBSD_version >= 227001 */
961*7c478bd9Sstevel@tonic-gate #   undef SPT_TYPE
962*7c478bd9Sstevel@tonic-gate #   if __FreeBSD__ >= 2
963*7c478bd9Sstevel@tonic-gate #    include <osreldate.h>
964*7c478bd9Sstevel@tonic-gate #    if __FreeBSD_version >= 199512	/* 2.2-current when it appeared */
965*7c478bd9Sstevel@tonic-gate #     include <libutil.h>
966*7c478bd9Sstevel@tonic-gate #     define SPT_TYPE	SPT_BUILTIN
967*7c478bd9Sstevel@tonic-gate #    endif /* __FreeBSD_version >= 199512 */
968*7c478bd9Sstevel@tonic-gate #    if __FreeBSD_version >= 222000	/* 2.2.2-release and later */
969*7c478bd9Sstevel@tonic-gate #     define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
970*7c478bd9Sstevel@tonic-gate #    endif /* __FreeBSD_version >= 222000 */
971*7c478bd9Sstevel@tonic-gate #    if __FreeBSD_version >= 330000	/* 3.3.0-release and later */
972*7c478bd9Sstevel@tonic-gate #     ifndef SMRSH_CMDDIR
973*7c478bd9Sstevel@tonic-gate #      define SMRSH_CMDDIR	"/usr/libexec/sm.bin"
974*7c478bd9Sstevel@tonic-gate #     endif /* ! SMRSH_CMDDIR */
975*7c478bd9Sstevel@tonic-gate #     ifndef SMRSH_PATH
976*7c478bd9Sstevel@tonic-gate #      define SMRSH_PATH	"/bin:/usr/bin"
977*7c478bd9Sstevel@tonic-gate #     endif /* ! SMRSH_PATH */
978*7c478bd9Sstevel@tonic-gate #    endif /* __FreeBSD_version >= 330000 */
979*7c478bd9Sstevel@tonic-gate #    define USESYSCTL		1	/* use sysctl(3) for getting ncpus */
980*7c478bd9Sstevel@tonic-gate #    include <sys/sysctl.h>
981*7c478bd9Sstevel@tonic-gate #   endif /* __FreeBSD__ >= 2 */
982*7c478bd9Sstevel@tonic-gate #   ifndef SPT_TYPE
983*7c478bd9Sstevel@tonic-gate #    define SPT_TYPE	SPT_REUSEARGV
984*7c478bd9Sstevel@tonic-gate #    define SPT_PADCHAR	'\0'		/* pad process title with nulls */
985*7c478bd9Sstevel@tonic-gate #   endif /* ! SPT_TYPE */
986*7c478bd9Sstevel@tonic-gate #  endif /* defined(__FreeBSD__) */
987*7c478bd9Sstevel@tonic-gate #  if defined(__OpenBSD__)
988*7c478bd9Sstevel@tonic-gate #   undef SPT_TYPE
989*7c478bd9Sstevel@tonic-gate #   define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
990*7c478bd9Sstevel@tonic-gate #   define HASSETLOGIN	1	/* has setlogin(2) */
991*7c478bd9Sstevel@tonic-gate #   if OpenBSD < 200305
992*7c478bd9Sstevel@tonic-gate #    define HASSETREUID	0	/* setreuid(2) broken in OpenBSD < 3.3 */
993*7c478bd9Sstevel@tonic-gate #   endif /* OpenBSD < 200305 */
994*7c478bd9Sstevel@tonic-gate #   define HASSETEGID	1	/* use setegid(2) to set saved gid */
995*7c478bd9Sstevel@tonic-gate #   define HASURANDOMDEV	1	/* has /dev/urandom(4) */
996*7c478bd9Sstevel@tonic-gate #   if OpenBSD >= 200006
997*7c478bd9Sstevel@tonic-gate #    define HASSRANDOMDEV	1	/* has srandomdev(3) */
998*7c478bd9Sstevel@tonic-gate #   endif /* OpenBSD >= 200006 */
999*7c478bd9Sstevel@tonic-gate #   if OpenBSD >= 200012
1000*7c478bd9Sstevel@tonic-gate #    define HASSETUSERCONTEXT	1	/* BSDI-style login classes */
1001*7c478bd9Sstevel@tonic-gate #   endif /* OpenBSD >= 200012 */
1002*7c478bd9Sstevel@tonic-gate #   if OpenBSD >= 200405
1003*7c478bd9Sstevel@tonic-gate #    define HASCLOSEFROM	1	/* closefrom(3) added in 3.5 */
1004*7c478bd9Sstevel@tonic-gate #   endif /* OpenBSD >= 200405 */
1005*7c478bd9Sstevel@tonic-gate #  endif /* defined(__OpenBSD__) */
1006*7c478bd9Sstevel@tonic-gate # endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */
1007*7c478bd9Sstevel@tonic-gate 
1008*7c478bd9Sstevel@tonic-gate 
1009*7c478bd9Sstevel@tonic-gate /*
1010*7c478bd9Sstevel@tonic-gate **  Mach386
1011*7c478bd9Sstevel@tonic-gate **
1012*7c478bd9Sstevel@tonic-gate **	For mt Xinu's Mach386 system.
1013*7c478bd9Sstevel@tonic-gate */
1014*7c478bd9Sstevel@tonic-gate 
1015*7c478bd9Sstevel@tonic-gate # if defined(MACH) && defined(i386) && !defined(__GNU__)
1016*7c478bd9Sstevel@tonic-gate #  define MACH386	1
1017*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
1018*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
1019*7c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
1020*7c478bd9Sstevel@tonic-gate #   define HASFLOCK	1	/* has flock(2) call */
1021*7c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
1022*7c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
1023*7c478bd9Sstevel@tonic-gate #  define NEEDSTRTOL	1	/* need the strtol() function */
1024*7c478bd9Sstevel@tonic-gate #  define setpgid	setpgrp
1025*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
1026*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_FLOAT
1027*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
1028*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1029*7c478bd9Sstevel@tonic-gate #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
1030*7c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
1031*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
1032*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1033*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1034*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1035*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
1036*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
1037*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
1038*7c478bd9Sstevel@tonic-gate # endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */
1039*7c478bd9Sstevel@tonic-gate 
1040*7c478bd9Sstevel@tonic-gate 
1041*7c478bd9Sstevel@tonic-gate 
1042*7c478bd9Sstevel@tonic-gate /*
1043*7c478bd9Sstevel@tonic-gate **  GNU OS (hurd)
1044*7c478bd9Sstevel@tonic-gate **	Largely BSD & posix compatible.
1045*7c478bd9Sstevel@tonic-gate **	Port contributed by Miles Bader <miles@gnu.ai.mit.edu>.
1046*7c478bd9Sstevel@tonic-gate **	Updated by Mark Kettenis <kettenis@wins.uva.nl>.
1047*7c478bd9Sstevel@tonic-gate */
1048*7c478bd9Sstevel@tonic-gate 
1049*7c478bd9Sstevel@tonic-gate # if defined(__GNU__) && !defined(NeXT)
1050*7c478bd9Sstevel@tonic-gate #  include <paths.h>
1051*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) call */
1052*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) call */
1053*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* has uname(2) call */
1054*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
1055*7c478bd9Sstevel@tonic-gate #  define HAS_ST_GEN	1	/* has st_gen field in stat struct */
1056*7c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
1057*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
1058*7c478bd9Sstevel@tonic-gate #  define SOCKADDR_LEN_T	socklen_t
1059*7c478bd9Sstevel@tonic-gate #  define SOCKOPT_LEN_T	socklen_t
1060*7c478bd9Sstevel@tonic-gate #  if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2
1061*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_SUBR
1062*7c478bd9Sstevel@tonic-gate #  else /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
1063*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_MACH
1064*7c478bd9Sstevel@tonic-gate    /* GNU uses mach[34], which renames some rpcs from mach2.x. */
1065*7c478bd9Sstevel@tonic-gate #   define host_self	mach_host_self
1066*7c478bd9Sstevel@tonic-gate #  endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
1067*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATFS
1068*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_CHANGEARGV
1069*7c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED	1	/* don't declare sys_errlist */
1070*7c478bd9Sstevel@tonic-gate #  define BSD4_4_SOCKADDR	1	/* has sa_len */
1071*7c478bd9Sstevel@tonic-gate #  define SIOCGIFCONF_IS_BROKEN  1	/* SIOCGFCONF doesn't work */
1072*7c478bd9Sstevel@tonic-gate #  define HAS_IN_H	1	/* GNU has netinet/in.h. */
1073*7c478bd9Sstevel@tonic-gate /* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */
1074*7c478bd9Sstevel@tonic-gate #  define MAXPATHLEN	2048
1075*7c478bd9Sstevel@tonic-gate # endif /* defined(__GNU__) && !defined(NeXT) */
1076*7c478bd9Sstevel@tonic-gate 
1077*7c478bd9Sstevel@tonic-gate /*
1078*7c478bd9Sstevel@tonic-gate **  4.3 BSD -- this is for very old systems
1079*7c478bd9Sstevel@tonic-gate **
1080*7c478bd9Sstevel@tonic-gate **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
1081*7c478bd9Sstevel@tonic-gate **
1082*7c478bd9Sstevel@tonic-gate **	You'll also have to install a new resolver library.
1083*7c478bd9Sstevel@tonic-gate **	I don't guarantee that support for this environment is complete.
1084*7c478bd9Sstevel@tonic-gate */
1085*7c478bd9Sstevel@tonic-gate 
1086*7c478bd9Sstevel@tonic-gate # if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
1087*7c478bd9Sstevel@tonic-gate #  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
1088*7c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
1089*7c478bd9Sstevel@tonic-gate #  define ARBPTR_T	char *
1090*7c478bd9Sstevel@tonic-gate #  define setpgid	setpgrp
1091*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
1092*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_FLOAT
1093*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
1094*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1095*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1096*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1097*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
1098*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
1099*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
1100*7c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
1101*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
1102*7c478bd9Sstevel@tonic-gate typedef short		pid_t;
1103*7c478bd9Sstevel@tonic-gate # endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */
1104*7c478bd9Sstevel@tonic-gate 
1105*7c478bd9Sstevel@tonic-gate 
1106*7c478bd9Sstevel@tonic-gate /*
1107*7c478bd9Sstevel@tonic-gate **  SCO Unix
1108*7c478bd9Sstevel@tonic-gate **
1109*7c478bd9Sstevel@tonic-gate **	This includes three parts:
1110*7c478bd9Sstevel@tonic-gate **
1111*7c478bd9Sstevel@tonic-gate **	The first is for SCO OpenServer 5.
1112*7c478bd9Sstevel@tonic-gate **	(Contributed by Keith Reynolds <keithr@sco.COM>).
1113*7c478bd9Sstevel@tonic-gate **
1114*7c478bd9Sstevel@tonic-gate **		SCO OpenServer 5 has a compiler version number macro,
1115*7c478bd9Sstevel@tonic-gate **		which we can use to figure out what version we're on.
1116*7c478bd9Sstevel@tonic-gate **		This may have to change in future releases.
1117*7c478bd9Sstevel@tonic-gate **
1118*7c478bd9Sstevel@tonic-gate **	The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0.
1119*7c478bd9Sstevel@tonic-gate **	(Contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
1120*7c478bd9Sstevel@tonic-gate **
1121*7c478bd9Sstevel@tonic-gate **	The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier.
1122*7c478bd9Sstevel@tonic-gate */
1123*7c478bd9Sstevel@tonic-gate 
1124*7c478bd9Sstevel@tonic-gate /* SCO OpenServer 5 */
1125*7c478bd9Sstevel@tonic-gate # if _SCO_DS >= 1
1126*7c478bd9Sstevel@tonic-gate #  include <paths.h>
1127*7c478bd9Sstevel@tonic-gate #  define SIOCGIFNUM_IS_BROKEN 1	/* SIOCGIFNUM returns bogus value */
1128*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) call */
1129*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) call */
1130*7c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
1131*7c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has seteuid(2) call */
1132*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
1133*7c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
1134*7c478bd9Sstevel@tonic-gate #  define RLIMIT_NEEDS_SYS_TIME_H	1
1135*7c478bd9Sstevel@tonic-gate #  define LDA_USE_LOCKF	1
1136*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
1137*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_DEVSHORT
1138*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
1139*7c478bd9Sstevel@tonic-gate #  define _PATH_AVENRUN	"/dev/table/avenrun"
1140*7c478bd9Sstevel@tonic-gate #  ifndef _SCO_unix_4_2
1141*7c478bd9Sstevel@tonic-gate #   define _SCO_unix_4_2
1142*7c478bd9Sstevel@tonic-gate #  else /* ! _SCO_unix_4_2 */
1143*7c478bd9Sstevel@tonic-gate #   define SOCKADDR_LEN_T	size_t	/* e.g., arg#3 to accept, getsockname */
1144*7c478bd9Sstevel@tonic-gate #   define SOCKOPT_LEN_T	size_t	/* arg#5 to getsockopt */
1145*7c478bd9Sstevel@tonic-gate #  endif /* ! _SCO_unix_4_2 */
1146*7c478bd9Sstevel@tonic-gate # endif /* _SCO_DS >= 1 */
1147*7c478bd9Sstevel@tonic-gate 
1148*7c478bd9Sstevel@tonic-gate /* SCO UNIX 3.2v4.2/Open Desktop 3.0 */
1149*7c478bd9Sstevel@tonic-gate # ifdef _SCO_unix_4_2
1150*7c478bd9Sstevel@tonic-gate #  define _SCO_unix_
1151*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
1152*7c478bd9Sstevel@tonic-gate # endif /* _SCO_unix_4_2 */
1153*7c478bd9Sstevel@tonic-gate 
1154*7c478bd9Sstevel@tonic-gate /* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */
1155*7c478bd9Sstevel@tonic-gate # ifdef _SCO_unix_
1156*7c478bd9Sstevel@tonic-gate #  include <sys/stream.h>	/* needed for IP_SRCROUTE */
1157*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* include all the System V defines */
1158*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1159*7c478bd9Sstevel@tonic-gate #  define NOFTRUNCATE	0	/* has (simulated) ftruncate call */
1160*7c478bd9Sstevel@tonic-gate #  ifndef USE_SIGLONGJMP
1161*7c478bd9Sstevel@tonic-gate #   define USE_SIGLONGJMP	1 /* sigsetjmp needed for signal handling */
1162*7c478bd9Sstevel@tonic-gate #  endif /* ! USE_SIGLONGJMP */
1163*7c478bd9Sstevel@tonic-gate #  define MAXPATHLEN	PATHSIZE
1164*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
1165*7c478bd9Sstevel@tonic-gate #  define SFS_BAVAIL	f_bfree		/* alternate field name */
1166*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_SCO		/* write kernel u. area */
1167*7c478bd9Sstevel@tonic-gate #  define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
1168*7c478bd9Sstevel@tonic-gate #  define UID_T		uid_t
1169*7c478bd9Sstevel@tonic-gate #  define GID_T		gid_t
1170*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
1171*7c478bd9Sstevel@tonic-gate #  define _PATH_UNIX		"/unix"
1172*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1173*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1174*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1175*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
1176*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
1177*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
1178*7c478bd9Sstevel@tonic-gate 
1179*7c478bd9Sstevel@tonic-gate /* stuff fixed in later releases */
1180*7c478bd9Sstevel@tonic-gate #  ifndef _SCO_unix_4_2
1181*7c478bd9Sstevel@tonic-gate #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1182*7c478bd9Sstevel@tonic-gate #  endif /* ! _SCO_unix_4_2 */
1183*7c478bd9Sstevel@tonic-gate 
1184*7c478bd9Sstevel@tonic-gate #  ifndef _SCO_DS
1185*7c478bd9Sstevel@tonic-gate #   define ftruncate	chsize	/* use chsize(2) to emulate ftruncate */
1186*7c478bd9Sstevel@tonic-gate #   define NEEDFSYNC	1	/* needs the fsync(2) call stub */
1187*7c478bd9Sstevel@tonic-gate #   define NETUNIX	0	/* no unix domain socket support */
1188*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_SHORT
1189*7c478bd9Sstevel@tonic-gate #  endif /* ! _SCO_DS */
1190*7c478bd9Sstevel@tonic-gate 
1191*7c478bd9Sstevel@tonic-gate # endif /* _SCO_unix_ */
1192*7c478bd9Sstevel@tonic-gate 
1193*7c478bd9Sstevel@tonic-gate /*
1194*7c478bd9Sstevel@tonic-gate **  ISC (SunSoft) Unix.
1195*7c478bd9Sstevel@tonic-gate **
1196*7c478bd9Sstevel@tonic-gate **	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
1197*7c478bd9Sstevel@tonic-gate */
1198*7c478bd9Sstevel@tonic-gate 
1199*7c478bd9Sstevel@tonic-gate # ifdef ISC_UNIX
1200*7c478bd9Sstevel@tonic-gate #  include <net/errno.h>
1201*7c478bd9Sstevel@tonic-gate #  include <sys/stream.h>	/* needed for IP_SRCROUTE */
1202*7c478bd9Sstevel@tonic-gate #  include <sys/bsdtypes.h>
1203*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* include all the System V defines */
1204*7c478bd9Sstevel@tonic-gate #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1205*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1206*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
1207*7c478bd9Sstevel@tonic-gate #  define NEEDFSYNC	1	/* needs the fsync(2) call stub */
1208*7c478bd9Sstevel@tonic-gate #  define NETUNIX	0	/* no unix domain socket support */
1209*7c478bd9Sstevel@tonic-gate #  define MAXPATHLEN	1024
1210*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_SHORT
1211*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
1212*7c478bd9Sstevel@tonic-gate #  define SFS_BAVAIL	f_bfree		/* alternate field name */
1213*7c478bd9Sstevel@tonic-gate #  define _PATH_UNIX		"/unix"
1214*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1215*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1216*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1217*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
1218*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
1219*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
1220*7c478bd9Sstevel@tonic-gate # endif /* ISC_UNIX */
1221*7c478bd9Sstevel@tonic-gate 
1222*7c478bd9Sstevel@tonic-gate 
1223*7c478bd9Sstevel@tonic-gate /*
1224*7c478bd9Sstevel@tonic-gate **  Altos System V (5.3.1)
1225*7c478bd9Sstevel@tonic-gate **	Contributed by Tim Rice <tim@trr.metro.net>.
1226*7c478bd9Sstevel@tonic-gate */
1227*7c478bd9Sstevel@tonic-gate 
1228*7c478bd9Sstevel@tonic-gate # ifdef ALTOS_SYSTEM_V
1229*7c478bd9Sstevel@tonic-gate #  include <sys/stream.h>
1230*7c478bd9Sstevel@tonic-gate #  include <limits.h>
1231*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* include all the System V defines */
1232*7c478bd9Sstevel@tonic-gate #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1233*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1234*7c478bd9Sstevel@tonic-gate #  define WAITUNION	1	/* use "union wait" as wait argument type */
1235*7c478bd9Sstevel@tonic-gate #  define NEEDFSYNC	1	/* no fsync(2) in system library */
1236*7c478bd9Sstevel@tonic-gate #  define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
1237*7c478bd9Sstevel@tonic-gate #  define NOFTRUNCATE	1	/* do not have ftruncate(2) */
1238*7c478bd9Sstevel@tonic-gate #  define MAXPATHLEN	PATH_MAX
1239*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_SHORT
1240*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
1241*7c478bd9Sstevel@tonic-gate #  define SFS_BAVAIL	f_bfree		/* alternate field name */
1242*7c478bd9Sstevel@tonic-gate #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
1243*7c478bd9Sstevel@tonic-gate #  define NETUNIX	0	/* no unix domain socket support */
1244*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
1245*7c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
1246*7c478bd9Sstevel@tonic-gate #  define strtoul	strtol	/* gcc library bogosity */
1247*7c478bd9Sstevel@tonic-gate 
1248*7c478bd9Sstevel@tonic-gate typedef unsigned short	uid_t;
1249*7c478bd9Sstevel@tonic-gate typedef unsigned short	gid_t;
1250*7c478bd9Sstevel@tonic-gate typedef short		pid_t;
1251*7c478bd9Sstevel@tonic-gate typedef unsigned long	mode_t;
1252*7c478bd9Sstevel@tonic-gate 
1253*7c478bd9Sstevel@tonic-gate /* some stuff that should have been in the include files */
1254*7c478bd9Sstevel@tonic-gate extern char		*malloc();
1255*7c478bd9Sstevel@tonic-gate extern struct passwd	*getpwent();
1256*7c478bd9Sstevel@tonic-gate extern struct passwd	*getpwnam();
1257*7c478bd9Sstevel@tonic-gate extern struct passwd	*getpwuid();
1258*7c478bd9Sstevel@tonic-gate extern char		*getenv();
1259*7c478bd9Sstevel@tonic-gate extern struct group	*getgrgid();
1260*7c478bd9Sstevel@tonic-gate extern struct group	*getgrnam();
1261*7c478bd9Sstevel@tonic-gate 
1262*7c478bd9Sstevel@tonic-gate # endif /* ALTOS_SYSTEM_V */
1263*7c478bd9Sstevel@tonic-gate 
1264*7c478bd9Sstevel@tonic-gate 
1265*7c478bd9Sstevel@tonic-gate /*
1266*7c478bd9Sstevel@tonic-gate **  ConvexOS 11.0 and later
1267*7c478bd9Sstevel@tonic-gate **
1268*7c478bd9Sstevel@tonic-gate **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
1269*7c478bd9Sstevel@tonic-gate **	works on 9.1 as well.
1270*7c478bd9Sstevel@tonic-gate **
1271*7c478bd9Sstevel@tonic-gate **  ConvexOS 11.5 and later, should work on 11.0 as defined.
1272*7c478bd9Sstevel@tonic-gate **  For pre-ConvexOOS 11.0, define SM_CONF_GETOPT=0, undef IDENTPROTO
1273*7c478bd9Sstevel@tonic-gate **
1274*7c478bd9Sstevel@tonic-gate **	Eric Schnoebelen (eric@cirr.com) For CONVEX Computer Corp.
1275*7c478bd9Sstevel@tonic-gate **		(now the CONVEX Technologies Center of Hewlett Packard)
1276*7c478bd9Sstevel@tonic-gate */
1277*7c478bd9Sstevel@tonic-gate 
1278*7c478bd9Sstevel@tonic-gate # ifdef _CONVEX_SOURCE
1279*7c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE	1	/* has getdtablesize(2) */
1280*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) */
1281*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
1282*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
1283*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) */
1284*7c478bd9Sstevel@tonic-gate #  define HASFLOCK	1	/* has flock(2) */
1285*7c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT	1	/* has setrlimit(2) */
1286*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) */
1287*7c478bd9Sstevel@tonic-gate #  define BROKEN_RES_SEARCH	1	/* res_search(unknown) returns h_error=0 */
1288*7c478bd9Sstevel@tonic-gate #  define NEEDPUTENV	1	/* needs putenv (written in terms of setenv) */
1289*7c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	1	/* need a replacement for getopt(3) */
1290*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
1291*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_FLOAT
1292*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1293*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1294*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1295*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1296*7c478bd9Sstevel@tonic-gate #  ifndef S_IREAD
1297*7c478bd9Sstevel@tonic-gate #   define S_IREAD	_S_IREAD
1298*7c478bd9Sstevel@tonic-gate #   define S_IWRITE	_S_IWRITE
1299*7c478bd9Sstevel@tonic-gate #   define S_IEXEC	_S_IEXEC
1300*7c478bd9Sstevel@tonic-gate #   define S_IFMT	_S_IFMT
1301*7c478bd9Sstevel@tonic-gate #   define S_IFCHR	_S_IFCHR
1302*7c478bd9Sstevel@tonic-gate #   define S_IFBLK	_S_IFBLK
1303*7c478bd9Sstevel@tonic-gate #  endif /* ! S_IREAD */
1304*7c478bd9Sstevel@tonic-gate #  ifndef TZ_TYPE
1305*7c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TIMEZONE
1306*7c478bd9Sstevel@tonic-gate #  endif /* ! TZ_TYPE */
1307*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
1308*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	1
1309*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
1310*7c478bd9Sstevel@tonic-gate #  ifndef SHARE_V1
1311*7c478bd9Sstevel@tonic-gate #   define SHARE_V1	1	/* version 1 of the fair share scheduler */
1312*7c478bd9Sstevel@tonic-gate #  endif /* ! SHARE_V1 */
1313*7c478bd9Sstevel@tonic-gate #  if !defined(__GNUC__ )
1314*7c478bd9Sstevel@tonic-gate #   define UID_T	int		/* GNUC gets it right, ConvexC botches */
1315*7c478bd9Sstevel@tonic-gate #   define GID_T	int		/* GNUC gets it right, ConvexC botches */
1316*7c478bd9Sstevel@tonic-gate #  endif /* !defined(__GNUC__ ) */
1317*7c478bd9Sstevel@tonic-gate #  if SECUREWARE
1318*7c478bd9Sstevel@tonic-gate #   define FORK	fork		/* SecureWare wants the real fork! */
1319*7c478bd9Sstevel@tonic-gate #  else /* SECUREWARE */
1320*7c478bd9Sstevel@tonic-gate #   define FORK	vfork		/* the rest of the OS versions don't care */
1321*7c478bd9Sstevel@tonic-gate #  endif /* SECUREWARE */
1322*7c478bd9Sstevel@tonic-gate # endif /* _CONVEX_SOURCE */
1323*7c478bd9Sstevel@tonic-gate 
1324*7c478bd9Sstevel@tonic-gate 
1325*7c478bd9Sstevel@tonic-gate /*
1326*7c478bd9Sstevel@tonic-gate **  RISC/os 4.52
1327*7c478bd9Sstevel@tonic-gate **
1328*7c478bd9Sstevel@tonic-gate **	Gives a ton of warning messages, but otherwise compiles.
1329*7c478bd9Sstevel@tonic-gate */
1330*7c478bd9Sstevel@tonic-gate 
1331*7c478bd9Sstevel@tonic-gate # ifdef RISCOS
1332*7c478bd9Sstevel@tonic-gate 
1333*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
1334*7c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
1335*7c478bd9Sstevel@tonic-gate #   define HASFLOCK	1	/* has flock(2) call */
1336*7c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
1337*7c478bd9Sstevel@tonic-gate #  define WAITUNION	1	/* use "union wait" as wait argument type */
1338*7c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
1339*7c478bd9Sstevel@tonic-gate #  define NEEDPUTENV	1	/* need putenv(3) call */
1340*7c478bd9Sstevel@tonic-gate #  define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
1341*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1342*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_INT
1343*7c478bd9Sstevel@tonic-gate #  define LA_AVENRUN	"avenrun"
1344*7c478bd9Sstevel@tonic-gate #  define _PATH_UNIX	"/unix"
1345*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
1346*7c478bd9Sstevel@tonic-gate 
1347*7c478bd9Sstevel@tonic-gate #  define setpgid	setpgrp
1348*7c478bd9Sstevel@tonic-gate 
1349*7c478bd9Sstevel@tonic-gate typedef int		pid_t;
1350*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_DEFINED
1351*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_RETURN	(0)
1352*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_DECL	int
1353*7c478bd9Sstevel@tonic-gate typedef int		(*sigfunc_t)();
1354*7c478bd9Sstevel@tonic-gate extern char		*getenv();
1355*7c478bd9Sstevel@tonic-gate extern void		*malloc();
1356*7c478bd9Sstevel@tonic-gate 
1357*7c478bd9Sstevel@tonic-gate /* added for RISC/os 4.01...which is dumber than 4.50 */
1358*7c478bd9Sstevel@tonic-gate #  ifdef RISCOS_4_0
1359*7c478bd9Sstevel@tonic-gate #   ifndef ARBPTR_T
1360*7c478bd9Sstevel@tonic-gate #    define ARBPTR_T	char *
1361*7c478bd9Sstevel@tonic-gate #   endif /* ! ARBPTR_T */
1362*7c478bd9Sstevel@tonic-gate #   undef HASFLOCK
1363*7c478bd9Sstevel@tonic-gate #   define HASFLOCK	0
1364*7c478bd9Sstevel@tonic-gate #  endif /* RISCOS_4_0 */
1365*7c478bd9Sstevel@tonic-gate 
1366*7c478bd9Sstevel@tonic-gate #  include <sys/time.h>
1367*7c478bd9Sstevel@tonic-gate 
1368*7c478bd9Sstevel@tonic-gate # endif /* RISCOS */
1369*7c478bd9Sstevel@tonic-gate 
1370*7c478bd9Sstevel@tonic-gate 
1371*7c478bd9Sstevel@tonic-gate /*
1372*7c478bd9Sstevel@tonic-gate **  Linux 0.99pl10 and above...
1373*7c478bd9Sstevel@tonic-gate **
1374*7c478bd9Sstevel@tonic-gate **  Thanks to, in reverse order of contact:
1375*7c478bd9Sstevel@tonic-gate **
1376*7c478bd9Sstevel@tonic-gate **	John Kennedy <warlock@csuchico.edu>
1377*7c478bd9Sstevel@tonic-gate **	Andrew Pam <avatar@aus.xanadu.com>
1378*7c478bd9Sstevel@tonic-gate **	Florian La Roche <rzsfl@rz.uni-sb.de>
1379*7c478bd9Sstevel@tonic-gate **	Karl London <karl@borg.demon.co.uk>
1380*7c478bd9Sstevel@tonic-gate **
1381*7c478bd9Sstevel@tonic-gate **  NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style
1382*7c478bd9Sstevel@tonic-gate **	file locking is no longer allowed.  In particular, make sure
1383*7c478bd9Sstevel@tonic-gate **	your DBM library and sendmail are both using either flock(2)
1384*7c478bd9Sstevel@tonic-gate **	*or* fcntl(2) file locking, but not both.
1385*7c478bd9Sstevel@tonic-gate */
1386*7c478bd9Sstevel@tonic-gate 
1387*7c478bd9Sstevel@tonic-gate # ifdef __linux__
1388*7c478bd9Sstevel@tonic-gate #  include <linux/version.h>
1389*7c478bd9Sstevel@tonic-gate #  if !defined(KERNEL_VERSION)	/* not defined in 2.0.x kernel series */
1390*7c478bd9Sstevel@tonic-gate #   define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
1391*7c478bd9Sstevel@tonic-gate #  endif /* !defined(KERNEL_VERSION) */
1392*7c478bd9Sstevel@tonic-gate #  define BSD		1	/* include BSD defines */
1393*7c478bd9Sstevel@tonic-gate #  define HASSETREGID	1	/* use setregid(2) to set saved gid */
1394*7c478bd9Sstevel@tonic-gate #  ifndef REQUIRES_DIR_FSYNC
1395*7c478bd9Sstevel@tonic-gate #   define REQUIRES_DIR_FSYNC	1	/* requires fsync() on directory */
1396*7c478bd9Sstevel@tonic-gate #  endif /* REQUIRES_DIR_FSYNC */
1397*7c478bd9Sstevel@tonic-gate #  ifndef USESETEUID
1398*7c478bd9Sstevel@tonic-gate #   define USESETEUID	0	/* has it due to POSIX, but doesn't work */
1399*7c478bd9Sstevel@tonic-gate #  endif /* USESETEUID */
1400*7c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
1401*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
1402*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
1403*7c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
1404*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t	/* from <linux/types.h> */
1405*7c478bd9Sstevel@tonic-gate #  ifndef HASGETUSERSHELL
1406*7c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
1407*7c478bd9Sstevel@tonic-gate #  endif /* HASGETUSERSHELL */
1408*7c478bd9Sstevel@tonic-gate #  ifndef IP_SRCROUTE
1409*7c478bd9Sstevel@tonic-gate #   define IP_SRCROUTE	0	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
1410*7c478bd9Sstevel@tonic-gate #  endif /* ! IP_SRCROUTE */
1411*7c478bd9Sstevel@tonic-gate #  ifndef HAS_IN_H
1412*7c478bd9Sstevel@tonic-gate #   define HAS_IN_H	1	/* use netinet/in.h */
1413*7c478bd9Sstevel@tonic-gate #  endif /* ! HAS_IN_H */
1414*7c478bd9Sstevel@tonic-gate #  ifndef USE_SIGLONGJMP
1415*7c478bd9Sstevel@tonic-gate #   define USE_SIGLONGJMP	1 /* sigsetjmp needed for signal handling */
1416*7c478bd9Sstevel@tonic-gate #  endif /* ! USE_SIGLONGJMP */
1417*7c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
1418*7c478bd9Sstevel@tonic-gate #   if LINUX_VERSION_CODE < 66399
1419*7c478bd9Sstevel@tonic-gate #    define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
1420*7c478bd9Sstevel@tonic-gate #   else /* LINUX_VERSION_CODE < 66399 */
1421*7c478bd9Sstevel@tonic-gate #     if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
1422*7c478bd9Sstevel@tonic-gate #      define HASFLOCK	1	/* flock(2) fixed after 1.3.95 */
1423*7c478bd9Sstevel@tonic-gate #     else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
1424*7c478bd9Sstevel@tonic-gate #      define HASFLOCK	0	/* flock(2) is broken (again) after 2.4.0 */
1425*7c478bd9Sstevel@tonic-gate #     endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
1426*7c478bd9Sstevel@tonic-gate #   endif /* LINUX_VERSION_CODE < 66399 */
1427*7c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
1428*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
1429*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_PROCSTR
1430*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
1431*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
1432*7c478bd9Sstevel@tonic-gate #  define SPT_PADCHAR	'\0'		/* pad process title with nulls */
1433*7c478bd9Sstevel@tonic-gate #  if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0))
1434*7c478bd9Sstevel@tonic-gate #   ifndef HASURANDOMDEV
1435*7c478bd9Sstevel@tonic-gate #    define HASURANDOMDEV 1	/* 2.0 (at least) has linux/drivers/char/random.c */
1436*7c478bd9Sstevel@tonic-gate #   endif /* ! HASURANDOMDEV */
1437*7c478bd9Sstevel@tonic-gate #  endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) */
1438*7c478bd9Sstevel@tonic-gate #  if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1439*7c478bd9Sstevel@tonic-gate #   define HASSTRERROR	1	/* has strerror(3) */
1440*7c478bd9Sstevel@tonic-gate #  endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
1441*7c478bd9Sstevel@tonic-gate #  ifndef TZ_TYPE
1442*7c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_NONE		/* no standard for Linux */
1443*7c478bd9Sstevel@tonic-gate #  endif /* ! TZ_TYPE */
1444*7c478bd9Sstevel@tonic-gate #  if (__GLIBC__ >= 2)
1445*7c478bd9Sstevel@tonic-gate #   include <paths.h>
1446*7c478bd9Sstevel@tonic-gate #  endif /* (__GLIBC__ >= 2) */
1447*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
1448*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
1449*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
1450*7c478bd9Sstevel@tonic-gate #  include <sys/sysmacros.h>
1451*7c478bd9Sstevel@tonic-gate #  undef atol			/* wounded in <stdlib.h> */
1452*7c478bd9Sstevel@tonic-gate #  if NETINET6
1453*7c478bd9Sstevel@tonic-gate    /*
1454*7c478bd9Sstevel@tonic-gate    **  Linux doesn't have a good way to tell userland what interfaces are
1455*7c478bd9Sstevel@tonic-gate    **  IPv6-capable.  Therefore, the BIND resolver can not determine if there
1456*7c478bd9Sstevel@tonic-gate    **  are IPv6 interfaces to honor AI_ADDRCONFIG.  Unfortunately, it assumes
1457*7c478bd9Sstevel@tonic-gate    **  that none are present.  (Excuse the macro name ADDRCONFIG_IS_BROKEN.)
1458*7c478bd9Sstevel@tonic-gate    */
1459*7c478bd9Sstevel@tonic-gate #   define ADDRCONFIG_IS_BROKEN	1
1460*7c478bd9Sstevel@tonic-gate 
1461*7c478bd9Sstevel@tonic-gate    /*
1462*7c478bd9Sstevel@tonic-gate    **  Indirectly included from glibc's <feature.h>.  IPv6 support is native
1463*7c478bd9Sstevel@tonic-gate    **  in 2.1 and later, but the APIs appear before the functions.
1464*7c478bd9Sstevel@tonic-gate    */
1465*7c478bd9Sstevel@tonic-gate #   if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1466*7c478bd9Sstevel@tonic-gate #    define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__)
1467*7c478bd9Sstevel@tonic-gate #    if (GLIBC_VERSION >= 0x201)
1468*7c478bd9Sstevel@tonic-gate #     undef IPPROTO_ICMPV6	/* linux #defines, glibc enums */
1469*7c478bd9Sstevel@tonic-gate #    else /* (GLIBC_VERSION >= 0x201) */
1470*7c478bd9Sstevel@tonic-gate #     include <linux/in6.h>	/* IPv6 support */
1471*7c478bd9Sstevel@tonic-gate #    endif /* (GLIBC_VERSION >= 0x201) */
1472*7c478bd9Sstevel@tonic-gate #    if (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE))
1473*7c478bd9Sstevel@tonic-gate      /* Have APIs in <netdb.h>, but no support in glibc */
1474*7c478bd9Sstevel@tonic-gate #     define NEEDSGETIPNODE	1
1475*7c478bd9Sstevel@tonic-gate #    endif /* (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) */
1476*7c478bd9Sstevel@tonic-gate #    undef GLIBC_VERSION
1477*7c478bd9Sstevel@tonic-gate #   endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
1478*7c478bd9Sstevel@tonic-gate #  endif /* NETINET6 */
1479*7c478bd9Sstevel@tonic-gate #  ifndef HASFCHOWN
1480*7c478bd9Sstevel@tonic-gate #   define HASFCHOWN	1	/* fchown(2) */
1481*7c478bd9Sstevel@tonic-gate #  endif /* ! HASFCHOWN */
1482*7c478bd9Sstevel@tonic-gate #  if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD)
1483*7c478bd9Sstevel@tonic-gate #    define HASFCHMOD	1	/* fchmod(2) */
1484*7c478bd9Sstevel@tonic-gate #  endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) */
1485*7c478bd9Sstevel@tonic-gate # endif /* __linux__ */
1486*7c478bd9Sstevel@tonic-gate 
1487*7c478bd9Sstevel@tonic-gate 
1488*7c478bd9Sstevel@tonic-gate /*
1489*7c478bd9Sstevel@tonic-gate **  DELL SVR4 Issue 2.2, and others
1490*7c478bd9Sstevel@tonic-gate **	From Kimmo Suominen <kim@grendel.lut.fi>
1491*7c478bd9Sstevel@tonic-gate **
1492*7c478bd9Sstevel@tonic-gate **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
1493*7c478bd9Sstevel@tonic-gate **	defined, and the definitions conflict.
1494*7c478bd9Sstevel@tonic-gate **
1495*7c478bd9Sstevel@tonic-gate **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
1496*7c478bd9Sstevel@tonic-gate **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
1497*7c478bd9Sstevel@tonic-gate **	(SVR4.0/386 version 3.0).
1498*7c478bd9Sstevel@tonic-gate */
1499*7c478bd9Sstevel@tonic-gate 
1500*7c478bd9Sstevel@tonic-gate # ifdef DELL_SVR4
1501*7c478bd9Sstevel@tonic-gate 				/* no changes necessary */
1502*7c478bd9Sstevel@tonic-gate 				/* see general __svr4__ defines below */
1503*7c478bd9Sstevel@tonic-gate # endif /* DELL_SVR4 */
1504*7c478bd9Sstevel@tonic-gate 
1505*7c478bd9Sstevel@tonic-gate 
1506*7c478bd9Sstevel@tonic-gate /*
1507*7c478bd9Sstevel@tonic-gate **  Apple A/UX 3.0
1508*7c478bd9Sstevel@tonic-gate */
1509*7c478bd9Sstevel@tonic-gate 
1510*7c478bd9Sstevel@tonic-gate # ifdef _AUX_SOURCE
1511*7c478bd9Sstevel@tonic-gate #  include <sys/sysmacros.h>
1512*7c478bd9Sstevel@tonic-gate #  define BSD			/* has BSD routines */
1513*7c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT	0	/* ... but not setrlimit(2) */
1514*7c478bd9Sstevel@tonic-gate #  define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
1515*7c478bd9Sstevel@tonic-gate #  define BOGUS_O_EXCL	1	/* exclusive open follows symlinks */
1516*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
1517*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
1518*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
1519*7c478bd9Sstevel@tonic-gate #  define HASSETVBUF	1	/* has setvbuf(3) in libc */
1520*7c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
1521*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_DEFINED	/* sigfunc_t already defined */
1522*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_RETURN		/* POSIX-mode */
1523*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_DECL	void	/* POSIX-mode */
1524*7c478bd9Sstevel@tonic-gate #  define ERRLIST_PREDEFINED	1
1525*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
1526*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
1527*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
1528*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
1529*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
1530*7c478bd9Sstevel@tonic-gate #   define FSHIFT	16
1531*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
1532*7c478bd9Sstevel@tonic-gate #  define LA_AVENRUN	"avenrun"
1533*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1534*7c478bd9Sstevel@tonic-gate #  define TZ_TYPE	TZ_TZNAME
1535*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_UNIX
1536*7c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/unix"		/* should be in <paths.h> */
1537*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_UNIX */
1538*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1539*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1540*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1541*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
1542*7c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
1543*7c478bd9Sstevel@tonic-gate # endif /* _AUX_SOURCE */
1544*7c478bd9Sstevel@tonic-gate 
1545*7c478bd9Sstevel@tonic-gate 
1546*7c478bd9Sstevel@tonic-gate /*
1547*7c478bd9Sstevel@tonic-gate **  Encore UMAX V
1548*7c478bd9Sstevel@tonic-gate **
1549*7c478bd9Sstevel@tonic-gate **	Not extensively tested.
1550*7c478bd9Sstevel@tonic-gate */
1551*7c478bd9Sstevel@tonic-gate 
1552*7c478bd9Sstevel@tonic-gate # ifdef UMAXV
1553*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
1554*7c478bd9Sstevel@tonic-gate #  define HASSETVBUF	1	/* we have setvbuf(3) in libc */
1555*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
1556*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1557*7c478bd9Sstevel@tonic-gate #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1558*7c478bd9Sstevel@tonic-gate #  define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
1559*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
1560*7c478bd9Sstevel@tonic-gate #  define MAXPATHLEN	PATH_MAX
1561*7c478bd9Sstevel@tonic-gate extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
1562*7c478bd9Sstevel@tonic-gate extern struct group	*getgrent(), *getgrnam(), *getgrgid();
1563*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
1564*7c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
1565*7c478bd9Sstevel@tonic-gate # endif /* UMAXV */
1566*7c478bd9Sstevel@tonic-gate 
1567*7c478bd9Sstevel@tonic-gate 
1568*7c478bd9Sstevel@tonic-gate /*
1569*7c478bd9Sstevel@tonic-gate **  Stardent Titan 3000 running TitanOS 4.2.
1570*7c478bd9Sstevel@tonic-gate **
1571*7c478bd9Sstevel@tonic-gate **	Must be compiled in "cc -43" mode.
1572*7c478bd9Sstevel@tonic-gate **
1573*7c478bd9Sstevel@tonic-gate **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
1574*7c478bd9Sstevel@tonic-gate **
1575*7c478bd9Sstevel@tonic-gate **	Note the tweaking below after the BSD defines are set.
1576*7c478bd9Sstevel@tonic-gate */
1577*7c478bd9Sstevel@tonic-gate 
1578*7c478bd9Sstevel@tonic-gate # ifdef titan
1579*7c478bd9Sstevel@tonic-gate #  define setpgid	setpgrp
1580*7c478bd9Sstevel@tonic-gate typedef int		pid_t;
1581*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
1582*7c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
1583*7c478bd9Sstevel@tonic-gate # endif /* titan */
1584*7c478bd9Sstevel@tonic-gate 
1585*7c478bd9Sstevel@tonic-gate 
1586*7c478bd9Sstevel@tonic-gate /*
1587*7c478bd9Sstevel@tonic-gate **  Sequent DYNIX 3.2.0
1588*7c478bd9Sstevel@tonic-gate **
1589*7c478bd9Sstevel@tonic-gate **	From Jim Davis <jdavis@cs.arizona.edu>.
1590*7c478bd9Sstevel@tonic-gate */
1591*7c478bd9Sstevel@tonic-gate 
1592*7c478bd9Sstevel@tonic-gate # ifdef sequent
1593*7c478bd9Sstevel@tonic-gate 
1594*7c478bd9Sstevel@tonic-gate #  define BSD		1
1595*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1
1596*7c478bd9Sstevel@tonic-gate #  define BSD4_3		1	/* to get signal() in conf.c */
1597*7c478bd9Sstevel@tonic-gate #  define WAITUNION	1
1598*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_FLOAT
1599*7c478bd9Sstevel@tonic-gate #  ifdef _POSIX_VERSION
1600*7c478bd9Sstevel@tonic-gate #   undef _POSIX_VERSION		/* set in <unistd.h> */
1601*7c478bd9Sstevel@tonic-gate #  endif /* _POSIX_VERSION */
1602*7c478bd9Sstevel@tonic-gate #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
1603*7c478bd9Sstevel@tonic-gate #  define setpgid	setpgrp
1604*7c478bd9Sstevel@tonic-gate 
1605*7c478bd9Sstevel@tonic-gate /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
1606*7c478bd9Sstevel@tonic-gate #  undef	WIFEXITED
1607*7c478bd9Sstevel@tonic-gate #  define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
1608*7c478bd9Sstevel@tonic-gate 			 ((union wait*)&(s))->w_termsig == 0)
1609*7c478bd9Sstevel@tonic-gate #  define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
1610*7c478bd9Sstevel@tonic-gate typedef int		pid_t;
1611*7c478bd9Sstevel@tonic-gate #  define isgraph(c)	(isprint(c) && (c != ' '))
1612*7c478bd9Sstevel@tonic-gate 
1613*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
1614*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
1615*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
1616*7c478bd9Sstevel@tonic-gate 
1617*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_UNIX
1618*7c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/dynix"
1619*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_UNIX */
1620*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1621*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1622*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1623*7c478bd9Sstevel@tonic-gate # endif /* sequent */
1624*7c478bd9Sstevel@tonic-gate 
1625*7c478bd9Sstevel@tonic-gate 
1626*7c478bd9Sstevel@tonic-gate /*
1627*7c478bd9Sstevel@tonic-gate **  Sequent DYNIX/ptx v2.0 (and higher)
1628*7c478bd9Sstevel@tonic-gate **
1629*7c478bd9Sstevel@tonic-gate **	For DYNIX/ptx v1.x, undefine HASSETREUID.
1630*7c478bd9Sstevel@tonic-gate **
1631*7c478bd9Sstevel@tonic-gate **	From Tim Wright <timw@sequent.com>.
1632*7c478bd9Sstevel@tonic-gate **	Update from Jack Woolley <jwoolley@sctcorp.com>, 26 Dec 1995,
1633*7c478bd9Sstevel@tonic-gate **		for DYNIX/ptx 4.0.2.
1634*7c478bd9Sstevel@tonic-gate */
1635*7c478bd9Sstevel@tonic-gate 
1636*7c478bd9Sstevel@tonic-gate # ifdef _SEQUENT_
1637*7c478bd9Sstevel@tonic-gate #  include <sys/stream.h>
1638*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* include all the System V defines */
1639*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
1640*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
1641*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
1642*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1643*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
1644*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_INT
1645*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
1646*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
1647*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
1648*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
1649*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
1650*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1651*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1652*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1653*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
1654*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
1655*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
1656*7c478bd9Sstevel@tonic-gate # endif /* _SEQUENT_ */
1657*7c478bd9Sstevel@tonic-gate 
1658*7c478bd9Sstevel@tonic-gate /*
1659*7c478bd9Sstevel@tonic-gate **  Cray UNICOS, UNICOS/mk, and UNICOS/mp
1660*7c478bd9Sstevel@tonic-gate **
1661*7c478bd9Sstevel@tonic-gate **    UNICOS:
1662*7c478bd9Sstevel@tonic-gate **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
1663*7c478bd9Sstevel@tonic-gate **	Update Brian Ginsbach <ginsbach@cray.com>
1664*7c478bd9Sstevel@tonic-gate **    UNICOS/mk (Cray T3E):
1665*7c478bd9Sstevel@tonic-gate **	Contributed by Manu Mahonen <mailadm@csc.fi>
1666*7c478bd9Sstevel@tonic-gate **	of Center for Scientific Computing.
1667*7c478bd9Sstevel@tonic-gate **	Update Brian Ginsbach <ginsbach@cray.com>
1668*7c478bd9Sstevel@tonic-gate **    UNICOS/mp:
1669*7c478bd9Sstevel@tonic-gate **	From Aaron Davis <awd@cray.com> & Brian Ginsbach <ginsbach@cray.com>
1670*7c478bd9Sstevel@tonic-gate */
1671*7c478bd9Sstevel@tonic-gate 
1672*7c478bd9Sstevel@tonic-gate # if defined(_CRAY) || defined(UNICOS) || defined(_UNICOSMP)
1673*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* include all the System V defines */
1674*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
1675*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN	1	/* has fchown(2) */
1676*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(3) call */
1677*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
1678*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
1679*7c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
1680*7c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE 1	/* has getdtablesize(2) syscall */
1681*7c478bd9Sstevel@tonic-gate #  define HASSTRERROR	1	/* has strerror(3) */
1682*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
1683*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
1684*7c478bd9Sstevel@tonic-gate #  define SFS_BAVAIL	f_bfree	/* alternate field name */
1685*7c478bd9Sstevel@tonic-gate #  define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
1686*7c478bd9Sstevel@tonic-gate #  ifdef UNICOS
1687*7c478bd9Sstevel@tonic-gate #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1688*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_ZERO
1689*7c478bd9Sstevel@tonic-gate #   define _PATH_MAILDIR	"/usr/spool/mail"
1690*7c478bd9Sstevel@tonic-gate #   define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst)
1691*7c478bd9Sstevel@tonic-gate #   ifndef MAXPATHLEN
1692*7c478bd9Sstevel@tonic-gate #    define MAXPATHLEN PATHSIZE
1693*7c478bd9Sstevel@tonic-gate #   endif /* ! MAXPATHLEN */
1694*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_UNIX
1695*7c478bd9Sstevel@tonic-gate #    ifdef UNICOSMK
1696*7c478bd9Sstevel@tonic-gate #     define _PATH_UNIX		"/unicosmk.ar"
1697*7c478bd9Sstevel@tonic-gate #    else
1698*7c478bd9Sstevel@tonic-gate #     define _PATH_UNIX		"/unicos"
1699*7c478bd9Sstevel@tonic-gate #    endif /* UNICOSMK */
1700*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_UNIX */
1701*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_VENDOR_CF
1702*7c478bd9Sstevel@tonic-gate #    define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1703*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_VENDOR_CF */
1704*7c478bd9Sstevel@tonic-gate #  endif /* UNICOS */
1705*7c478bd9Sstevel@tonic-gate #  ifdef _UNICOSMP
1706*7c478bd9Sstevel@tonic-gate #  if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
1707*7c478bd9Sstevel@tonic-gate     /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */
1708*7c478bd9Sstevel@tonic-gate #   define _SC_NPROCESSORS_ONLN  _SC_NPROC_ONLN
1709*7c478bd9Sstevel@tonic-gate #  endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */
1710*7c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 0		/* does not have getusershell(3) call */
1711*7c478bd9Sstevel@tonic-gate #   define HASSETRLIMIT	   1		/* has setrlimit(2) syscall */
1712*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_IRIX6	/* figure out at run time */
1713*7c478bd9Sstevel@tonic-gate #   include <sys/cdefs.h>
1714*7c478bd9Sstevel@tonic-gate #   include <paths.h>
1715*7c478bd9Sstevel@tonic-gate #   define ARGV_T char *const *
1716*7c478bd9Sstevel@tonic-gate #  endif /* _UNICOSMP */
1717*7c478bd9Sstevel@tonic-gate # endif /* _CRAY */
1718*7c478bd9Sstevel@tonic-gate 
1719*7c478bd9Sstevel@tonic-gate /*
1720*7c478bd9Sstevel@tonic-gate **  Apollo DomainOS
1721*7c478bd9Sstevel@tonic-gate **
1722*7c478bd9Sstevel@tonic-gate **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
1723*7c478bd9Sstevel@tonic-gate **
1724*7c478bd9Sstevel@tonic-gate **  15 Jan 1994; updated 2 Aug 1995
1725*7c478bd9Sstevel@tonic-gate **
1726*7c478bd9Sstevel@tonic-gate */
1727*7c478bd9Sstevel@tonic-gate 
1728*7c478bd9Sstevel@tonic-gate # ifdef apollo
1729*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	1	/* has setreuid(2) call */
1730*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(2) call */
1731*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	0	/* does not have <netinet/ip_var.h> */
1732*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
1733*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_SUBR		/* use getloadavg.c */
1734*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
1735*7c478bd9Sstevel@tonic-gate #  define SFS_BAVAIL	f_bfree		/* alternate field name */
1736*7c478bd9Sstevel@tonic-gate #  define TZ_TYPE	TZ_TZNAME
1737*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1738*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1739*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1740*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
1741*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
1742*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
1743*7c478bd9Sstevel@tonic-gate #  undef	 S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
1744*7c478bd9Sstevel@tonic-gate #  undef	 S_IFIFO
1745*7c478bd9Sstevel@tonic-gate #  define S_IFIFO	0010000
1746*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
1747*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
1748*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
1749*7c478bd9Sstevel@tonic-gate #  define RLIMIT_NEEDS_SYS_TIME_H	1
1750*7c478bd9Sstevel@tonic-gate #  if defined(NGROUPS_MAX) && !NGROUPS_MAX
1751*7c478bd9Sstevel@tonic-gate #   undef NGROUPS_MAX
1752*7c478bd9Sstevel@tonic-gate #  endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */
1753*7c478bd9Sstevel@tonic-gate # endif /* apollo */
1754*7c478bd9Sstevel@tonic-gate 
1755*7c478bd9Sstevel@tonic-gate /*
1756*7c478bd9Sstevel@tonic-gate **  MPE-iX
1757*7c478bd9Sstevel@tonic-gate **
1758*7c478bd9Sstevel@tonic-gate **	Requires MPE 6.0 or greater.  See sendmail/README for more info.
1759*7c478bd9Sstevel@tonic-gate **
1760*7c478bd9Sstevel@tonic-gate **	From Mark Bixby <mark_bixby@hp.com> or <mark@bixby.org>.
1761*7c478bd9Sstevel@tonic-gate */
1762*7c478bd9Sstevel@tonic-gate 
1763*7c478bd9Sstevel@tonic-gate # ifdef MPE
1764*7c478bd9Sstevel@tonic-gate 
1765*7c478bd9Sstevel@tonic-gate #  include <sys/sysmacros.h>
1766*7c478bd9Sstevel@tonic-gate #  include <fcntl.h>
1767*7c478bd9Sstevel@tonic-gate 
1768*7c478bd9Sstevel@tonic-gate /* Sendmail stuff */
1769*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN		0	/* lacks fchown() */
1770*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL	0	/* lacks getusershell() */
1771*7c478bd9Sstevel@tonic-gate #  ifdef HASNICE
1772*7c478bd9Sstevel@tonic-gate #   undef  HASNICE
1773*7c478bd9Sstevel@tonic-gate #  endif /* HASNICE */
1774*7c478bd9Sstevel@tonic-gate #  define HASNICE		0	/* lacks nice() */
1775*7c478bd9Sstevel@tonic-gate #  define HASRANDOM		0	/* lacks random() */
1776*7c478bd9Sstevel@tonic-gate #  ifdef HASRRESVPORT
1777*7c478bd9Sstevel@tonic-gate #   undef HASRRESVPORT
1778*7c478bd9Sstevel@tonic-gate #  endif /* HASRRESVPORT */
1779*7c478bd9Sstevel@tonic-gate #  define HASRRESVPORT		0	/* lacks rresvport() */
1780*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE		0	/* lacks IP source routing fields */
1781*7c478bd9Sstevel@tonic-gate #  ifdef MATCHGECOS
1782*7c478bd9Sstevel@tonic-gate #   undef MATCHGECOS
1783*7c478bd9Sstevel@tonic-gate #  endif /* MATCHGECOS */
1784*7c478bd9Sstevel@tonic-gate #  define MATCHGECOS		0	/* lacks an initialized GECOS field */
1785*7c478bd9Sstevel@tonic-gate #  define NEEDFSYNC		1	/* use sendmail's fsync() */
1786*7c478bd9Sstevel@tonic-gate #  define NEEDLINK		1	/* use sendmail's link() */
1787*7c478bd9Sstevel@tonic-gate #  define NOFTRUNCATE		1	/* lacks ftruncate() */
1788*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE		SFS_NONE /* can't determine disk space */
1789*7c478bd9Sstevel@tonic-gate #  define SM_CONF_SYSLOG	0	/* use sendmail decl of syslog() */
1790*7c478bd9Sstevel@tonic-gate #  define USE_DOUBLE_FORK	0	/* don't fork an intermediate zombie */
1791*7c478bd9Sstevel@tonic-gate #  define USE_ENVIRON		1	/* use environ instead of envp */
1792*7c478bd9Sstevel@tonic-gate 
1793*7c478bd9Sstevel@tonic-gate /* Missing header stuff */
1794*7c478bd9Sstevel@tonic-gate #  define AF_UNSPEC		0
1795*7c478bd9Sstevel@tonic-gate #  define AF_MAX		AF_INET
1796*7c478bd9Sstevel@tonic-gate #  define IFF_LOOPBACK		0x8
1797*7c478bd9Sstevel@tonic-gate #  define IN_LOOPBACKNET	127
1798*7c478bd9Sstevel@tonic-gate #  define MAXNAMLEN		NAME_MAX
1799*7c478bd9Sstevel@tonic-gate #  define S_IEXEC		S_IXUSR
1800*7c478bd9Sstevel@tonic-gate #  define S_IREAD		S_IRUSR
1801*7c478bd9Sstevel@tonic-gate #  define S_IWRITE		S_IWUSR
1802*7c478bd9Sstevel@tonic-gate 
1803*7c478bd9Sstevel@tonic-gate /* Present header stuff that needs to be missing */
1804*7c478bd9Sstevel@tonic-gate #  undef NGROUPS_MAX
1805*7c478bd9Sstevel@tonic-gate 
1806*7c478bd9Sstevel@tonic-gate /* Shadow functions */
1807*7c478bd9Sstevel@tonic-gate #  define bind		sendmail_mpe_bind
1808*7c478bd9Sstevel@tonic-gate #  define _exit		sendmail_mpe__exit
1809*7c478bd9Sstevel@tonic-gate #  define exit		sendmail_mpe_exit
1810*7c478bd9Sstevel@tonic-gate #  define fcntl		sendmail_mpe_fcntl
1811*7c478bd9Sstevel@tonic-gate #  define getegid	sendmail_mpe_getegid
1812*7c478bd9Sstevel@tonic-gate #  define geteuid	sendmail_mpe_geteuid
1813*7c478bd9Sstevel@tonic-gate #  define getpwnam	sendmail_mpe_getpwnam
1814*7c478bd9Sstevel@tonic-gate #  define getpwuid	sendmail_mpe_getpwuid
1815*7c478bd9Sstevel@tonic-gate #  define setgid	sendmail_mpe_setgid
1816*7c478bd9Sstevel@tonic-gate #  define setuid	sendmail_mpe_setuid
1817*7c478bd9Sstevel@tonic-gate extern int		sendmail_mpe_fcntl __P((int, int, ...));
1818*7c478bd9Sstevel@tonic-gate extern struct passwd *	sendmail_mpe_getpwnam __P((const char *));
1819*7c478bd9Sstevel@tonic-gate extern struct passwd *	sendmail_mpe_getpwuid __P((uid_t));
1820*7c478bd9Sstevel@tonic-gate # endif /* MPE */
1821*7c478bd9Sstevel@tonic-gate 
1822*7c478bd9Sstevel@tonic-gate /*
1823*7c478bd9Sstevel@tonic-gate **  System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native)
1824*7c478bd9Sstevel@tonic-gate **
1825*7c478bd9Sstevel@tonic-gate **	Contributed by Paul Gampe <paulg@apnic.net>
1826*7c478bd9Sstevel@tonic-gate */
1827*7c478bd9Sstevel@tonic-gate 
1828*7c478bd9Sstevel@tonic-gate # ifdef __svr5__
1829*7c478bd9Sstevel@tonic-gate #  include <sys/mkdev.h>
1830*7c478bd9Sstevel@tonic-gate #  define __svr4__
1831*7c478bd9Sstevel@tonic-gate #  define SYS5SIGNALS		1
1832*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN		1	/* has fchown(2) call */
1833*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
1834*7c478bd9Sstevel@tonic-gate #  define HASSETREUID		1
1835*7c478bd9Sstevel@tonic-gate #  define HASWAITPID		1
1836*7c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE	1
1837*7c478bd9Sstevel@tonic-gate #  define GIDSET_T		gid_t
1838*7c478bd9Sstevel@tonic-gate #  define SOCKADDR_LEN_T	size_t
1839*7c478bd9Sstevel@tonic-gate #  define SOCKOPT_LEN_T		size_t
1840*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_UNIX
1841*7c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/stand/unix"
1842*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_UNIX */
1843*7c478bd9Sstevel@tonic-gate #  define SPT_PADCHAR		'\0'	/* pad process title with nulls */
1844*7c478bd9Sstevel@tonic-gate #  ifndef SYSLOG_BUFSIZE
1845*7c478bd9Sstevel@tonic-gate #   define SYSLOG_BUFSIZE	1024	/* unsure */
1846*7c478bd9Sstevel@tonic-gate #  endif /* ! SYSLOG_BUFSIZE */
1847*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1848*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/etc/sendmail.cf"
1849*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1850*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
1851*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/etc/sendmail.pid"
1852*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
1853*7c478bd9Sstevel@tonic-gate #  undef offsetof		/* avoid stddefs.h, sys/sysmacros.h conflict */
1854*7c478bd9Sstevel@tonic-gate #if !defined(SM_SET_H_ERRNO) && defined(_REENTRANT)
1855*7c478bd9Sstevel@tonic-gate # define SM_SET_H_ERRNO(err)	set_h_errno((err))
1856*7c478bd9Sstevel@tonic-gate #endif /* ! SM_SET_H_ERRNO && _REENTRANT */
1857*7c478bd9Sstevel@tonic-gate # endif /* __svr5__ */
1858*7c478bd9Sstevel@tonic-gate 
1859*7c478bd9Sstevel@tonic-gate /* ###################################################################### */
1860*7c478bd9Sstevel@tonic-gate 
1861*7c478bd9Sstevel@tonic-gate /*
1862*7c478bd9Sstevel@tonic-gate **  UnixWare 2.x
1863*7c478bd9Sstevel@tonic-gate */
1864*7c478bd9Sstevel@tonic-gate 
1865*7c478bd9Sstevel@tonic-gate # ifdef UNIXWARE2
1866*7c478bd9Sstevel@tonic-gate #  define UNIXWARE	1
1867*7c478bd9Sstevel@tonic-gate #  undef offsetof		/* avoid stddefs.h, sys/sysmacros.h conflict */
1868*7c478bd9Sstevel@tonic-gate # endif /* UNIXWARE2 */
1869*7c478bd9Sstevel@tonic-gate 
1870*7c478bd9Sstevel@tonic-gate 
1871*7c478bd9Sstevel@tonic-gate /*
1872*7c478bd9Sstevel@tonic-gate **  UnixWare 1.1.2.
1873*7c478bd9Sstevel@tonic-gate **
1874*7c478bd9Sstevel@tonic-gate **	Updated by Petr Lampa <lampa@fee.vutbr.cz>.
1875*7c478bd9Sstevel@tonic-gate **	From Evan Champion <evanc@spatial.synapse.org>.
1876*7c478bd9Sstevel@tonic-gate */
1877*7c478bd9Sstevel@tonic-gate 
1878*7c478bd9Sstevel@tonic-gate # ifdef UNIXWARE
1879*7c478bd9Sstevel@tonic-gate #  include <sys/mkdev.h>
1880*7c478bd9Sstevel@tonic-gate #  define SYSTEM5		1
1881*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
1882*7c478bd9Sstevel@tonic-gate #  define HASSETREUID		1
1883*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
1884*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS		1
1885*7c478bd9Sstevel@tonic-gate #  define GIDSET_T		gid_t
1886*7c478bd9Sstevel@tonic-gate #  define SLEEP_T		unsigned
1887*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE		SFS_STATVFS
1888*7c478bd9Sstevel@tonic-gate #  define LA_TYPE		LA_ZERO
1889*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
1890*7c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
1891*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_UNIX
1892*7c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/unix"
1893*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_UNIX */
1894*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
1895*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
1896*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
1897*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
1898*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
1899*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
1900*7c478bd9Sstevel@tonic-gate #  define SYSLOG_BUFSIZE	128
1901*7c478bd9Sstevel@tonic-gate # endif /* UNIXWARE */
1902*7c478bd9Sstevel@tonic-gate 
1903*7c478bd9Sstevel@tonic-gate 
1904*7c478bd9Sstevel@tonic-gate /*
1905*7c478bd9Sstevel@tonic-gate **  Intergraph CLIX 3.1
1906*7c478bd9Sstevel@tonic-gate **
1907*7c478bd9Sstevel@tonic-gate **	From Paul Southworth <pauls@locust.cic.net>
1908*7c478bd9Sstevel@tonic-gate */
1909*7c478bd9Sstevel@tonic-gate 
1910*7c478bd9Sstevel@tonic-gate # ifdef CLIX
1911*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* looks like System V */
1912*7c478bd9Sstevel@tonic-gate #  ifndef HASGETUSERSHELL
1913*7c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1914*7c478bd9Sstevel@tonic-gate #  endif /* ! HASGETUSERSHELL */
1915*7c478bd9Sstevel@tonic-gate #  define DEV_BSIZE	512	/* device block size not defined */
1916*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
1917*7c478bd9Sstevel@tonic-gate #  undef LOG			/* syslog not available */
1918*7c478bd9Sstevel@tonic-gate #  define NEEDFSYNC	1	/* no fsync in system library */
1919*7c478bd9Sstevel@tonic-gate #  define GETSHORT	_getshort
1920*7c478bd9Sstevel@tonic-gate # endif /* CLIX */
1921*7c478bd9Sstevel@tonic-gate 
1922*7c478bd9Sstevel@tonic-gate 
1923*7c478bd9Sstevel@tonic-gate /*
1924*7c478bd9Sstevel@tonic-gate **  NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP
1925*7c478bd9Sstevel@tonic-gate **
1926*7c478bd9Sstevel@tonic-gate **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
1927*7c478bd9Sstevel@tonic-gate */
1928*7c478bd9Sstevel@tonic-gate 
1929*7c478bd9Sstevel@tonic-gate # ifdef NCR_MP_RAS2
1930*7c478bd9Sstevel@tonic-gate #  include <sys/sockio.h>
1931*7c478bd9Sstevel@tonic-gate #  define __svr4__
1932*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
1933*7c478bd9Sstevel@tonic-gate #  define SYSLOG_BUFSIZE	1024
1934*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE  SPT_NONE
1935*7c478bd9Sstevel@tonic-gate # endif /* NCR_MP_RAS2 */
1936*7c478bd9Sstevel@tonic-gate 
1937*7c478bd9Sstevel@tonic-gate 
1938*7c478bd9Sstevel@tonic-gate /*
1939*7c478bd9Sstevel@tonic-gate **  NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP
1940*7c478bd9Sstevel@tonic-gate **
1941*7c478bd9Sstevel@tonic-gate **	From Tom Moore <Tom.Moore@DaytonOH.NCR.COM>
1942*7c478bd9Sstevel@tonic-gate */
1943*7c478bd9Sstevel@tonic-gate 
1944*7c478bd9Sstevel@tonic-gate # ifdef NCR_MP_RAS3
1945*7c478bd9Sstevel@tonic-gate #  define __svr4__
1946*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN		1	/* has fchown(2) call */
1947*7c478bd9Sstevel@tonic-gate #  define LDA_USE_LOCKF		1
1948*7c478bd9Sstevel@tonic-gate #  define SIOCGIFNUM_IS_BROKEN	1	/* SIOCGIFNUM has non-std interface */
1949*7c478bd9Sstevel@tonic-gate #  define SO_REUSEADDR_IS_BROKEN	1	/* doesn't work if accept() fails */
1950*7c478bd9Sstevel@tonic-gate #  define SYSLOG_BUFSIZE	1024
1951*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_NONE
1952*7c478bd9Sstevel@tonic-gate #  define _PATH_MAILDIR	"/var/mail"
1953*7c478bd9Sstevel@tonic-gate #  ifndef _XOPEN_SOURCE
1954*7c478bd9Sstevel@tonic-gate #   define _XOPEN_SOURCE
1955*7c478bd9Sstevel@tonic-gate #   define _XOPEN_SOURCE_EXTENDED 1
1956*7c478bd9Sstevel@tonic-gate #   include <sys/resource.h>
1957*7c478bd9Sstevel@tonic-gate #   undef _XOPEN_SOURCE
1958*7c478bd9Sstevel@tonic-gate #   undef _XOPEN_SOURCE_EXTENDED
1959*7c478bd9Sstevel@tonic-gate #  endif /* ! _XOPEN_SOURCE */
1960*7c478bd9Sstevel@tonic-gate # endif /* NCR_MP_RAS3 */
1961*7c478bd9Sstevel@tonic-gate 
1962*7c478bd9Sstevel@tonic-gate 
1963*7c478bd9Sstevel@tonic-gate /*
1964*7c478bd9Sstevel@tonic-gate **  Tandem NonStop-UX SVR4
1965*7c478bd9Sstevel@tonic-gate **
1966*7c478bd9Sstevel@tonic-gate **	From Rick McCarty <mccarty@mpd.tandem.com>.
1967*7c478bd9Sstevel@tonic-gate */
1968*7c478bd9Sstevel@tonic-gate 
1969*7c478bd9Sstevel@tonic-gate # ifdef NonStop_UX_BXX
1970*7c478bd9Sstevel@tonic-gate #  define __svr4__
1971*7c478bd9Sstevel@tonic-gate # endif /* NonStop_UX_BXX */
1972*7c478bd9Sstevel@tonic-gate 
1973*7c478bd9Sstevel@tonic-gate 
1974*7c478bd9Sstevel@tonic-gate /*
1975*7c478bd9Sstevel@tonic-gate **  Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2.
1976*7c478bd9Sstevel@tonic-gate **
1977*7c478bd9Sstevel@tonic-gate **	Tested for 1.04, 1.03
1978*7c478bd9Sstevel@tonic-gate **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
1979*7c478bd9Sstevel@tonic-gate **
1980*7c478bd9Sstevel@tonic-gate **	Tested for 4.02, 6.10 and 7.10
1981*7c478bd9Sstevel@tonic-gate **	From Motonori NAKAMURA <motonori@media.kyoto-u.ac.jp>.
1982*7c478bd9Sstevel@tonic-gate */
1983*7c478bd9Sstevel@tonic-gate 
1984*7c478bd9Sstevel@tonic-gate # if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE))
1985*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* include all the System V defines */
1986*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
1987*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	1	/* has fchmod(2) syscall */
1988*7c478bd9Sstevel@tonic-gate #  define setreuid(r, e)	setresuid(r, e, -1)
1989*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_FLOAT
1990*7c478bd9Sstevel@tonic-gate #  define SPT_TYPE	SPT_PSTAT
1991*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1992*7c478bd9Sstevel@tonic-gate #  ifndef HASSETVBUF
1993*7c478bd9Sstevel@tonic-gate #   define HASSETVBUF	/* HI-UX has no setlinebuf */
1994*7c478bd9Sstevel@tonic-gate #  endif /* ! HASSETVBUF */
1995*7c478bd9Sstevel@tonic-gate #  ifndef GIDSET_T
1996*7c478bd9Sstevel@tonic-gate #   define GIDSET_T	gid_t
1997*7c478bd9Sstevel@tonic-gate #  endif /* ! GIDSET_T */
1998*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_UNIX
1999*7c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/HI-UX"
2000*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_UNIX */
2001*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
2002*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
2003*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
2004*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
2005*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
2006*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
2007*7c478bd9Sstevel@tonic-gate #  ifndef HASGETUSERSHELL
2008*7c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
2009*7c478bd9Sstevel@tonic-gate #  endif /* ! HASGETUSERSHELL */
2010*7c478bd9Sstevel@tonic-gate #  define FDSET_CAST	(int *)	/* cast for fd_set parameters to select */
2011*7c478bd9Sstevel@tonic-gate 
2012*7c478bd9Sstevel@tonic-gate /*
2013*7c478bd9Sstevel@tonic-gate **  avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h
2014*7c478bd9Sstevel@tonic-gate **  on HIUX 3050
2015*7c478bd9Sstevel@tonic-gate */
2016*7c478bd9Sstevel@tonic-gate #  undef m_flags
2017*7c478bd9Sstevel@tonic-gate 
2018*7c478bd9Sstevel@tonic-gate #  define SM_CONF_SYSLOG	0
2019*7c478bd9Sstevel@tonic-gate 
2020*7c478bd9Sstevel@tonic-gate # endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */
2021*7c478bd9Sstevel@tonic-gate 
2022*7c478bd9Sstevel@tonic-gate 
2023*7c478bd9Sstevel@tonic-gate /*
2024*7c478bd9Sstevel@tonic-gate **  Amdahl UTS System V 2.1.5 (SVr3-based)
2025*7c478bd9Sstevel@tonic-gate **
2026*7c478bd9Sstevel@tonic-gate **    From: Janet Jackson <janet@dialix.oz.au>.
2027*7c478bd9Sstevel@tonic-gate */
2028*7c478bd9Sstevel@tonic-gate 
2029*7c478bd9Sstevel@tonic-gate # ifdef _UTS
2030*7c478bd9Sstevel@tonic-gate #  include <sys/sysmacros.h>
2031*7c478bd9Sstevel@tonic-gate #  undef HASLSTAT		/* has symlinks, but they cause problems */
2032*7c478bd9Sstevel@tonic-gate #  define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
2033*7c478bd9Sstevel@tonic-gate #  define SYS5SIGNALS	1	/* System V signal semantics */
2034*7c478bd9Sstevel@tonic-gate #  define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
2035*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
2036*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) function */
2037*7c478bd9Sstevel@tonic-gate #  define HASSETVBUF	1	/* has setvbuf(3) function */
2038*7c478bd9Sstevel@tonic-gate #  ifndef HASGETUSERSHELL
2039*7c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
2040*7c478bd9Sstevel@tonic-gate #  endif /* ! HASGETUSERSHELL */
2041*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
2042*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_ZERO		/* doesn't have load average */
2043*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
2044*7c478bd9Sstevel@tonic-gate #  define SFS_BAVAIL	f_bfree		/* alternate field name */
2045*7c478bd9Sstevel@tonic-gate #  define _PATH_UNIX		"/unix"
2046*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
2047*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
2048*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
2049*7c478bd9Sstevel@tonic-gate # endif /* _UTS */
2050*7c478bd9Sstevel@tonic-gate 
2051*7c478bd9Sstevel@tonic-gate /*
2052*7c478bd9Sstevel@tonic-gate **  Cray Computer Corporation's CSOS
2053*7c478bd9Sstevel@tonic-gate **
2054*7c478bd9Sstevel@tonic-gate **	From Scott Bolte <scott@craycos.com>.
2055*7c478bd9Sstevel@tonic-gate */
2056*7c478bd9Sstevel@tonic-gate 
2057*7c478bd9Sstevel@tonic-gate # ifdef _CRAYCOM
2058*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1	/* include all the System V defines */
2059*7c478bd9Sstevel@tonic-gate #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
2060*7c478bd9Sstevel@tonic-gate #  define NEEDFSYNC	1	/* no fsync in system library */
2061*7c478bd9Sstevel@tonic-gate #  define MAXPATHLEN	PATHSIZE
2062*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_ZERO
2063*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
2064*7c478bd9Sstevel@tonic-gate #  define SFS_BAVAIL	f_bfree		/* alternate field name */
2065*7c478bd9Sstevel@tonic-gate #  define _POSIX_CHOWN_RESTRICTED	-1
2066*7c478bd9Sstevel@tonic-gate extern struct group	*getgrent(), *getgrnam(), *getgrgid();
2067*7c478bd9Sstevel@tonic-gate # endif /* _CRAYCOM */
2068*7c478bd9Sstevel@tonic-gate 
2069*7c478bd9Sstevel@tonic-gate 
2070*7c478bd9Sstevel@tonic-gate /*
2071*7c478bd9Sstevel@tonic-gate **  Sony NEWS-OS 4.2.1R and 6.0.3
2072*7c478bd9Sstevel@tonic-gate **
2073*7c478bd9Sstevel@tonic-gate **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
2074*7c478bd9Sstevel@tonic-gate */
2075*7c478bd9Sstevel@tonic-gate 
2076*7c478bd9Sstevel@tonic-gate # ifdef sony_news
2077*7c478bd9Sstevel@tonic-gate #  ifndef __svr4
2078*7c478bd9Sstevel@tonic-gate 			/* NEWS-OS 4.2.1R */
2079*7c478bd9Sstevel@tonic-gate #   ifndef BSD
2080*7c478bd9Sstevel@tonic-gate #    define BSD			/* has BSD routines */
2081*7c478bd9Sstevel@tonic-gate #   endif /* ! BSD */
2082*7c478bd9Sstevel@tonic-gate #   define HASUNSETENV	1	/* has unsetenv(2) call */
2083*7c478bd9Sstevel@tonic-gate #   undef HASSETVBUF		/* don't actually have setvbuf(3) */
2084*7c478bd9Sstevel@tonic-gate #   define WAITUNION	1	/* use "union wait" as wait argument type */
2085*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
2086*7c478bd9Sstevel@tonic-gate #   define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
2087*7c478bd9Sstevel@tonic-gate #   ifndef HASFLOCK
2088*7c478bd9Sstevel@tonic-gate #    define HASFLOCK	1	/* has flock(2) call */
2089*7c478bd9Sstevel@tonic-gate #   endif /* ! HASFLOCK */
2090*7c478bd9Sstevel@tonic-gate #   define setpgid	setpgrp
2091*7c478bd9Sstevel@tonic-gate #   undef WIFEXITED
2092*7c478bd9Sstevel@tonic-gate #   undef WEXITSTATUS
2093*7c478bd9Sstevel@tonic-gate #   define MODE_T	int	/* system include files have no mode_t */
2094*7c478bd9Sstevel@tonic-gate typedef int		pid_t;
2095*7c478bd9Sstevel@tonic-gate typedef int		(*sigfunc_t)();
2096*7c478bd9Sstevel@tonic-gate #   define SIGFUNC_DEFINED
2097*7c478bd9Sstevel@tonic-gate #   define SIGFUNC_RETURN	(0)
2098*7c478bd9Sstevel@tonic-gate #   define SIGFUNC_DECL		int
2099*7c478bd9Sstevel@tonic-gate 
2100*7c478bd9Sstevel@tonic-gate #  else /* ! __svr4 */
2101*7c478bd9Sstevel@tonic-gate 			/* NEWS-OS 6.0.3 with /bin/cc */
2102*7c478bd9Sstevel@tonic-gate #   ifndef __svr4__
2103*7c478bd9Sstevel@tonic-gate #    define __svr4__		/* use all System V Release 4 defines below */
2104*7c478bd9Sstevel@tonic-gate #   endif /* ! __svr4__ */
2105*7c478bd9Sstevel@tonic-gate #   define HASSETSID	1	/* has POSIX setsid(2) call */
2106*7c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
2107*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
2108*7c478bd9Sstevel@tonic-gate #   ifndef SPT_TYPE
2109*7c478bd9Sstevel@tonic-gate #    define SPT_TYPE	SPT_SYSMIPS	/* use sysmips() (OS 6.0.2 or later) */
2110*7c478bd9Sstevel@tonic-gate #   endif /* ! SPT_TYPE */
2111*7c478bd9Sstevel@tonic-gate #   define GIDSET_T	gid_t
2112*7c478bd9Sstevel@tonic-gate #   undef WIFEXITED
2113*7c478bd9Sstevel@tonic-gate #   undef WEXITSTATUS
2114*7c478bd9Sstevel@tonic-gate #   ifndef SYSLOG_BUFSIZE
2115*7c478bd9Sstevel@tonic-gate #    define SYSLOG_BUFSIZE	256
2116*7c478bd9Sstevel@tonic-gate #   endif /* ! SYSLOG_BUFSIZE */
2117*7c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/stand/unix"
2118*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_VENDOR_CF
2119*7c478bd9Sstevel@tonic-gate #    define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
2120*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_VENDOR_CF */
2121*7c478bd9Sstevel@tonic-gate #   ifndef _PATH_SENDMAILPID
2122*7c478bd9Sstevel@tonic-gate #    define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
2123*7c478bd9Sstevel@tonic-gate #   endif /* ! _PATH_SENDMAILPID */
2124*7c478bd9Sstevel@tonic-gate 
2125*7c478bd9Sstevel@tonic-gate #  endif /* ! __svr4 */
2126*7c478bd9Sstevel@tonic-gate # endif /* sony_news */
2127*7c478bd9Sstevel@tonic-gate 
2128*7c478bd9Sstevel@tonic-gate 
2129*7c478bd9Sstevel@tonic-gate /*
2130*7c478bd9Sstevel@tonic-gate **  Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
2131*7c478bd9Sstevel@tonic-gate **
2132*7c478bd9Sstevel@tonic-gate **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
2133*7c478bd9Sstevel@tonic-gate */
2134*7c478bd9Sstevel@tonic-gate 
2135*7c478bd9Sstevel@tonic-gate # ifdef luna
2136*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
2137*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
2138*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
2139*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV	1	/* has unsetenv(2) call */
2140*7c478bd9Sstevel@tonic-gate #  define NEEDPUTENV	1	/* need putenv(3) call */
2141*7c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	0	/* need a replacement for getopt(3) */
2142*7c478bd9Sstevel@tonic-gate #  define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
2143*7c478bd9Sstevel@tonic-gate #  define WAITUNION	1	/* use "union wait" as wait argument type */
2144*7c478bd9Sstevel@tonic-gate #  ifdef uniosb
2145*7c478bd9Sstevel@tonic-gate #   include <sys/time.h>
2146*7c478bd9Sstevel@tonic-gate #   define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
2147*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
2148*7c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
2149*7c478bd9Sstevel@tonic-gate #  endif /* uniosb */
2150*7c478bd9Sstevel@tonic-gate #  ifdef luna2
2151*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_SUBR
2152*7c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
2153*7c478bd9Sstevel@tonic-gate #  endif /* luna2 */
2154*7c478bd9Sstevel@tonic-gate #  ifdef luna88k
2155*7c478bd9Sstevel@tonic-gate #   define LA_TYPE	LA_INT
2156*7c478bd9Sstevel@tonic-gate #  endif /* luna88k */
2157*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
2158*7c478bd9Sstevel@tonic-gate #  define setpgid	setpgrp
2159*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
2160*7c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
2161*7c478bd9Sstevel@tonic-gate typedef int		pid_t;
2162*7c478bd9Sstevel@tonic-gate typedef int		(*sigfunc_t)();
2163*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_DEFINED
2164*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_RETURN	(0)
2165*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_DECL	int
2166*7c478bd9Sstevel@tonic-gate extern char	*getenv();
2167*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
2168*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
2169*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
2170*7c478bd9Sstevel@tonic-gate # endif /* luna */
2171*7c478bd9Sstevel@tonic-gate 
2172*7c478bd9Sstevel@tonic-gate 
2173*7c478bd9Sstevel@tonic-gate /*
2174*7c478bd9Sstevel@tonic-gate **  NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
2175*7c478bd9Sstevel@tonic-gate **
2176*7c478bd9Sstevel@tonic-gate **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
2177*7c478bd9Sstevel@tonic-gate */
2178*7c478bd9Sstevel@tonic-gate 
2179*7c478bd9Sstevel@tonic-gate # if defined(nec_ews_svr4) || defined(_nec_ews_svr4)
2180*7c478bd9Sstevel@tonic-gate #  ifndef __svr4__
2181*7c478bd9Sstevel@tonic-gate #   define __svr4__		/* use all System V Release 4 defines below */
2182*7c478bd9Sstevel@tonic-gate #  endif /* ! __svr4__ */
2183*7c478bd9Sstevel@tonic-gate #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
2184*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
2185*7c478bd9Sstevel@tonic-gate #  define LA_TYPE	LA_READKSYM	/* use MIOC_READSYM ioctl */
2186*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
2187*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
2188*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
2189*7c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
2190*7c478bd9Sstevel@tonic-gate #  define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
2191*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
2192*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
2193*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
2194*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
2195*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
2196*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
2197*7c478bd9Sstevel@tonic-gate #  ifndef SYSLOG_BUFSIZE
2198*7c478bd9Sstevel@tonic-gate #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
2199*7c478bd9Sstevel@tonic-gate #  endif /* ! SYSLOG_BUFSIZE */
2200*7c478bd9Sstevel@tonic-gate # endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */
2201*7c478bd9Sstevel@tonic-gate 
2202*7c478bd9Sstevel@tonic-gate 
2203*7c478bd9Sstevel@tonic-gate /*
2204*7c478bd9Sstevel@tonic-gate **  Fujitsu/ICL UXP/DS (For the DS/90 Series)
2205*7c478bd9Sstevel@tonic-gate **
2206*7c478bd9Sstevel@tonic-gate **	From Diego R. Lopez <drlopez@cica.es>.
2207*7c478bd9Sstevel@tonic-gate **	Additional changes from Fumio Moriya and Toshiaki Nomura of the
2208*7c478bd9Sstevel@tonic-gate **		Fujitsu Fresoftware group <dsfrsoft@oai6.yk.fujitsu.co.jp>.
2209*7c478bd9Sstevel@tonic-gate */
2210*7c478bd9Sstevel@tonic-gate 
2211*7c478bd9Sstevel@tonic-gate # ifdef __uxp__
2212*7c478bd9Sstevel@tonic-gate #  include <arpa/nameser.h>
2213*7c478bd9Sstevel@tonic-gate #  include <sys/sysmacros.h>
2214*7c478bd9Sstevel@tonic-gate #  include <sys/mkdev.h>
2215*7c478bd9Sstevel@tonic-gate #  define __svr4__
2216*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL	0
2217*7c478bd9Sstevel@tonic-gate #  define HASFLOCK		0
2218*7c478bd9Sstevel@tonic-gate #  define _PATH_UNIX		"/stand/unix"
2219*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
2220*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
2221*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
2222*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
2223*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
2224*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
2225*7c478bd9Sstevel@tonic-gate # endif /* __uxp__ */
2226*7c478bd9Sstevel@tonic-gate 
2227*7c478bd9Sstevel@tonic-gate /*
2228*7c478bd9Sstevel@tonic-gate **  Pyramid DC/OSx
2229*7c478bd9Sstevel@tonic-gate **
2230*7c478bd9Sstevel@tonic-gate **	From Earle Ake <akee@wpdiss1.wpafb.af.mil>.
2231*7c478bd9Sstevel@tonic-gate */
2232*7c478bd9Sstevel@tonic-gate 
2233*7c478bd9Sstevel@tonic-gate # ifdef DCOSx
2234*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	gid_t
2235*7c478bd9Sstevel@tonic-gate #  ifndef IDENTPROTO
2236*7c478bd9Sstevel@tonic-gate #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
2237*7c478bd9Sstevel@tonic-gate #  endif /* ! IDENTPROTO */
2238*7c478bd9Sstevel@tonic-gate # endif /* DCOSx */
2239*7c478bd9Sstevel@tonic-gate 
2240*7c478bd9Sstevel@tonic-gate /*
2241*7c478bd9Sstevel@tonic-gate **  Concurrent Computer Corporation Maxion
2242*7c478bd9Sstevel@tonic-gate **
2243*7c478bd9Sstevel@tonic-gate **	From Donald R. Laster Jr. <laster@access.digex.net>.
2244*7c478bd9Sstevel@tonic-gate */
2245*7c478bd9Sstevel@tonic-gate 
2246*7c478bd9Sstevel@tonic-gate # ifdef __MAXION__
2247*7c478bd9Sstevel@tonic-gate 
2248*7c478bd9Sstevel@tonic-gate #  include <sys/stream.h>
2249*7c478bd9Sstevel@tonic-gate #  define __svr4__		1	/* SVR4.2MP */
2250*7c478bd9Sstevel@tonic-gate #  define HASSETREUID		1	/* have setreuid(2) */
2251*7c478bd9Sstevel@tonic-gate #  define HASLSTAT		1	/* have lstat(2) */
2252*7c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT		1	/* have setrlimit(2) */
2253*7c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE	1	/* have getdtablesize(2) */
2254*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL	1	/* have getusershell(3) */
2255*7c478bd9Sstevel@tonic-gate #  define NOFTRUNCATE		1	/* do not have ftruncate(2) */
2256*7c478bd9Sstevel@tonic-gate #  define SLEEP_T		unsigned
2257*7c478bd9Sstevel@tonic-gate #  define SFS_TYPE		SFS_STATVFS
2258*7c478bd9Sstevel@tonic-gate #  define SFS_BAVAIL		f_bavail
2259*7c478bd9Sstevel@tonic-gate #  ifndef SYSLOG_BUFSIZE
2260*7c478bd9Sstevel@tonic-gate #   define SYSLOG_BUFSIZE	256	/* Use 256 bytes */
2261*7c478bd9Sstevel@tonic-gate #  endif /* ! SYSLOG_BUFSIZE */
2262*7c478bd9Sstevel@tonic-gate 
2263*7c478bd9Sstevel@tonic-gate #  undef WUNTRACED
2264*7c478bd9Sstevel@tonic-gate #  undef WIFEXITED
2265*7c478bd9Sstevel@tonic-gate #  undef WIFSIGNALED
2266*7c478bd9Sstevel@tonic-gate #  undef WIFSTOPPED
2267*7c478bd9Sstevel@tonic-gate #  undef WEXITSTATUS
2268*7c478bd9Sstevel@tonic-gate #  undef WTERMSIG
2269*7c478bd9Sstevel@tonic-gate #  undef WSTOPSIG
2270*7c478bd9Sstevel@tonic-gate 
2271*7c478bd9Sstevel@tonic-gate # endif /* __MAXION__ */
2272*7c478bd9Sstevel@tonic-gate 
2273*7c478bd9Sstevel@tonic-gate /*
2274*7c478bd9Sstevel@tonic-gate **  Harris Nighthawk PowerUX (nh6000 box)
2275*7c478bd9Sstevel@tonic-gate **
2276*7c478bd9Sstevel@tonic-gate **  Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com>
2277*7c478bd9Sstevel@tonic-gate */
2278*7c478bd9Sstevel@tonic-gate 
2279*7c478bd9Sstevel@tonic-gate # ifdef _PowerUX
2280*7c478bd9Sstevel@tonic-gate #  ifndef __svr4__
2281*7c478bd9Sstevel@tonic-gate #   define __svr4__
2282*7c478bd9Sstevel@tonic-gate #  endif /* ! __svr4__ */
2283*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
2284*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
2285*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
2286*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
2287*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
2288*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
2289*7c478bd9Sstevel@tonic-gate #  define SYSLOG_BUFSIZE		1024
2290*7c478bd9Sstevel@tonic-gate #  define LA_TYPE		LA_ZERO
2291*7c478bd9Sstevel@tonic-gate typedef struct msgb		mblk_t;
2292*7c478bd9Sstevel@tonic-gate #  undef offsetof	/* avoid stddefs.h and sys/sysmacros.h conflict */
2293*7c478bd9Sstevel@tonic-gate # endif /* _PowerUX */
2294*7c478bd9Sstevel@tonic-gate 
2295*7c478bd9Sstevel@tonic-gate /*
2296*7c478bd9Sstevel@tonic-gate **  Siemens Nixdorf Informationssysteme AG SINIX
2297*7c478bd9Sstevel@tonic-gate **
2298*7c478bd9Sstevel@tonic-gate **	Contributed by Gerald Rinske of Siemens Business Services VAS.
2299*7c478bd9Sstevel@tonic-gate */
2300*7c478bd9Sstevel@tonic-gate # ifdef sinix
2301*7c478bd9Sstevel@tonic-gate #  define HASRANDOM		0	/* has random(3) */
2302*7c478bd9Sstevel@tonic-gate #  define SYSLOG_BUFSIZE	1024
2303*7c478bd9Sstevel@tonic-gate #  define SM_INT32		int	/* 32bit integer */
2304*7c478bd9Sstevel@tonic-gate # endif /* sinix */
2305*7c478bd9Sstevel@tonic-gate 
2306*7c478bd9Sstevel@tonic-gate 
2307*7c478bd9Sstevel@tonic-gate /*
2308*7c478bd9Sstevel@tonic-gate **  Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3
2309*7c478bd9Sstevel@tonic-gate **
2310*7c478bd9Sstevel@tonic-gate **	Contributed by Sergey Rusanov <rsm@utfoms.udmnet.ru>
2311*7c478bd9Sstevel@tonic-gate */
2312*7c478bd9Sstevel@tonic-gate 
2313*7c478bd9Sstevel@tonic-gate # ifdef MOTO
2314*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD		1
2315*7c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT		0
2316*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
2317*7c478bd9Sstevel@tonic-gate #  define HASSETREUID		1
2318*7c478bd9Sstevel@tonic-gate #  define HASULIMIT		1
2319*7c478bd9Sstevel@tonic-gate #  define HASWAITPID		1
2320*7c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE	1
2321*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL	1
2322*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE		0
2323*7c478bd9Sstevel@tonic-gate #  define IDENTPROTO		0
2324*7c478bd9Sstevel@tonic-gate #  define RES_DNSRCH_VARIABLE	_res_dnsrch
2325*7c478bd9Sstevel@tonic-gate #  define _PATH_UNIX		"/unix"
2326*7c478bd9Sstevel@tonic-gate #  define _PATH_VENDOR_CF	"/etc/sendmail.cf"
2327*7c478bd9Sstevel@tonic-gate #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
2328*7c478bd9Sstevel@tonic-gate # endif /* MOTO */
2329*7c478bd9Sstevel@tonic-gate 
2330*7c478bd9Sstevel@tonic-gate /*
2331*7c478bd9Sstevel@tonic-gate **  Interix
2332*7c478bd9Sstevel@tonic-gate **	Contributed by Nedelcho Stanev <nedelcho.stanev@atlanticsky.com>
2333*7c478bd9Sstevel@tonic-gate **
2334*7c478bd9Sstevel@tonic-gate **	Used for Interix support.
2335*7c478bd9Sstevel@tonic-gate */
2336*7c478bd9Sstevel@tonic-gate 
2337*7c478bd9Sstevel@tonic-gate # if defined(__INTERIX)
2338*7c478bd9Sstevel@tonic-gate #  define HASURANDOMDEV		1
2339*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL	0
2340*7c478bd9Sstevel@tonic-gate #  define HASSTRERROR		1
2341*7c478bd9Sstevel@tonic-gate #  define HASUNSETENV		1
2342*7c478bd9Sstevel@tonic-gate #  define HASFCHOWN		1
2343*7c478bd9Sstevel@tonic-gate #  undef HAVE_SYS_ERRLIST
2344*7c478bd9Sstevel@tonic-gate #  define sys_errlist		__sys_errlist
2345*7c478bd9Sstevel@tonic-gate #  define sys_nerr		__sys_nerr
2346*7c478bd9Sstevel@tonic-gate #  include <sys/mkdev.h>
2347*7c478bd9Sstevel@tonic-gate #  ifndef major
2348*7c478bd9Sstevel@tonic-gate #   define major(dev)		((int)(((dev) >> 8) & 0xff))
2349*7c478bd9Sstevel@tonic-gate #  endif /* ! major */
2350*7c478bd9Sstevel@tonic-gate #  ifndef minor
2351*7c478bd9Sstevel@tonic-gate #   define minor(dev)		((int)((dev) & 0xff))
2352*7c478bd9Sstevel@tonic-gate #  endif /* ! minor */
2353*7c478bd9Sstevel@tonic-gate # endif /* defined(__INTERIX) */
2354*7c478bd9Sstevel@tonic-gate 
2355*7c478bd9Sstevel@tonic-gate 
2356*7c478bd9Sstevel@tonic-gate /**********************************************************************
2357*7c478bd9Sstevel@tonic-gate **  End of Per-Operating System defines
2358*7c478bd9Sstevel@tonic-gate **********************************************************************/
2359*7c478bd9Sstevel@tonic-gate /**********************************************************************
2360*7c478bd9Sstevel@tonic-gate **  More general defines
2361*7c478bd9Sstevel@tonic-gate **********************************************************************/
2362*7c478bd9Sstevel@tonic-gate 
2363*7c478bd9Sstevel@tonic-gate /* general BSD defines */
2364*7c478bd9Sstevel@tonic-gate # ifdef BSD
2365*7c478bd9Sstevel@tonic-gate #  define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
2366*7c478bd9Sstevel@tonic-gate #  ifndef HASSETREUID
2367*7c478bd9Sstevel@tonic-gate #   define HASSETREUID	1	/* has setreuid(2) call */
2368*7c478bd9Sstevel@tonic-gate #  endif /* ! HASSETREUID */
2369*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
2370*7c478bd9Sstevel@tonic-gate #  ifndef IP_SRCROUTE
2371*7c478bd9Sstevel@tonic-gate #   define IP_SRCROUTE	1	/* can check IP source routing */
2372*7c478bd9Sstevel@tonic-gate #  endif /* ! IP_SRCROUTE */
2373*7c478bd9Sstevel@tonic-gate #  ifndef HASSETRLIMIT
2374*7c478bd9Sstevel@tonic-gate #   define HASSETRLIMIT	1	/* has setrlimit(2) call */
2375*7c478bd9Sstevel@tonic-gate #  endif /* ! HASSETRLIMIT */
2376*7c478bd9Sstevel@tonic-gate #  ifndef HASFLOCK
2377*7c478bd9Sstevel@tonic-gate #   define HASFLOCK	1	/* has flock(2) call */
2378*7c478bd9Sstevel@tonic-gate #  endif /* ! HASFLOCK */
2379*7c478bd9Sstevel@tonic-gate #  ifndef TZ_TYPE
2380*7c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
2381*7c478bd9Sstevel@tonic-gate #  endif /* ! TZ_TYPE */
2382*7c478bd9Sstevel@tonic-gate # endif /* BSD */
2383*7c478bd9Sstevel@tonic-gate 
2384*7c478bd9Sstevel@tonic-gate /* general System V Release 4 defines */
2385*7c478bd9Sstevel@tonic-gate # ifdef __svr4__
2386*7c478bd9Sstevel@tonic-gate #  define SYSTEM5	1
2387*7c478bd9Sstevel@tonic-gate #  define USESETEUID	1	/* has usable seteuid(2) call */
2388*7c478bd9Sstevel@tonic-gate #  define HASINITGROUPS	1	/* has initgroups(3) call */
2389*7c478bd9Sstevel@tonic-gate #  define BSD_COMP	1	/* get BSD ioctl calls */
2390*7c478bd9Sstevel@tonic-gate #  ifndef HASSETRLIMIT
2391*7c478bd9Sstevel@tonic-gate #   define HASSETRLIMIT	1	/* has setrlimit(2) call */
2392*7c478bd9Sstevel@tonic-gate #  endif /* ! HASSETRLIMIT */
2393*7c478bd9Sstevel@tonic-gate #  ifndef HASGETUSERSHELL
2394*7c478bd9Sstevel@tonic-gate #   define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
2395*7c478bd9Sstevel@tonic-gate #  endif /* ! HASGETUSERSHELL */
2396*7c478bd9Sstevel@tonic-gate #  ifndef HASFCHMOD
2397*7c478bd9Sstevel@tonic-gate #   define HASFCHMOD	1	/* most (all?) SVr4s seem to have fchmod(2) */
2398*7c478bd9Sstevel@tonic-gate #  endif /* ! HASFCHMOD */
2399*7c478bd9Sstevel@tonic-gate 
2400*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_UNIX
2401*7c478bd9Sstevel@tonic-gate #   define _PATH_UNIX		"/unix"
2402*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_UNIX */
2403*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_VENDOR_CF
2404*7c478bd9Sstevel@tonic-gate #   define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
2405*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_VENDOR_CF */
2406*7c478bd9Sstevel@tonic-gate #  ifndef _PATH_SENDMAILPID
2407*7c478bd9Sstevel@tonic-gate #   define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
2408*7c478bd9Sstevel@tonic-gate #  endif /* ! _PATH_SENDMAILPID */
2409*7c478bd9Sstevel@tonic-gate #  ifndef SYSLOG_BUFSIZE
2410*7c478bd9Sstevel@tonic-gate #   define SYSLOG_BUFSIZE	128
2411*7c478bd9Sstevel@tonic-gate #  endif /* ! SYSLOG_BUFSIZE */
2412*7c478bd9Sstevel@tonic-gate #  ifndef SFS_TYPE
2413*7c478bd9Sstevel@tonic-gate #   define SFS_TYPE		SFS_STATVFS
2414*7c478bd9Sstevel@tonic-gate #  endif /* ! SFS_TYPE */
2415*7c478bd9Sstevel@tonic-gate 
2416*7c478bd9Sstevel@tonic-gate #  ifndef USE_SIGLONGJMP
2417*7c478bd9Sstevel@tonic-gate #   define USE_SIGLONGJMP	1 /* sigsetjmp needed for signal handling */
2418*7c478bd9Sstevel@tonic-gate #  endif /* ! USE_SIGLONGJMP */
2419*7c478bd9Sstevel@tonic-gate # endif /* __svr4__ */
2420*7c478bd9Sstevel@tonic-gate 
2421*7c478bd9Sstevel@tonic-gate # ifdef __SVR4
2422*7c478bd9Sstevel@tonic-gate #  define LDA_USE_LOCKF		1
2423*7c478bd9Sstevel@tonic-gate #  define LDA_USE_SETEUID	1
2424*7c478bd9Sstevel@tonic-gate #  define _PATH_MAILDIR		"/var/mail"
2425*7c478bd9Sstevel@tonic-gate # endif /* __SVR4 */
2426*7c478bd9Sstevel@tonic-gate 
2427*7c478bd9Sstevel@tonic-gate /* general System V defines */
2428*7c478bd9Sstevel@tonic-gate # ifdef SYSTEM5
2429*7c478bd9Sstevel@tonic-gate #  include <sys/sysmacros.h>
2430*7c478bd9Sstevel@tonic-gate #  define HASUNAME	1	/* use System V uname(2) system call */
2431*7c478bd9Sstevel@tonic-gate #  define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
2432*7c478bd9Sstevel@tonic-gate #  define HASSETVBUF	1	/* we have setvbuf(3) in libc */
2433*7c478bd9Sstevel@tonic-gate #  ifndef HASULIMIT
2434*7c478bd9Sstevel@tonic-gate #   define HASULIMIT	1	/* has the ulimit(2) syscall */
2435*7c478bd9Sstevel@tonic-gate #  endif /* ! HASULIMIT */
2436*7c478bd9Sstevel@tonic-gate #  ifndef LA_TYPE
2437*7c478bd9Sstevel@tonic-gate #   ifdef MIOC_READKSYM
2438*7c478bd9Sstevel@tonic-gate #    define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
2439*7c478bd9Sstevel@tonic-gate #   else /* MIOC_READKSYM */
2440*7c478bd9Sstevel@tonic-gate #    define LA_TYPE	LA_INT		/* assume integer load average */
2441*7c478bd9Sstevel@tonic-gate #   endif /* MIOC_READKSYM */
2442*7c478bd9Sstevel@tonic-gate #  endif /* ! LA_TYPE */
2443*7c478bd9Sstevel@tonic-gate #  ifndef SFS_TYPE
2444*7c478bd9Sstevel@tonic-gate #   define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
2445*7c478bd9Sstevel@tonic-gate #  endif /* ! SFS_TYPE */
2446*7c478bd9Sstevel@tonic-gate #  ifndef TZ_TYPE
2447*7c478bd9Sstevel@tonic-gate #   define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
2448*7c478bd9Sstevel@tonic-gate #  endif /* ! TZ_TYPE */
2449*7c478bd9Sstevel@tonic-gate # endif /* SYSTEM5 */
2450*7c478bd9Sstevel@tonic-gate 
2451*7c478bd9Sstevel@tonic-gate /* general POSIX defines */
2452*7c478bd9Sstevel@tonic-gate # ifdef _POSIX_VERSION
2453*7c478bd9Sstevel@tonic-gate #  define HASSETSID	1	/* has POSIX setsid(2) call */
2454*7c478bd9Sstevel@tonic-gate #  define HASWAITPID	1	/* has POSIX waitpid(2) call */
2455*7c478bd9Sstevel@tonic-gate #  if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
2456*7c478bd9Sstevel@tonic-gate #   define USESETEUID	1	/* has usable seteuid(2) call */
2457*7c478bd9Sstevel@tonic-gate #  endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */
2458*7c478bd9Sstevel@tonic-gate # endif /* _POSIX_VERSION */
2459*7c478bd9Sstevel@tonic-gate /*
2460*7c478bd9Sstevel@tonic-gate **  Tweaking for systems that (for example) claim to be BSD or POSIX
2461*7c478bd9Sstevel@tonic-gate **  but don't have all the standard BSD or POSIX routines (boo hiss).
2462*7c478bd9Sstevel@tonic-gate */
2463*7c478bd9Sstevel@tonic-gate 
2464*7c478bd9Sstevel@tonic-gate # ifdef titan
2465*7c478bd9Sstevel@tonic-gate #  undef HASINITGROUPS		/* doesn't have initgroups(3) call */
2466*7c478bd9Sstevel@tonic-gate # endif /* titan */
2467*7c478bd9Sstevel@tonic-gate 
2468*7c478bd9Sstevel@tonic-gate # ifdef _CRAYCOM
2469*7c478bd9Sstevel@tonic-gate #  undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
2470*7c478bd9Sstevel@tonic-gate # endif /* _CRAYCOM */
2471*7c478bd9Sstevel@tonic-gate 
2472*7c478bd9Sstevel@tonic-gate # ifdef MOTO
2473*7c478bd9Sstevel@tonic-gate #  undef USESETEUID
2474*7c478bd9Sstevel@tonic-gate # endif /* MOTO */
2475*7c478bd9Sstevel@tonic-gate 
2476*7c478bd9Sstevel@tonic-gate /*
2477*7c478bd9Sstevel@tonic-gate **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
2478*7c478bd9Sstevel@tonic-gate **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
2479*7c478bd9Sstevel@tonic-gate **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
2480*7c478bd9Sstevel@tonic-gate **  are closed.  Some firewalls return this error if you try to connect
2481*7c478bd9Sstevel@tonic-gate **  to the IDENT port (113), so you can't receive email from these hosts
2482*7c478bd9Sstevel@tonic-gate **  on these systems.  The firewall really should use a more specific
2483*7c478bd9Sstevel@tonic-gate **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB.  If
2484*7c478bd9Sstevel@tonic-gate **  not explicitly set to zero above, default it on.
2485*7c478bd9Sstevel@tonic-gate */
2486*7c478bd9Sstevel@tonic-gate 
2487*7c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO
2488*7c478bd9Sstevel@tonic-gate #  define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
2489*7c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */
2490*7c478bd9Sstevel@tonic-gate 
2491*7c478bd9Sstevel@tonic-gate # ifndef IP_SRCROUTE
2492*7c478bd9Sstevel@tonic-gate #  define IP_SRCROUTE	1	/* Detect IP source routing */
2493*7c478bd9Sstevel@tonic-gate # endif /* ! IP_SRCROUTE */
2494*7c478bd9Sstevel@tonic-gate 
2495*7c478bd9Sstevel@tonic-gate # ifndef HASGETUSERSHELL
2496*7c478bd9Sstevel@tonic-gate #  define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
2497*7c478bd9Sstevel@tonic-gate # endif /* ! HASGETUSERSHELL */
2498*7c478bd9Sstevel@tonic-gate 
2499*7c478bd9Sstevel@tonic-gate # ifndef NETUNIX
2500*7c478bd9Sstevel@tonic-gate #  define NETUNIX	1	/* include unix domain support */
2501*7c478bd9Sstevel@tonic-gate # endif /* ! NETUNIX */
2502*7c478bd9Sstevel@tonic-gate 
2503*7c478bd9Sstevel@tonic-gate # ifndef HASRANDOM
2504*7c478bd9Sstevel@tonic-gate #  define HASRANDOM	1	/* has random(3) support */
2505*7c478bd9Sstevel@tonic-gate # endif /* ! HASRANDOM */
2506*7c478bd9Sstevel@tonic-gate 
2507*7c478bd9Sstevel@tonic-gate # ifndef HASFLOCK
2508*7c478bd9Sstevel@tonic-gate #  define HASFLOCK	0	/* assume no flock(2) support */
2509*7c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */
2510*7c478bd9Sstevel@tonic-gate 
2511*7c478bd9Sstevel@tonic-gate # ifndef HASSETREUID
2512*7c478bd9Sstevel@tonic-gate #  define HASSETREUID	0	/* assume no setreuid(2) call */
2513*7c478bd9Sstevel@tonic-gate # endif /* ! HASSETREUID */
2514*7c478bd9Sstevel@tonic-gate 
2515*7c478bd9Sstevel@tonic-gate # ifndef HASFCHMOD
2516*7c478bd9Sstevel@tonic-gate #  define HASFCHMOD	0	/* assume no fchmod(2) syscall */
2517*7c478bd9Sstevel@tonic-gate # endif /* ! HASFCHMOD */
2518*7c478bd9Sstevel@tonic-gate 
2519*7c478bd9Sstevel@tonic-gate # ifndef USESETEUID
2520*7c478bd9Sstevel@tonic-gate #  define USESETEUID	0	/* assume no seteuid(2) call or no saved ids */
2521*7c478bd9Sstevel@tonic-gate # endif /* ! USESETEUID */
2522*7c478bd9Sstevel@tonic-gate 
2523*7c478bd9Sstevel@tonic-gate # ifndef HASSETRLIMIT
2524*7c478bd9Sstevel@tonic-gate #  define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
2525*7c478bd9Sstevel@tonic-gate # endif /* ! HASSETRLIMIT */
2526*7c478bd9Sstevel@tonic-gate 
2527*7c478bd9Sstevel@tonic-gate # ifndef HASULIMIT
2528*7c478bd9Sstevel@tonic-gate #  define HASULIMIT	0	/* assume no ulimit(2) support */
2529*7c478bd9Sstevel@tonic-gate # endif /* ! HASULIMIT */
2530*7c478bd9Sstevel@tonic-gate 
2531*7c478bd9Sstevel@tonic-gate # ifndef SECUREWARE
2532*7c478bd9Sstevel@tonic-gate #  define SECUREWARE	0	/* assume no SecureWare C2 auditing hooks */
2533*7c478bd9Sstevel@tonic-gate # endif /* ! SECUREWARE */
2534*7c478bd9Sstevel@tonic-gate 
2535*7c478bd9Sstevel@tonic-gate # ifndef USE_DOUBLE_FORK
2536*7c478bd9Sstevel@tonic-gate #  define USE_DOUBLE_FORK	1	/* avoid intermediate zombies */
2537*7c478bd9Sstevel@tonic-gate # endif /* ! USE_DOUBLE_FORK */
2538*7c478bd9Sstevel@tonic-gate 
2539*7c478bd9Sstevel@tonic-gate # ifndef USE_ENVIRON
2540*7c478bd9Sstevel@tonic-gate #  define USE_ENVIRON	0	/* use main() envp instead of extern environ */
2541*7c478bd9Sstevel@tonic-gate # endif /* ! USE_ENVIRON */
2542*7c478bd9Sstevel@tonic-gate 
2543*7c478bd9Sstevel@tonic-gate # ifndef USE_SIGLONGJMP
2544*7c478bd9Sstevel@tonic-gate #  define USE_SIGLONGJMP	0	/* assume setjmp handles signals properly */
2545*7c478bd9Sstevel@tonic-gate # endif /* ! USE_SIGLONGJMP */
2546*7c478bd9Sstevel@tonic-gate 
2547*7c478bd9Sstevel@tonic-gate # ifndef FDSET_CAST
2548*7c478bd9Sstevel@tonic-gate #  define FDSET_CAST		/* (empty) cast for fd_set arg to select */
2549*7c478bd9Sstevel@tonic-gate # endif /* ! FDSET_CAST */
2550*7c478bd9Sstevel@tonic-gate 
2551*7c478bd9Sstevel@tonic-gate /*
2552*7c478bd9Sstevel@tonic-gate **  Pick a mailer setuid method for changing the current uid
2553*7c478bd9Sstevel@tonic-gate */
2554*7c478bd9Sstevel@tonic-gate 
2555*7c478bd9Sstevel@tonic-gate # define USE_SETEUID	0
2556*7c478bd9Sstevel@tonic-gate # define USE_SETREUID	1
2557*7c478bd9Sstevel@tonic-gate # define USE_SETUID	2
2558*7c478bd9Sstevel@tonic-gate 
2559*7c478bd9Sstevel@tonic-gate # if USESETEUID
2560*7c478bd9Sstevel@tonic-gate #  define MAILER_SETUID_METHOD	USE_SETEUID
2561*7c478bd9Sstevel@tonic-gate # else /* USESETEUID */
2562*7c478bd9Sstevel@tonic-gate #  if HASSETREUID
2563*7c478bd9Sstevel@tonic-gate #   define MAILER_SETUID_METHOD	USE_SETREUID
2564*7c478bd9Sstevel@tonic-gate #  else /* HASSETREUID */
2565*7c478bd9Sstevel@tonic-gate #   define MAILER_SETUID_METHOD	USE_SETUID
2566*7c478bd9Sstevel@tonic-gate #  endif /* HASSETREUID */
2567*7c478bd9Sstevel@tonic-gate # endif /* USESETEUID */
2568*7c478bd9Sstevel@tonic-gate 
2569*7c478bd9Sstevel@tonic-gate /*
2570*7c478bd9Sstevel@tonic-gate **  If no type for argument two of getgroups call is defined, assume
2571*7c478bd9Sstevel@tonic-gate **  it's an integer -- unfortunately, there seem to be several choices
2572*7c478bd9Sstevel@tonic-gate **  here.
2573*7c478bd9Sstevel@tonic-gate */
2574*7c478bd9Sstevel@tonic-gate 
2575*7c478bd9Sstevel@tonic-gate # ifndef GIDSET_T
2576*7c478bd9Sstevel@tonic-gate #  define GIDSET_T	int
2577*7c478bd9Sstevel@tonic-gate # endif /* ! GIDSET_T */
2578*7c478bd9Sstevel@tonic-gate 
2579*7c478bd9Sstevel@tonic-gate # ifndef UID_T
2580*7c478bd9Sstevel@tonic-gate #  define UID_T		uid_t
2581*7c478bd9Sstevel@tonic-gate # endif /* ! UID_T */
2582*7c478bd9Sstevel@tonic-gate 
2583*7c478bd9Sstevel@tonic-gate # ifndef GID_T
2584*7c478bd9Sstevel@tonic-gate #  define GID_T		gid_t
2585*7c478bd9Sstevel@tonic-gate # endif /* ! GID_T */
2586*7c478bd9Sstevel@tonic-gate 
2587*7c478bd9Sstevel@tonic-gate # ifndef MODE_T
2588*7c478bd9Sstevel@tonic-gate #  define MODE_T		mode_t
2589*7c478bd9Sstevel@tonic-gate # endif /* ! MODE_T */
2590*7c478bd9Sstevel@tonic-gate 
2591*7c478bd9Sstevel@tonic-gate # ifndef ARGV_T
2592*7c478bd9Sstevel@tonic-gate #  define ARGV_T		char **
2593*7c478bd9Sstevel@tonic-gate # endif /* ! ARGV_T */
2594*7c478bd9Sstevel@tonic-gate 
2595*7c478bd9Sstevel@tonic-gate # ifndef SOCKADDR_LEN_T
2596*7c478bd9Sstevel@tonic-gate #  define SOCKADDR_LEN_T	int
2597*7c478bd9Sstevel@tonic-gate # endif /* ! SOCKADDR_LEN_T */
2598*7c478bd9Sstevel@tonic-gate 
2599*7c478bd9Sstevel@tonic-gate # ifndef SOCKOPT_LEN_T
2600*7c478bd9Sstevel@tonic-gate #  define SOCKOPT_LEN_T	int
2601*7c478bd9Sstevel@tonic-gate # endif /* ! SOCKOPT_LEN_T */
2602*7c478bd9Sstevel@tonic-gate 
2603*7c478bd9Sstevel@tonic-gate # ifndef QUAD_T
2604*7c478bd9Sstevel@tonic-gate #  define QUAD_T	unsigned long
2605*7c478bd9Sstevel@tonic-gate # endif /* ! QUAD_T */
2606*7c478bd9Sstevel@tonic-gate /**********************************************************************
2607*7c478bd9Sstevel@tonic-gate **  Remaining definitions should never have to be changed.  They are
2608*7c478bd9Sstevel@tonic-gate **  primarily to provide back compatibility for older systems -- for
2609*7c478bd9Sstevel@tonic-gate **  example, it includes some POSIX compatibility definitions
2610*7c478bd9Sstevel@tonic-gate **********************************************************************/
2611*7c478bd9Sstevel@tonic-gate 
2612*7c478bd9Sstevel@tonic-gate /* System 5 compatibility */
2613*7c478bd9Sstevel@tonic-gate # ifndef S_ISREG
2614*7c478bd9Sstevel@tonic-gate #  define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
2615*7c478bd9Sstevel@tonic-gate # endif /* ! S_ISREG */
2616*7c478bd9Sstevel@tonic-gate # ifndef S_ISDIR
2617*7c478bd9Sstevel@tonic-gate #  define S_ISDIR(foo)	((foo & S_IFMT) == S_IFDIR)
2618*7c478bd9Sstevel@tonic-gate # endif /* ! S_ISDIR */
2619*7c478bd9Sstevel@tonic-gate # if !defined(S_ISLNK) && defined(S_IFLNK)
2620*7c478bd9Sstevel@tonic-gate #  define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
2621*7c478bd9Sstevel@tonic-gate # endif /* !defined(S_ISLNK) && defined(S_IFLNK) */
2622*7c478bd9Sstevel@tonic-gate # if !defined(S_ISFIFO)
2623*7c478bd9Sstevel@tonic-gate #  if defined(S_IFIFO)
2624*7c478bd9Sstevel@tonic-gate #   define S_ISFIFO(foo)	((foo & S_IFMT) == S_IFIFO)
2625*7c478bd9Sstevel@tonic-gate #  else /* defined(S_IFIFO) */
2626*7c478bd9Sstevel@tonic-gate #   define S_ISFIFO(foo)	false
2627*7c478bd9Sstevel@tonic-gate #  endif /* defined(S_IFIFO) */
2628*7c478bd9Sstevel@tonic-gate # endif /* !defined(S_ISFIFO) */
2629*7c478bd9Sstevel@tonic-gate # ifndef S_IRUSR
2630*7c478bd9Sstevel@tonic-gate #  define S_IRUSR		0400
2631*7c478bd9Sstevel@tonic-gate # endif /* ! S_IRUSR */
2632*7c478bd9Sstevel@tonic-gate # ifndef S_IWUSR
2633*7c478bd9Sstevel@tonic-gate #  define S_IWUSR		0200
2634*7c478bd9Sstevel@tonic-gate # endif /* ! S_IWUSR */
2635*7c478bd9Sstevel@tonic-gate # ifndef S_IRGRP
2636*7c478bd9Sstevel@tonic-gate #  define S_IRGRP		0040
2637*7c478bd9Sstevel@tonic-gate # endif /* ! S_IRGRP */
2638*7c478bd9Sstevel@tonic-gate # ifndef S_IWGRP
2639*7c478bd9Sstevel@tonic-gate #  define S_IWGRP		0020
2640*7c478bd9Sstevel@tonic-gate # endif /* ! S_IWGRP */
2641*7c478bd9Sstevel@tonic-gate # ifndef S_IROTH
2642*7c478bd9Sstevel@tonic-gate #  define S_IROTH		0004
2643*7c478bd9Sstevel@tonic-gate # endif /* ! S_IROTH */
2644*7c478bd9Sstevel@tonic-gate # ifndef S_IWOTH
2645*7c478bd9Sstevel@tonic-gate #  define S_IWOTH		0002
2646*7c478bd9Sstevel@tonic-gate # endif /* ! S_IWOTH */
2647*7c478bd9Sstevel@tonic-gate 
2648*7c478bd9Sstevel@tonic-gate /* close-on-exec flag */
2649*7c478bd9Sstevel@tonic-gate # ifndef FD_CLOEXEC
2650*7c478bd9Sstevel@tonic-gate #  define FD_CLOEXEC	1
2651*7c478bd9Sstevel@tonic-gate # endif /* ! FD_CLOEXEC */
2652*7c478bd9Sstevel@tonic-gate 
2653*7c478bd9Sstevel@tonic-gate /*
2654*7c478bd9Sstevel@tonic-gate **  Older systems don't have this error code -- it should be in
2655*7c478bd9Sstevel@tonic-gate **  /usr/include/sysexits.h.
2656*7c478bd9Sstevel@tonic-gate */
2657*7c478bd9Sstevel@tonic-gate 
2658*7c478bd9Sstevel@tonic-gate # ifndef EX_CONFIG
2659*7c478bd9Sstevel@tonic-gate #  define EX_CONFIG	78	/* configuration error */
2660*7c478bd9Sstevel@tonic-gate # endif /* ! EX_CONFIG */
2661*7c478bd9Sstevel@tonic-gate 
2662*7c478bd9Sstevel@tonic-gate /* pseudo-codes */
2663*7c478bd9Sstevel@tonic-gate # define EX_QUIT	22	/* drop out of server immediately */
2664*7c478bd9Sstevel@tonic-gate # define EX_RESTART	23	/* restart sendmail daemon */
2665*7c478bd9Sstevel@tonic-gate # define EX_SHUTDOWN	24	/* shutdown sendmail daemon */
2666*7c478bd9Sstevel@tonic-gate 
2667*7c478bd9Sstevel@tonic-gate #ifndef EX_NOTFOUND
2668*7c478bd9Sstevel@tonic-gate # define EX_NOTFOUND	EX_NOHOST
2669*7c478bd9Sstevel@tonic-gate #endif /* ! EX_NOTFOUND */
2670*7c478bd9Sstevel@tonic-gate 
2671*7c478bd9Sstevel@tonic-gate /* pseudo-code used for mci_setstat */
2672*7c478bd9Sstevel@tonic-gate # define EX_NOTSTICKY	(-5)	/* don't save persistent status */
2673*7c478bd9Sstevel@tonic-gate 
2674*7c478bd9Sstevel@tonic-gate 
2675*7c478bd9Sstevel@tonic-gate /*
2676*7c478bd9Sstevel@tonic-gate **  An "impossible" file mode to indicate that the file does not exist.
2677*7c478bd9Sstevel@tonic-gate */
2678*7c478bd9Sstevel@tonic-gate 
2679*7c478bd9Sstevel@tonic-gate # define ST_MODE_NOFILE	0171147		/* unlikely to occur */
2680*7c478bd9Sstevel@tonic-gate 
2681*7c478bd9Sstevel@tonic-gate 
2682*7c478bd9Sstevel@tonic-gate /* type of arbitrary pointer */
2683*7c478bd9Sstevel@tonic-gate # ifndef ARBPTR_T
2684*7c478bd9Sstevel@tonic-gate #  define ARBPTR_T	void *
2685*7c478bd9Sstevel@tonic-gate # endif /* ! ARBPTR_T */
2686*7c478bd9Sstevel@tonic-gate 
2687*7c478bd9Sstevel@tonic-gate # ifndef __P
2688*7c478bd9Sstevel@tonic-gate #  include "sm/cdefs.h"
2689*7c478bd9Sstevel@tonic-gate # endif /* ! __P */
2690*7c478bd9Sstevel@tonic-gate 
2691*7c478bd9Sstevel@tonic-gate # if HESIOD && !defined(NAMED_BIND)
2692*7c478bd9Sstevel@tonic-gate #  define NAMED_BIND	1	/* not one without the other */
2693*7c478bd9Sstevel@tonic-gate # endif /* HESIOD && !defined(NAMED_BIND) */
2694*7c478bd9Sstevel@tonic-gate 
2695*7c478bd9Sstevel@tonic-gate #  if NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno )
2696*7c478bd9Sstevel@tonic-gate extern int	h_errno;
2697*7c478bd9Sstevel@tonic-gate #  endif /* NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) */
2698*7c478bd9Sstevel@tonic-gate 
2699*7c478bd9Sstevel@tonic-gate # if NEEDPUTENV
2700*7c478bd9Sstevel@tonic-gate extern int	putenv __P((char *));
2701*7c478bd9Sstevel@tonic-gate # endif /* NEEDPUTENV */
2702*7c478bd9Sstevel@tonic-gate 
2703*7c478bd9Sstevel@tonic-gate #if !HASUNSETENV
2704*7c478bd9Sstevel@tonic-gate extern void	unsetenv __P((char *));
2705*7c478bd9Sstevel@tonic-gate #endif /* !HASUNSETENV */
2706*7c478bd9Sstevel@tonic-gate 
2707*7c478bd9Sstevel@tonic-gate # ifdef LDAPMAP
2708*7c478bd9Sstevel@tonic-gate #  include <sys/time.h>
2709*7c478bd9Sstevel@tonic-gate #  include <lber.h>
2710*7c478bd9Sstevel@tonic-gate #  include <ldap.h>
2711*7c478bd9Sstevel@tonic-gate 
2712*7c478bd9Sstevel@tonic-gate /* Some LDAP constants */
2713*7c478bd9Sstevel@tonic-gate #  define LDAPMAP_FALSE		0
2714*7c478bd9Sstevel@tonic-gate #  define LDAPMAP_TRUE		1
2715*7c478bd9Sstevel@tonic-gate 
2716*7c478bd9Sstevel@tonic-gate /*
2717*7c478bd9Sstevel@tonic-gate **  ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1.
2718*7c478bd9Sstevel@tonic-gate **  Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations
2719*7c478bd9Sstevel@tonic-gate **  and assume (falsely) that all old API implementations are broken.
2720*7c478bd9Sstevel@tonic-gate **  (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT)
2721*7c478bd9Sstevel@tonic-gate */
2722*7c478bd9Sstevel@tonic-gate 
2723*7c478bd9Sstevel@tonic-gate #  if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT)
2724*7c478bd9Sstevel@tonic-gate #   define USE_LDAP_INIT	1
2725*7c478bd9Sstevel@tonic-gate #  endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) */
2726*7c478bd9Sstevel@tonic-gate 
2727*7c478bd9Sstevel@tonic-gate /*
2728*7c478bd9Sstevel@tonic-gate **  LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x,
2729*7c478bd9Sstevel@tonic-gate **  hence ldap_set_option() must not exist.
2730*7c478bd9Sstevel@tonic-gate */
2731*7c478bd9Sstevel@tonic-gate 
2732*7c478bd9Sstevel@tonic-gate #  if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION)
2733*7c478bd9Sstevel@tonic-gate #   define USE_LDAP_SET_OPTION	1
2734*7c478bd9Sstevel@tonic-gate #  endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) */
2735*7c478bd9Sstevel@tonic-gate 
2736*7c478bd9Sstevel@tonic-gate # endif /* LDAPMAP */
2737*7c478bd9Sstevel@tonic-gate 
2738*7c478bd9Sstevel@tonic-gate # if HASUNAME
2739*7c478bd9Sstevel@tonic-gate #  include <sys/utsname.h>
2740*7c478bd9Sstevel@tonic-gate #  ifdef newstr
2741*7c478bd9Sstevel@tonic-gate #   undef newstr
2742*7c478bd9Sstevel@tonic-gate #  endif /* newstr */
2743*7c478bd9Sstevel@tonic-gate # else /* HASUNAME */
2744*7c478bd9Sstevel@tonic-gate #  define NODE_LENGTH 32
2745*7c478bd9Sstevel@tonic-gate struct utsname
2746*7c478bd9Sstevel@tonic-gate {
2747*7c478bd9Sstevel@tonic-gate 	char nodename[NODE_LENGTH + 1];
2748*7c478bd9Sstevel@tonic-gate };
2749*7c478bd9Sstevel@tonic-gate # endif /* HASUNAME */
2750*7c478bd9Sstevel@tonic-gate 
2751*7c478bd9Sstevel@tonic-gate # if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V)
2752*7c478bd9Sstevel@tonic-gate #  define MAXHOSTNAMELEN	256
2753*7c478bd9Sstevel@tonic-gate # endif /* !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) */
2754*7c478bd9Sstevel@tonic-gate 
2755*7c478bd9Sstevel@tonic-gate # if !defined(SIGCHLD) && defined(SIGCLD)
2756*7c478bd9Sstevel@tonic-gate #  define SIGCHLD	SIGCLD
2757*7c478bd9Sstevel@tonic-gate # endif /* !defined(SIGCHLD) && defined(SIGCLD) */
2758*7c478bd9Sstevel@tonic-gate 
2759*7c478bd9Sstevel@tonic-gate # ifndef STDIN_FILENO
2760*7c478bd9Sstevel@tonic-gate #  define STDIN_FILENO	0
2761*7c478bd9Sstevel@tonic-gate # endif /* ! STDIN_FILENO */
2762*7c478bd9Sstevel@tonic-gate 
2763*7c478bd9Sstevel@tonic-gate # ifndef STDOUT_FILENO
2764*7c478bd9Sstevel@tonic-gate #  define STDOUT_FILENO	1
2765*7c478bd9Sstevel@tonic-gate # endif /* ! STDOUT_FILENO */
2766*7c478bd9Sstevel@tonic-gate 
2767*7c478bd9Sstevel@tonic-gate # ifndef STDERR_FILENO
2768*7c478bd9Sstevel@tonic-gate #  define STDERR_FILENO	2
2769*7c478bd9Sstevel@tonic-gate # endif /* ! STDERR_FILENO */
2770*7c478bd9Sstevel@tonic-gate 
2771*7c478bd9Sstevel@tonic-gate # ifndef LOCK_SH
2772*7c478bd9Sstevel@tonic-gate #  define LOCK_SH	0x01	/* shared lock */
2773*7c478bd9Sstevel@tonic-gate #  define LOCK_EX	0x02	/* exclusive lock */
2774*7c478bd9Sstevel@tonic-gate #  define LOCK_NB	0x04	/* non-blocking lock */
2775*7c478bd9Sstevel@tonic-gate #  define LOCK_UN	0x08	/* unlock */
2776*7c478bd9Sstevel@tonic-gate # endif /* ! LOCK_SH */
2777*7c478bd9Sstevel@tonic-gate 
2778*7c478bd9Sstevel@tonic-gate # ifndef S_IXOTH
2779*7c478bd9Sstevel@tonic-gate #  define S_IXOTH	(S_IEXEC >> 6)
2780*7c478bd9Sstevel@tonic-gate # endif /* ! S_IXOTH */
2781*7c478bd9Sstevel@tonic-gate 
2782*7c478bd9Sstevel@tonic-gate # ifndef S_IXGRP
2783*7c478bd9Sstevel@tonic-gate #  define S_IXGRP	(S_IEXEC >> 3)
2784*7c478bd9Sstevel@tonic-gate # endif /* ! S_IXGRP */
2785*7c478bd9Sstevel@tonic-gate 
2786*7c478bd9Sstevel@tonic-gate # ifndef S_IXUSR
2787*7c478bd9Sstevel@tonic-gate #  define S_IXUSR	(S_IEXEC)
2788*7c478bd9Sstevel@tonic-gate # endif /* ! S_IXUSR */
2789*7c478bd9Sstevel@tonic-gate 
2790*7c478bd9Sstevel@tonic-gate #ifndef O_ACCMODE
2791*7c478bd9Sstevel@tonic-gate # define O_ACCMODE	(O_RDONLY|O_WRONLY|O_RDWR)
2792*7c478bd9Sstevel@tonic-gate #endif /* ! O_ACCMODE */
2793*7c478bd9Sstevel@tonic-gate 
2794*7c478bd9Sstevel@tonic-gate # ifndef SEEK_SET
2795*7c478bd9Sstevel@tonic-gate #  define SEEK_SET	0
2796*7c478bd9Sstevel@tonic-gate #  define SEEK_CUR	1
2797*7c478bd9Sstevel@tonic-gate #  define SEEK_END	2
2798*7c478bd9Sstevel@tonic-gate # endif /* ! SEEK_SET */
2799*7c478bd9Sstevel@tonic-gate 
2800*7c478bd9Sstevel@tonic-gate # ifndef SIG_ERR
2801*7c478bd9Sstevel@tonic-gate #  define SIG_ERR	((void (*)()) -1)
2802*7c478bd9Sstevel@tonic-gate # endif /* ! SIG_ERR */
2803*7c478bd9Sstevel@tonic-gate 
2804*7c478bd9Sstevel@tonic-gate # ifndef WEXITSTATUS
2805*7c478bd9Sstevel@tonic-gate #  define WEXITSTATUS(st)	(((st) >> 8) & 0377)
2806*7c478bd9Sstevel@tonic-gate # endif /* ! WEXITSTATUS */
2807*7c478bd9Sstevel@tonic-gate # ifndef WIFEXITED
2808*7c478bd9Sstevel@tonic-gate #  define WIFEXITED(st)		(((st) & 0377) == 0)
2809*7c478bd9Sstevel@tonic-gate # endif /* ! WIFEXITED */
2810*7c478bd9Sstevel@tonic-gate # ifndef WIFSTOPPED
2811*7c478bd9Sstevel@tonic-gate #  define WIFSTOPPED(st)		(((st) & 0100) == 0)
2812*7c478bd9Sstevel@tonic-gate # endif /* ! WIFSTOPPED */
2813*7c478bd9Sstevel@tonic-gate # ifndef WCOREDUMP
2814*7c478bd9Sstevel@tonic-gate #  define WCOREDUMP(st)		(((st) & 0200) != 0)
2815*7c478bd9Sstevel@tonic-gate # endif /* ! WCOREDUMP */
2816*7c478bd9Sstevel@tonic-gate # ifndef WTERMSIG
2817*7c478bd9Sstevel@tonic-gate #  define WTERMSIG(st)		(((st) & 0177))
2818*7c478bd9Sstevel@tonic-gate # endif /* ! WTERMSIG */
2819*7c478bd9Sstevel@tonic-gate 
2820*7c478bd9Sstevel@tonic-gate # ifndef SIGFUNC_DEFINED
2821*7c478bd9Sstevel@tonic-gate typedef void		(*sigfunc_t) __P((int));
2822*7c478bd9Sstevel@tonic-gate # endif /* ! SIGFUNC_DEFINED */
2823*7c478bd9Sstevel@tonic-gate # ifndef SIGFUNC_RETURN
2824*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_RETURN
2825*7c478bd9Sstevel@tonic-gate # endif /* ! SIGFUNC_RETURN */
2826*7c478bd9Sstevel@tonic-gate # ifndef SIGFUNC_DECL
2827*7c478bd9Sstevel@tonic-gate #  define SIGFUNC_DECL	void
2828*7c478bd9Sstevel@tonic-gate # endif /* ! SIGFUNC_DECL */
2829*7c478bd9Sstevel@tonic-gate 
2830*7c478bd9Sstevel@tonic-gate /* size of syslog buffer */
2831*7c478bd9Sstevel@tonic-gate # ifndef SYSLOG_BUFSIZE
2832*7c478bd9Sstevel@tonic-gate #  define SYSLOG_BUFSIZE	1024
2833*7c478bd9Sstevel@tonic-gate # endif /* ! SYSLOG_BUFSIZE */
2834*7c478bd9Sstevel@tonic-gate 
2835*7c478bd9Sstevel@tonic-gate /* for FD_SET() */
2836*7c478bd9Sstevel@tonic-gate #ifndef FD_SETSIZE
2837*7c478bd9Sstevel@tonic-gate # define FD_SETSIZE	256
2838*7c478bd9Sstevel@tonic-gate #endif /* ! FD_SETSIZE */
2839*7c478bd9Sstevel@tonic-gate 
2840*7c478bd9Sstevel@tonic-gate /*
2841*7c478bd9Sstevel@tonic-gate **  Size of prescan buffer.
2842*7c478bd9Sstevel@tonic-gate **	Despite comments in the _sendmail_ book, this probably should
2843*7c478bd9Sstevel@tonic-gate **	not be changed; there are some hard-to-define dependencies.
2844*7c478bd9Sstevel@tonic-gate */
2845*7c478bd9Sstevel@tonic-gate 
2846*7c478bd9Sstevel@tonic-gate # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
2847*7c478bd9Sstevel@tonic-gate 
2848*7c478bd9Sstevel@tonic-gate /* fork routine -- set above using #ifdef _osname_ or in Makefile */
2849*7c478bd9Sstevel@tonic-gate # ifndef FORK
2850*7c478bd9Sstevel@tonic-gate #  define FORK		fork		/* function to call to fork mailer */
2851*7c478bd9Sstevel@tonic-gate # endif /* ! FORK */
2852*7c478bd9Sstevel@tonic-gate 
2853*7c478bd9Sstevel@tonic-gate /* setting h_errno */
2854*7c478bd9Sstevel@tonic-gate # ifndef SM_SET_H_ERRNO
2855*7c478bd9Sstevel@tonic-gate #  define SM_SET_H_ERRNO(err)	h_errno = (err)
2856*7c478bd9Sstevel@tonic-gate # endif /* SM_SET_H_ERRNO */
2857*7c478bd9Sstevel@tonic-gate 
2858*7c478bd9Sstevel@tonic-gate # ifndef SM_CONF_GETOPT
2859*7c478bd9Sstevel@tonic-gate #  define SM_CONF_GETOPT	1
2860*7c478bd9Sstevel@tonic-gate # endif /* ! SM_CONF_GETOPT */
2861*7c478bd9Sstevel@tonic-gate 
2862*7c478bd9Sstevel@tonic-gate /* random routine -- set above using #ifdef _osname_ or in Makefile */
2863*7c478bd9Sstevel@tonic-gate # if HASRANDOM
2864*7c478bd9Sstevel@tonic-gate #  define get_random()	random()
2865*7c478bd9Sstevel@tonic-gate # else /* HASRANDOM */
2866*7c478bd9Sstevel@tonic-gate #  define get_random()	((long) rand())
2867*7c478bd9Sstevel@tonic-gate #  ifndef RANDOMSHIFT
2868*7c478bd9Sstevel@tonic-gate #   define RANDOMSHIFT	8
2869*7c478bd9Sstevel@tonic-gate #  endif /* ! RANDOMSHIFT */
2870*7c478bd9Sstevel@tonic-gate # endif /* HASRANDOM */
2871*7c478bd9Sstevel@tonic-gate 
2872*7c478bd9Sstevel@tonic-gate /*
2873*7c478bd9Sstevel@tonic-gate **  Default to using scanf in readcf.
2874*7c478bd9Sstevel@tonic-gate */
2875*7c478bd9Sstevel@tonic-gate 
2876*7c478bd9Sstevel@tonic-gate # ifndef SCANF
2877*7c478bd9Sstevel@tonic-gate #  define SCANF		1
2878*7c478bd9Sstevel@tonic-gate # endif /* ! SCANF */
2879*7c478bd9Sstevel@tonic-gate 
2880*7c478bd9Sstevel@tonic-gate /* XXX  32 bit type */
2881*7c478bd9Sstevel@tonic-gate # ifndef SM_INT32
2882*7c478bd9Sstevel@tonic-gate #  define SM_INT32	int32_t
2883*7c478bd9Sstevel@tonic-gate # endif /* ! SM_INT32 */
2884*7c478bd9Sstevel@tonic-gate 
2885*7c478bd9Sstevel@tonic-gate /*
2886*7c478bd9Sstevel@tonic-gate **  SVr4 and similar systems use different routines for setjmp/longjmp
2887*7c478bd9Sstevel@tonic-gate **  with signal support
2888*7c478bd9Sstevel@tonic-gate */
2889*7c478bd9Sstevel@tonic-gate 
2890*7c478bd9Sstevel@tonic-gate # if USE_SIGLONGJMP
2891*7c478bd9Sstevel@tonic-gate #  ifdef jmp_buf
2892*7c478bd9Sstevel@tonic-gate #   undef jmp_buf
2893*7c478bd9Sstevel@tonic-gate #  endif /* jmp_buf */
2894*7c478bd9Sstevel@tonic-gate #  define jmp_buf		sigjmp_buf
2895*7c478bd9Sstevel@tonic-gate #  ifdef setjmp
2896*7c478bd9Sstevel@tonic-gate #   undef setjmp
2897*7c478bd9Sstevel@tonic-gate #  endif /* setjmp */
2898*7c478bd9Sstevel@tonic-gate #  define setjmp(env)		sigsetjmp(env, 1)
2899*7c478bd9Sstevel@tonic-gate #  ifdef longjmp
2900*7c478bd9Sstevel@tonic-gate #   undef longjmp
2901*7c478bd9Sstevel@tonic-gate #  endif /* longjmp */
2902*7c478bd9Sstevel@tonic-gate #  define longjmp(env, val)	siglongjmp(env, val)
2903*7c478bd9Sstevel@tonic-gate # endif /* USE_SIGLONGJMP */
2904*7c478bd9Sstevel@tonic-gate 
2905*7c478bd9Sstevel@tonic-gate # if !defined(NGROUPS_MAX) && defined(NGROUPS)
2906*7c478bd9Sstevel@tonic-gate #  define NGROUPS_MAX	NGROUPS		/* POSIX naming convention */
2907*7c478bd9Sstevel@tonic-gate # endif /* !defined(NGROUPS_MAX) && defined(NGROUPS) */
2908*7c478bd9Sstevel@tonic-gate 
2909*7c478bd9Sstevel@tonic-gate /*
2910*7c478bd9Sstevel@tonic-gate **  Some snprintf() implementations are rumored not to NUL terminate.
2911*7c478bd9Sstevel@tonic-gate */
2912*7c478bd9Sstevel@tonic-gate # if SNPRINTF_IS_BROKEN
2913*7c478bd9Sstevel@tonic-gate #  ifdef snprintf
2914*7c478bd9Sstevel@tonic-gate #   undef snprintf
2915*7c478bd9Sstevel@tonic-gate #  endif /* snprintf */
2916*7c478bd9Sstevel@tonic-gate #  define snprintf	sm_snprintf
2917*7c478bd9Sstevel@tonic-gate #  ifdef vsnprintf
2918*7c478bd9Sstevel@tonic-gate #   undef vsnprintf
2919*7c478bd9Sstevel@tonic-gate #  endif /* vsnprintf */
2920*7c478bd9Sstevel@tonic-gate #  define vsnprintf	sm_vsnprintf
2921*7c478bd9Sstevel@tonic-gate # endif /* SNPRINTF_IS_BROKEN */
2922*7c478bd9Sstevel@tonic-gate 
2923*7c478bd9Sstevel@tonic-gate /*
2924*7c478bd9Sstevel@tonic-gate **  If we don't have a system syslog, simulate it.
2925*7c478bd9Sstevel@tonic-gate */
2926*7c478bd9Sstevel@tonic-gate 
2927*7c478bd9Sstevel@tonic-gate # if !LOG
2928*7c478bd9Sstevel@tonic-gate #  define LOG_EMERG	0	/* system is unusable */
2929*7c478bd9Sstevel@tonic-gate #  define LOG_ALERT	1	/* action must be taken immediately */
2930*7c478bd9Sstevel@tonic-gate #  define LOG_CRIT	2	/* critical conditions */
2931*7c478bd9Sstevel@tonic-gate #  define LOG_ERR	3	/* error conditions */
2932*7c478bd9Sstevel@tonic-gate #  define LOG_WARNING	4	/* warning conditions */
2933*7c478bd9Sstevel@tonic-gate #  define LOG_NOTICE	5	/* normal but significant condition */
2934*7c478bd9Sstevel@tonic-gate #  define LOG_INFO	6	/* informational */
2935*7c478bd9Sstevel@tonic-gate #  define LOG_DEBUG	7	/* debug-level messages */
2936*7c478bd9Sstevel@tonic-gate # endif /* !LOG */
2937*7c478bd9Sstevel@tonic-gate 
2938*7c478bd9Sstevel@tonic-gate # ifndef SM_CONF_SYSLOG
2939*7c478bd9Sstevel@tonic-gate #  define SM_CONF_SYSLOG 1	/* syslog.h has prototype for syslog() */
2940*7c478bd9Sstevel@tonic-gate # endif /* SM_CONF_SYSLOG */
2941*7c478bd9Sstevel@tonic-gate 
2942*7c478bd9Sstevel@tonic-gate # if !SM_CONF_SYSLOG
2943*7c478bd9Sstevel@tonic-gate #   ifdef __STDC__
2944*7c478bd9Sstevel@tonic-gate extern void	syslog(int, const char *, ...);
2945*7c478bd9Sstevel@tonic-gate #   else /* __STDC__ */
2946*7c478bd9Sstevel@tonic-gate extern void	syslog();
2947*7c478bd9Sstevel@tonic-gate #   endif /* __STDC__ */
2948*7c478bd9Sstevel@tonic-gate # endif /* !SM_CONF_SYSLOG */
2949*7c478bd9Sstevel@tonic-gate 
2950*7c478bd9Sstevel@tonic-gate /* portable(?) definition for alignment */
2951*7c478bd9Sstevel@tonic-gate # ifndef SM_ALIGN_SIZE
2952*7c478bd9Sstevel@tonic-gate struct sm_align
2953*7c478bd9Sstevel@tonic-gate {
2954*7c478bd9Sstevel@tonic-gate 	char al_c;
2955*7c478bd9Sstevel@tonic-gate 	union
2956*7c478bd9Sstevel@tonic-gate 	{
2957*7c478bd9Sstevel@tonic-gate 		long	al_l;
2958*7c478bd9Sstevel@tonic-gate 		void	*al_p;
2959*7c478bd9Sstevel@tonic-gate 		double	al_d;
2960*7c478bd9Sstevel@tonic-gate 		void	(*al_f) __P((void));
2961*7c478bd9Sstevel@tonic-gate 	} al_u;
2962*7c478bd9Sstevel@tonic-gate };
2963*7c478bd9Sstevel@tonic-gate #  define SM_ALIGN_SIZE offsetof(struct sm_align, al_u)
2964*7c478bd9Sstevel@tonic-gate # endif /* ! SM_ALIGN_SIZE */
2965*7c478bd9Sstevel@tonic-gate # define SM_ALIGN_BITS (SM_ALIGN_SIZE - 1)
2966*7c478bd9Sstevel@tonic-gate 
2967*7c478bd9Sstevel@tonic-gate #endif /* ! SM_CONF_H */
2968