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