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