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