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