2 * Copyright (c) 1998-2011 Proofpoint, Inc. and its suppliers.
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.
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.
13 * $Id: conf.h,v 1.147 2013-11-22 20:51:31 ca Exp $
17 ** CONF.H -- All user-configurable parameters for sendmail
19 ** Send updates to Sendmail.ORG so they will be
20 ** included in the next release; see
21 ** http://www.sendmail.org/email-addresses.html
22 ** for current e-mail address.
29 # include <sm/config.h>
30 # include <sm/varargs.h>
33 ** General "standard C" defines.
35 ** These may be undone later, to cope with systems that claim to
36 ** be Standard C but aren't. Gcc is the biggest offender -- it
37 ** doesn't realize that the library is part of the language.
39 ** Life would be much easier if we could get rid of this sort
44 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */
45 # endif /* __STDC__ */
48 ** Assume you have standard calls; can be #undefed below if necessary.
52 # define HASLSTAT 1 /* has lstat(2) call */
53 # endif /* ! HASLSTAT */
56 # define HASNICE 1 /* has nice(2) call */
57 # endif /* ! HASNICE */
60 # define HASRRESVPORT 1 /* has rrsevport(3) call */
61 # endif /* ! HASRRESVPORT */
63 /**********************************************************************
64 ** "Hard" compilation options.
65 ** #define these if they are available; comment them out otherwise.
66 ** These cannot be overridden from the Makefile, and should really not
67 ** be turned off unless absolutely necessary.
68 **********************************************************************/
70 #define LOG 1 /* enable logging -- don't turn off */
72 /**********************************************************************
73 ** Operating system configuration.
75 ** Unless you are porting to a new OS, you shouldn't have to
77 **********************************************************************/
80 ** HP-UX -- tested for 8.07, 9.00, and 9.01.
82 ** If V4FS is defined, compile for HP-UX 10.0.
83 ** 11.x support from Richard Allen <ra@hp.is>.
87 /* common definitions for HP-UX 9.x and 10.x */
88 # undef m_flags /* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */
89 # define SYSTEM5 1 /* include all the System V defines */
90 # define HASINITGROUPS 1 /* has initgroups(3) call */
91 # define HASFCHMOD 1 /* has fchmod(2) syscall */
92 # define USESETEUID 1 /* has usable seteuid(2) call */
93 # define HASSETRESGID 1 /* use setresgid(2) to set saved gid */
94 # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */
95 # define seteuid(e) setresuid(-1, e, -1)
96 # define IP_SRCROUTE 1 /* can check IP source routing */
97 # define LA_TYPE LA_HPUX
98 # define SPT_TYPE SPT_PSTAT
99 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
100 # define GIDSET_T gid_t
101 # define LDA_USE_LOCKF 1
102 # ifndef HASGETUSERSHELL
103 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
104 # endif /* ! HASGETUSERSHELL */
106 # define _PATH_SENDMAIL "/usr/sbin/sendmail"
107 # ifndef SMRSH_CMDDIR
108 # define SMRSH_CMDDIR "/var/adm/sm.bin"
109 # endif /* ! SMRSH_CMDDIR */
112 # define HASSETREUID 1 /* setreuid(2) works on HP-UX 11.x */
113 # define HASFCHOWN 1 /* has fchown(2) */
114 # ifndef BROKEN_RES_SEARCH
115 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */
116 # endif /* ! BROKEN_RES_SEARCH */
117 # ifndef SMRSH_CMDDIR
118 # define SMRSH_CMDDIR "/var/adm/sm.bin"
119 # endif /* ! SMRSH_CMDDIR */
120 # define _PATH_SENDMAIL "/usr/sbin/sendmail"
122 # ifndef NOT_SENDMAIL
123 # define syslog hard_syslog
124 # endif /* ! NOT_SENDMAIL */
126 # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */
130 # define _PATH_UNIX "/stand/vmunix"
131 # ifndef _PATH_VENDOR_CF
132 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf"
133 # endif /* ! _PATH_VENDOR_CF */
134 # ifndef _PATH_SENDMAILPID
135 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
136 # endif /* ! _PATH_SENDMAILPID */
138 # define IDENTPROTO 1 /* TCP/IP implementation fixed in 10.0 */
139 # endif /* ! IDENTPROTO */
140 # include <sys/mpctl.h> /* for mpctl() in get_num_procs_online() */
143 # define _PATH_UNIX "/hp-ux"
144 # ifndef _PATH_VENDOR_CF
145 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
146 # endif /* ! _PATH_VENDOR_CF */
148 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
149 # endif /* ! IDENTPROTO */
151 extern void hard_syslog(int, char *, ...);
152 # else /* __STDC__ */
153 extern void hard_syslog();
154 # endif /* __STDC__ */
155 # define FDSET_CAST (int *) /* cast for fd_set parameters to select */
165 # include <sys/signal.h>
166 # include <sys/wait.h>
168 # define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */
169 # define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */
171 # define HASUNSETENV 1 /* has unsetenv(3) call */
172 # endif /* _AIX5 >= 50200 */
180 # define _AIX3 1 /* pull in AIX3 stuff */
181 # define BSD4_4_SOCKADDR /* has sa_len */
182 # define USESETEUID 1 /* seteuid(2) works */
183 # define TZ_TYPE TZ_NAME /* use tzname[] vector */
184 # ifndef SOCKOPT_LEN_T
185 # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */
186 # endif /* SOCKOPT_LEN_T */
188 # define HASSETREUID 1 /* setreuid(2) works as of AIX 4.2 */
189 # ifndef SOCKADDR_LEN_T
190 # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */
191 # endif /* SOCKADDR_LEN_T */
192 # endif /* _AIX4 >= 40200 */
193 # if defined(_ILS_MACROS) /* IBM versions aren't side-effect clean */
195 # define isascii(c) !(c & ~0177)
197 # define isdigit(__a) (_IS(__a,_ISDIGIT))
199 # define isspace(__a) (_IS(__a,_ISSPACE))
200 # endif /* defined(_ILS_MACROS) */
205 ** IBM AIX 3.x -- actually tested for 3.2.3
210 # include <sys/machine.h> /* to get byte order */
211 # include <sys/select.h>
212 # define HASFCHOWN 1 /* has fchown(2) */
213 # define HASINITGROUPS 1 /* has initgroups(3) call */
214 # define HASUNAME 1 /* use System V uname(2) system call */
215 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
216 # define HASFCHMOD 1 /* has fchmod(2) syscall */
217 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */
218 # define GIDSET_T gid_t
219 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
220 # define SPT_PADCHAR '\0' /* pad process title with nulls */
222 # define LA_TYPE LA_INT
223 # endif /* LA_TYPE */
225 # define LA_AVENRUN "avenrun"
226 # if !defined(_AIX4) || _AIX4 < 40300
227 # ifndef __BIT_TYPES_DEFINED__
228 # define SM_INT32 int
229 # endif /* __BIT_TYPES_DEFINED__ */
230 # endif /* !defined(_AIX4) || _AIX4 < 40300 */
231 # if !defined(_AIX4) || _AIX4 < 40200
232 # define SM_CONF_SYSLOG 0
233 # endif /* !defined(_AIX4) || _AIX4 < 40200 */
238 ** IBM AIX 2.2.1 -- actually tested for osupdate level 2706+1773
240 ** From Mark Whetzel <markw@wg.waii.com>.
243 # ifdef AIX /* AIX/RT compiler pre-defines this */
245 # include <sys/time.h> /* AIX/RT resource.h does NOT include this */
246 # define HASINITGROUPS 1 /* has initgroups(3) call */
247 # define HASUNAME 1 /* use System V uname(2) system call */
248 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
249 # define HASFCHMOD 0 /* does not have fchmod(2) syscall */
250 # define HASSETREUID 1 /* use setreuid(2) -lbsd system call */
251 # define HASSETVBUF 1 /* use setvbuf(2) system call */
252 # define HASSETRLIMIT 0 /* does not have setrlimit call */
253 # define HASFLOCK 0 /* does not have flock call - use fcntl */
254 # define HASULIMIT 1 /* use ulimit instead of setrlimit call */
255 # define SM_CONF_GETOPT 0 /* Do we need theirs or ours */
256 # define SYS5SETPGRP 1 /* don't have setpgid on AIX/RT */
257 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */
258 # define BSD4_3 1 /* NOT bsd 4.4 or posix signals */
259 # define GIDSET_T int
260 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
261 # define SPT_PADCHAR '\0' /* pad process title with nulls */
262 # define LA_TYPE LA_SUBR /* use our ported loadavgd daemon */
263 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
264 # define ARBPTR_T int *
267 /* RTisms for BSD compatibility, specified in the Makefile
269 define BSD_INCLUDES 1
270 define BSD_REMAP_SIGNAL_TO_SIGVEC
271 RTisms needed above */
272 /* make this sendmail in a completely different place */
273 # ifndef _PATH_VENDOR_CF
274 # define _PATH_VENDOR_CF "/usr/local/newmail/sendmail.cf"
275 # endif /* ! _PATH_VENDOR_CF */
276 # ifndef _PATH_SENDMAILPID
277 # define _PATH_SENDMAILPID "/usr/local/newmail/sendmail.pid"
278 # endif /* ! _PATH_SENDMAILPID */
282 # define LDA_USE_LOCKF 1
283 # define LDA_USE_SETEUID 1
284 # endif /* defined(_AIX) */
287 ** Silicon Graphics IRIX
289 ** Compiles on 4.0.1.
291 ** Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
292 ** Use IRIX5 instead of IRIX for IRIX 5.x.
294 ** IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
295 ** IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
299 # define SYSTEM5 1 /* this is a System-V derived system */
300 # define HASSETREUID 1 /* has setreuid(2) call */
301 # define HASINITGROUPS 1 /* has initgroups(3) call */
302 # define HASFCHMOD 1 /* has fchmod(2) syscall */
303 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
304 # define IP_SRCROUTE 1 /* can check IP source routing */
305 # define setpgid BSDsetpgrp
306 # define GIDSET_T gid_t
307 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
308 # define SFS_BAVAIL f_bfree /* alternate field name */
309 # define SYSLOG_BUFSIZE 512
310 # if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
311 /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */
312 # define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
313 # endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */
316 # define QUAD_T unsigned long long
317 # define LA_TYPE LA_IRIX6 /* figure out at run time */
318 # define SAFENFSPATHCONF 0 /* pathconf(2) lies on NFS filesystems */
320 # define LA_TYPE LA_INT
324 # define QUAD_T unsigned long long
325 # define NAMELISTMASK 0x7fffffffffffffff /* mask for nlist() values */
328 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */
331 # if defined(IRIX64) || defined(IRIX5) || defined(IRIX6)
332 # include <sys/cdefs.h>
334 # define ARGV_T char *const *
335 # define HASFCHOWN 1 /* has fchown(2) */
336 # define HASSETRLIMIT 1 /* has setrlimit(2) syscall */
337 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */
338 # define HASSTRERROR 1 /* has strerror(3) */
339 # else /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
340 # define ARGV_T const char **
341 # define WAITUNION 1 /* use "union wait" as wait argument type */
342 # endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */
349 ** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
350 ** Solaris 2.4 (a.k.a. SunOS 5.4).
353 # if defined(sun) && !defined(BSD)
355 # include <sys/time.h>
356 # define HASINITGROUPS 1 /* has initgroups(3) call */
357 # define HASUNAME 1 /* use System V uname(2) system call */
358 # define HASFCHMOD 1 /* has fchmod(2) syscall */
359 # define IP_SRCROUTE 1 /* can check IP source routing */
360 # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */
362 # define HASFCHOWN 1 /* fchown(2) */
363 # endif /* ! HASFCHOWN */
366 # define LDA_USE_LOCKF 1
367 # define LDA_USE_SETEUID 1
368 # define _PATH_MAILDIR "/var/mail"
369 # endif /* __svr4__ */
372 # define SOLARIS 20300 /* for back compat only -- use -DSOLARIS=20300 */
373 # endif /* SOLARIS_2_3 */
375 # if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4))
376 # define SOLARIS 1 /* unknown Solaris version */
377 # endif /* defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) */
380 /* Solaris 2.x (a.k.a. SunOS 5.x) */
382 # define __svr4__ /* use all System V Release 4 defines below */
383 # endif /* ! __svr4__ */
384 # if SOLARIS >= 21100
386 # endif /* SOLARIS >= 21100 */
387 # ifndef _PATH_VARRUN
388 # define _PATH_VARRUN "/var/run/"
389 # endif /* _PATH_VARRUN */
390 # define GIDSET_T gid_t
391 # define USE_SA_SIGACTION 1 /* use sa_sigaction field */
392 # define BROKEN_PTHREAD_SLEEP 1 /* sleep after pthread_create() fails */
393 # define HASSTRERROR 1 /* has strerror(3) */
395 # define _PATH_UNIX "/dev/ksyms"
396 # endif /* ! _PATH_UNIX */
397 # ifndef _PATH_VENDOR_CF
398 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf"
399 # endif /* ! _PATH_VENDOR_CF */
400 # ifndef _PATH_SENDMAILPID
401 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
402 # endif /* ! _PATH_SENDMAILPID */
404 # define _PATH_HOSTS "/etc/inet/hosts"
405 # endif /* ! _PATH_HOSTS */
406 # ifndef SYSLOG_BUFSIZE
407 # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */
408 # endif /* ! SYSLOG_BUFSIZE */
410 # define TZ_TYPE TZ_TZNAME
411 # endif /* ! TZ_TYPE */
412 # if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203)
413 # define USESETEUID 1 /* seteuid works as of 2.3 */
414 # define LDA_CONTENTLENGTH 1 /* Needs the Content-Length header */
415 # endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */
416 # if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205)
417 # define HASSETREUID 1 /* setreuid works as of 2.5 */
418 # define HASSETREGID 1 /* use setregid(2) to set saved gid */
419 # if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206)
420 # define HASSNPRINTF 1 /* has snprintf(3c) starting in 2.6 */
421 # endif /* SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) */
422 # if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700)
424 # define LA_TYPE LA_KSTAT /* use kstat(3k) -- may work in < 2.5 */
425 # endif /* ! LA_TYPE */
426 # ifndef RANDOMSHIFT /* random() doesn't work well (sometimes) */
427 # define RANDOMSHIFT 8
428 # endif /* ! RANDOMSHIFT */
429 # endif /* SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) */
430 # else /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */
432 # define HASRANDOM 0 /* doesn't have random(3) */
433 # endif /* ! HASRANDOM */
434 # endif /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */
435 # if (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206
436 # define SM_INT32 int /* 32bit integer */
437 # endif /* (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206 */
438 # if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207)
440 # include <sys/loadavg.h>
441 # if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
442 # include <sys/pset.h>
443 # define LA_TYPE LA_PSET /* pset_getloadavg(3c) appears in 2.9 */
444 # else /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
445 # define LA_TYPE LA_SUBR /* getloadavg(3c) appears in 2.7 */
446 # endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
447 # endif /* ! LA_TYPE */
448 # define HASGETUSERSHELL 1 /* getusershell(3c) bug fixed in 2.7 */
449 # endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */
450 # if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208)
451 # undef _PATH_SENDMAILPID /* tmpfs /var/run added in 2.8 */
452 # define _PATH_SENDMAILPID _PATH_VARRUN "sendmail.pid"
453 # ifndef SMRSH_CMDDIR
454 # define SMRSH_CMDDIR "/var/adm/sm.bin"
455 # endif /* ! SMRSH_CMDDIR */
456 # define SL_FUDGE 34 /* fudge offset for SyslogPrefixLen */
457 # define HASLDAPGETALIASBYNAME 1 /* added in S8 */
458 # endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */
459 # if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209)
460 # define HASURANDOMDEV 1 /* /dev/[u]random added in S9 */
461 # define HASCLOSEFROM 1 /* closefrom(3c) added in S9 */
462 # define HASFDWALK 1 /* fdwalk(3c) added in S9 */
463 # endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */
464 # if SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210)
465 # define HASUNSETENV 1 /* unsetenv() added in S10 */
466 # endif /* SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) */
467 # if SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211)
468 # define GETLDAPALIASBYNAME_VERSION 2 /* changed in S11 */
469 # define HAVE_NANOSLEEP 1 /* moved from librt to libc in S11 */
470 # define SOCKADDR_LEN_T socklen_t /* arg#3 to accept, getsockname */
471 # define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */
472 # endif /* SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) */
473 # ifndef HASGETUSERSHELL
474 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */
475 # endif /* ! HASGETUSERSHELL */
478 /* SunOS 4.0.3 or 4.1.x */
479 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */
480 # define HASSETREUID 1 /* has setreuid(2) call */
482 # define HASFLOCK 1 /* has flock(2) call */
483 # endif /* ! HASFLOCK */
484 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
485 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */
489 # define strtoul strtol /* gcc library bogosity */
490 # endif /* __GNUC__ */
491 # define memmove(d, s, l) (bcopy((s), (d), (l)))
492 # define atexit(f) on_exit((f), 0) /* ugly hack for SunOS */
493 # define SM_INT32 int /* 32bit integer */
494 # define SM_ALIGN_SIZE (sizeof(long))
495 # define GIDSET_T int
496 # define SM_CONF_SYSLOG 0
499 /* special tweaking for SunOS 4.0.3 */
501 # define BSD4_3 1 /* 4.3 BSD-based */
502 # define NEEDSTRSTR 1 /* need emulation of strstr(3) routine */
503 # define WAITUNION 1 /* use "union wait" as wait argument type */
507 # define setpgid setpgrp
510 extern char *getenv();
512 # else /* SUNOS403 */
513 /* 4.1.x specifics */
514 # define HASSETSID 1 /* has POSIX setsid(2) call */
515 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */
517 # endif /* SUNOS403 */
518 # endif /* SOLARIS */
521 # define LA_TYPE LA_INT
522 # endif /* ! LA_TYPE */
524 # endif /* defined(sun) && !defined(BSD) */
529 ** Tested on 5.4.2 and 5.4.3. Use DGUX_5_4_2 to get the
531 ** 5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
536 # endif /* DGUX_5_4_2 */
540 # define LA_TYPE LA_DGUX
541 # define HASSETREUID 1 /* has setreuid(2) call */
542 # define HASUNAME 1 /* use System V uname(2) system call */
543 # define HASSETSID 1 /* has POSIX setsid(2) call */
544 # define HASINITGROUPS 1 /* has initgroups(3) call */
545 # define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */
546 # define HASGETUSERSHELL 0 /* does not have getusershell(3) */
548 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
549 # endif /* ! IDENTPROTO */
550 # define SPT_TYPE SPT_NONE /* don't use setproctitle */
551 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
552 # define LDA_USE_LOCKF 1
554 /* these include files must be included early on DG/UX */
555 # include <netinet/in.h>
556 # include <arpa/inet.h>
558 /* compiler doesn't understand const? */
562 # define inet_addr dgux_inet_addr
563 extern long dgux_inet_addr();
564 # endif /* DGUX_5_4_2 */
569 ** Digital Ultrix 4.2 - 4.5
571 ** Apparently, fcntl locking is broken on 4.2A, in that locks are
572 ** not dropped when the process exits. This causes major problems,
573 ** so flock is the only alternative.
577 # define HASSETREUID 1 /* has setreuid(2) call */
578 # define HASUNSETENV 1 /* has unsetenv(3) call */
579 # define HASINITGROUPS 1 /* has initgroups(3) call */
580 # define HASUNAME 1 /* use System V uname(2) system call */
581 # define HASFCHMOD 1 /* has fchmod(2) syscall */
582 # define HASFCHOWN 1 /* has fchown(2) syscall */
584 # define HASFLOCK 1 /* has flock(2) call */
585 # endif /* ! HASFLOCK */
586 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
587 # ifndef BROKEN_RES_SEARCH
588 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */
589 # endif /* ! BROKEN_RES_SEARCH */
590 # if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621
591 # define NEEDLOCAL_HOSTNAME_LENGTH 1 /* see sendmail/README */
592 # endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */
594 # define LA_TYPE LA_FLOAT
596 # define LA_TYPE LA_INT
597 # define LA_AVENRUN "avenrun"
599 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
601 # define IDENTPROTO 0 /* pre-4.4 TCP/IP implementation is broken */
602 # endif /* ! IDENTPROTO */
603 # define SYSLOG_BUFSIZE 256
604 # define SM_CONF_SYSLOG 0
611 ** Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu>
615 # define __osf__ 1 /* get OSF/1 defines below */
617 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
618 # endif /* ! TZ_TYPE */
619 # endif /* __ksr__ */
623 ** OSF/1 for Intel Paragon.
625 ** Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
626 ** of Intel Scalable Systems Divison.
630 # define __osf__ 1 /* get OSF/1 defines below */
632 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
633 # endif /* ! TZ_TYPE */
634 # define GIDSET_T gid_t
635 # define MAXNAMLEN NAME_MAX
636 # endif /* __PARAGON__ */
640 ** Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1
642 ** Tested for 3.2 and 4.0.
646 # define HASUNAME 1 /* has uname(2) call */
647 # define HASUNSETENV 1 /* has unsetenv(3) call */
648 # define USESETEUID 1 /* has usable seteuid(2) call */
649 # define HASINITGROUPS 1 /* has initgroups(3) call */
650 # define HASFCHMOD 1 /* has fchmod(2) syscall */
651 # define HASFCHOWN 1 /* has fchown(2) syscall */
652 # define HASSETLOGIN 1 /* has setlogin(2) */
653 # define IP_SRCROUTE 1 /* can check IP source routing */
654 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */
655 # define GIDSET_T gid_t
656 # define SM_INT32 int /* 32bit integer */
658 # include <standards.h>
659 # if _XOPEN_SOURCE+0 >= 400
660 # define HASFLOCK 0 /* 5.0 and later has bad flock(2) call */
661 # else /* _XOPEN_SOURCE+0 >= 400 */
662 # define HASFLOCK 1 /* has flock(2) call */
663 # endif /* _XOPEN_SOURCE+0 >= 400 */
664 # endif /* ! HASFLOCK */
665 # define LA_TYPE LA_ALPHAOSF
666 # define SFS_TYPE SFS_STATVFS /* use <sys/statvfs.h> statfs() impl */
667 # ifndef _PATH_VENDOR_CF
668 # define _PATH_VENDOR_CF "/var/adm/sendmail/sendmail.cf"
669 # endif /* ! _PATH_VENDOR_CF */
670 # ifndef _PATH_SENDMAILPID
671 # define _PATH_SENDMAILPID "/var/run/sendmail.pid"
672 # endif /* ! _PATH_SENDMAILPID */
673 # if _FFR_DIGUNIX_SAFECHOWN
675 ** Testing on a Digital UNIX 4.0a system showed this to be the correct
676 ** setting but given the security consequences, more testing and
677 ** verification is needed. Unfortunately, the man page offers no
680 # define IS_SAFE_CHOWN >= 0
681 # endif /* _FFR_DIGUNIX_SAFECHOWN */
682 # endif /* __osf__ */
690 # define HASINITGROUPS 1 /* has initgroups(3) call */
691 # define NEEDPUTENV 2 /* need putenv(3) call; no setenv(3) call */
693 # define HASFLOCK 1 /* has flock(2) call */
694 # endif /* ! HASFLOCK */
695 # define UID_T int /* compiler gripes on uid_t */
696 # define GID_T int /* ditto for gid_t */
697 # define MODE_T int /* and mode_t */
698 # define setpgid setpgrp
699 # ifndef NOT_SENDMAIL
700 # define sleep sleepX
701 # endif /* ! NOT_SENDMAIL */
703 # define LA_TYPE LA_MACH
704 # endif /* ! LA_TYPE */
705 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
706 # ifdef _POSIX_SOURCE
707 extern struct passwd *getpwent();
708 # else /* _POSIX_SOURCE */
709 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
710 # define WAITUNION 1 /* use "union wait" as wait argument type */
716 # endif /* _POSIX_SOURCE */
717 # ifndef _PATH_VENDOR_CF
718 # define _PATH_VENDOR_CF "/etc/sendmail/sendmail.cf"
719 # endif /* ! _PATH_VENDOR_CF */
720 # ifndef _PATH_SENDMAILPID
721 # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid"
722 # endif /* ! _PATH_SENDMAILPID */
723 # define SM_INT32 int /* 32bit integer */
727 # define HASUNSETENV 1
728 # endif /* ! HASUNSETENV */
730 # endif /* TCPWRAPPERS */
734 # define S_IRUSR S_IREAD
735 # endif /* ! S_IRUSR */
737 # define S_IWUSR S_IWRITE
738 # endif /* ! S_IWUSR */
739 # define _PATH_MAILDIR "/usr/spool/mail"
740 # endif /* ! __APPLE__ */
742 # define isascii(c) ((unsigned)(c) <= 0177)
743 # endif /* ! isascii */
748 ** Contributed by Wilfredo Sanchez <wsanchez@mit.edu>
752 # define HASFCHMOD 1 /* has fchmod(2) */
753 # define HASFCHOWN 1 /* has fchown(2) */
754 # define HASFLOCK 1 /* has flock(2) */
755 # define HASUNAME 1 /* has uname(2) */
756 # define HASUNSETENV 1 /* has unsetenv(3) */
757 # define HASSETSID 1 /* has POSIX setsid(2) call */
758 # define HASINITGROUPS 1 /* has initgroups(3) */
759 # define HASSETVBUF 1 /* has setvbuf (3) */
760 # define HASSETREUID 0 /* setreuid(2) unusable */
761 # define HASSETEUID 1 /* has seteuid(2) */
762 # define USESETEUID 1 /* has seteuid(2) */
763 # define HASSETEGID 1 /* has setegid(2) */
764 # define HASSETREGID 1 /* has setregid(2) */
765 # define HASSETRESGID 0 /* no setresgid(2) */
766 # define HASLSTAT 1 /* has lstat(2) */
767 # define HASSETRLIMIT 1 /* has setrlimit(2) */
768 # define HASWAITPID 1 /* has waitpid(2) */
769 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) */
770 # define HAS_ST_GEN 1 /* has st_gen field in struct stat */
771 # define HASURANDOMDEV 1 /* has urandom(4) */
772 # define HASSTRERROR 1 /* has strerror(3) */
773 # define HASGETUSERSHELL 1 /* had getusershell(3) */
774 # define GIDSET_T gid_t /* getgroups(2) takes gid_t */
775 # define LA_TYPE LA_SUBR /* use getloadavg(3) */
776 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
778 # define SOCKADDR_LEN_T socklen_t
781 # define SPT_TYPE SPT_REUSEARGV
782 # define SPT_PADCHAR '\0'
783 # define SOCKOPT_LEN_T socklen_t
785 # define SPT_TYPE SPT_PSSTRINGS /* use magic PS_STRINGS pointer for setproctitle */
787 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
788 # define BSD4_4_SOCKADDR /* struct sockaddr has sa_len */
789 # define SAFENFSPATHCONF 0 /* unverified: pathconf(2) doesn't work on NFS */
791 # define NETLINK 1 /* supports AF_LINK */
792 # ifndef NOT_SENDMAIL
793 # define sleep sleepX
794 extern unsigned int sleepX __P((unsigned int seconds));
795 # endif /* ! NOT_SENDMAIL */
796 # endif /* defined(DARWIN) */
802 ** See also BSD defines.
805 # if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN)
807 # define HASUNSETENV 1 /* has unsetenv(3) call */
808 # define USESETEUID 1 /* has usable seteuid(2) call */
809 # define HASFCHMOD 1 /* has fchmod(2) syscall */
810 # define HASFCHOWN 1 /* has fchown(2) syscall */
811 # define HASSTRERROR 1 /* has strerror(3) */
812 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */
813 # include <sys/cdefs.h>
814 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
815 # define BSD4_4_SOCKADDR /* has sa_len */
816 # define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */
817 # define NETLINK 1 /* supports AF_LINK */
819 # define LA_TYPE LA_SUBR
820 # endif /* ! LA_TYPE */
821 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
822 # define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */
823 # endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN)*/
827 ** BSD/OS (was BSD/386) (all versions)
828 ** From Tony Sanders, BSDI
833 # define HASUNSETENV 1 /* has the unsetenv(3) call */
834 # define HASSETREUID 0 /* BSD-OS has broken setreuid(2) emulation */
835 # define HASSETSID 1 /* has POSIX setsid(2) call */
836 # define USESETEUID 1 /* has usable seteuid(2) call */
837 # define HASFCHMOD 1 /* has fchmod(2) syscall */
838 # define HASSETLOGIN 1 /* has setlogin(2) */
839 # define HASUNAME 1 /* has uname(2) syscall */
840 # define HASSTRERROR 1 /* has strerror(3) */
841 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */
842 # include <sys/cdefs.h>
843 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
844 # define BSD4_4_SOCKADDR /* has sa_len */
845 # define NETLINK 1 /* supports AF_LINK */
846 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
848 # define LA_TYPE LA_SUBR
849 # endif /* ! LA_TYPE */
850 # define GIDSET_T gid_t
851 # define QUAD_T quad_t
852 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
853 /* version 1.1 or later */
855 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
856 # else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
857 /* version 1.0 or earlier */
858 # define SPT_PADCHAR '\0' /* pad process title with nulls */
859 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
860 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 /* on 3.x */
861 # define HASSETUSERCONTEXT 1 /* has setusercontext */
862 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */
863 # if defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 /* 3.1 and earlier */
864 # define MODE_T int /* va_arg() can't handle less than int */
865 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 */
866 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 /* on 4.x */
867 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */
868 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 */
869 # endif /* __bsdi__ */
872 # if defined(__QNX__)
873 # if defined(__QNXNTO__)
876 # define HASUNSETENV 1 /* has unsetenv(3) call */
877 # define HASINITGROUPS 1 /* has initgroups(3) call */
878 # define HASSETSID 1 /* has POSIX setsid(2) call */
879 # define USESETEUID 1 /* has usable seteuid(2) call */
880 # define HASFCHMOD 1 /* has fchmod(2) syscall */
881 # define HASFCHOWN 1 /* has fchown(2) syscall */
882 # define HASUNAME 1 /* has uname(2) syscall */
883 # define HASSTRERROR 1 /* has strerror(3) */
884 # define BSD4_4_SOCKADDR /* has sa_len */
885 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
886 # define NETLINK 1 /* supports AF_LINK */
887 # define GIDSET_T gid_t
888 # define QUAD_T uint64_t
889 # define HASSNPRINTF 1 /* has snprintf(3) (all versions?) */
890 # define HASGETUSERSHELL 0
893 ** We have a strrev() that doesn't allocate anything.
894 ** Make sure the one here is used.
897 # define strrev strrev_sendmail
899 # else /* defined(__QNXNTO__) */
903 ** Contributed by Glen McCready <glen@qnx.com>.
905 ** Should work with all versions of QNX 4.
909 # include <sys/select.h>
911 # define HASSETSID 1 /* has POSIX setsid(2) call */
912 # define USESETEUID 1 /* has usable seteuid(2) call */
913 # define HASFCHMOD 1 /* has fchmod(2) syscall */
914 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
915 # define HASSETREUID 1 /* has setreuid(2) call */
916 # define HASSTRERROR 1 /* has strerror(3) */
918 # undef HASINITGROUPS /* has initgroups(3) call */
919 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
920 # define IP_SRCROUTE 1 /* can check IP source routing */
921 # define TZ_TYPE TZ_TMNAME /* use tmname variable */
922 # define GIDSET_T gid_t
923 # define LA_TYPE LA_ZERO
924 # define SFS_TYPE SFS_NONE
925 # define SPT_TYPE SPT_REUSEARGV
926 # define SPT_PADCHAR '\0' /* pad process title with nulls */
927 # define HASGETUSERSHELL 0
928 # define _FILE_H_INCLUDED
929 # endif /* defined(__QNXNTO__) */
930 # endif /* defined(__QNX__) */
934 ** DragonFly BSD/ FreeBSD / NetBSD / OpenBSD (all architectures, all versions)
936 ** 4.3BSD clone, closer to 4.4BSD for FreeBSD 1.x and NetBSD 0.9x
937 ** 4.4BSD-Lite based for FreeBSD 2.x and NetBSD 1.x
939 ** See also BSD defines.
942 # if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
944 # define HASUNSETENV 1 /* has unsetenv(3) call */
945 # define HASSETSID 1 /* has POSIX setsid(2) call */
946 # define USESETEUID 1 /* has usable seteuid(2) call */
947 # define HASFCHMOD 1 /* has fchmod(2) syscall */
948 # define HASFCHOWN 1 /* has fchown(2) syscall */
949 # define HASUNAME 1 /* has uname(2) syscall */
950 # define HASSTRERROR 1 /* has strerror(3) */
951 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */
952 # define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */
953 # include <sys/cdefs.h>
954 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
955 # define BSD4_4_SOCKADDR /* has sa_len */
956 # define NETLINK 1 /* supports AF_LINK */
957 # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */
958 # define GIDSET_T gid_t
959 # define QUAD_T unsigned long long
960 # define HASSNPRINTF 1 /* has snprintf(3) (all versions?) */
962 # define LA_TYPE LA_SUBR
963 # endif /* ! LA_TYPE */
964 # if defined(__NetBSD__) && defined(__NetBSD_Version__) && \
965 ((__NetBSD_Version__ >= 200040000 && __NetBSD_Version__ < 200090000) || \
966 (__NetBSD_Version__ >= 299000900))
968 # define SFS_TYPE SFS_STATVFS
970 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
972 # if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1)
974 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
975 # endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */
976 # if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3))
977 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */
978 # endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */
979 # if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104170000
980 # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
982 # if defined(__NetBSD__) && defined(__NetBSD_Version__) && \
983 ((__NetBSD_Version__ >= 200060000 && __NetBSD_Version__ < 200090000) || \
984 (__NetBSD_Version__ >= 299000900))
985 # define HASCLOSEFROM 1 /* closefrom(3) added in 2.0F */
987 # if defined(__NetBSD__)
988 # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */
989 # include <sys/param.h>
990 # include <sys/sysctl.h>
992 # if defined(__DragonFly__)
993 # define HASSETLOGIN 1 /* has setlogin(2) */
994 # define HASSRANDOMDEV 1 /* has srandomdev(3) */
995 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */
997 # include <libutil.h>
998 # define SPT_TYPE SPT_BUILTIN
999 # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
1000 # ifndef SMRSH_CMDDIR
1001 # define SMRSH_CMDDIR "/usr/libexec/sm.bin"
1002 # endif /* ! SMRSH_CMDDIR */
1004 # define SMRSH_PATH "/bin:/usr/bin"
1005 # endif /* ! SMRSH_PATH */
1006 # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */
1007 # include <sys/sysctl.h>
1008 # endif /* defined(__DragonFly__) */
1009 # if defined(__FreeBSD__)
1010 # define HASSETLOGIN 1 /* has setlogin(2) */
1011 # if __FreeBSD_version >= 227001
1012 # define HASSRANDOMDEV 1 /* has srandomdev(3) */
1013 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */
1014 # endif /* __FreeBSD_version >= 227001 */
1016 # if __FreeBSD__ >= 2
1017 # include <osreldate.h>
1018 # if __FreeBSD_version >= 199512 /* 2.2-current when it appeared */
1019 # include <libutil.h>
1020 # define SPT_TYPE SPT_BUILTIN
1021 # endif /* __FreeBSD_version >= 199512 */
1022 # if __FreeBSD_version >= 222000 /* 2.2.2-release and later */
1023 # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
1024 # endif /* __FreeBSD_version >= 222000 */
1025 # if __FreeBSD_version >= 300000 /* 3.0.0-release and later */
1026 # define HAVE_NANOSLEEP 1 /* has nanosleep(2) */
1027 # endif /* __FreeBSD_version >= 300000 */
1028 # if __FreeBSD_version >= 330000 /* 3.3.0-release and later */
1029 # ifndef SMRSH_CMDDIR
1030 # define SMRSH_CMDDIR "/usr/libexec/sm.bin"
1031 # endif /* ! SMRSH_CMDDIR */
1033 # define SMRSH_PATH "/bin:/usr/bin"
1034 # endif /* ! SMRSH_PATH */
1035 # endif /* __FreeBSD_version >= 330000 */
1036 # if __FreeBSD_version >= 430000 /* 4.3.0-release and later */
1037 # define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */
1038 # define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */
1039 # endif /* __FreeBSD_version >= 430000 */
1040 # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */
1041 # include <sys/sysctl.h>
1042 # endif /* __FreeBSD__ >= 2 */
1044 # define SPT_TYPE SPT_REUSEARGV
1045 # define SPT_PADCHAR '\0' /* pad process title with nulls */
1046 # endif /* ! SPT_TYPE */
1047 # endif /* defined(__FreeBSD__) */
1048 # if defined(__OpenBSD__)
1050 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
1051 # define HASSETLOGIN 1 /* has setlogin(2) */
1052 # if OpenBSD < 200305
1053 # define HASSETREUID 0 /* setreuid(2) broken in OpenBSD < 3.3 */
1054 # endif /* OpenBSD < 200305 */
1055 # define HASSETEGID 1 /* use setegid(2) to set saved gid */
1056 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */
1057 # if OpenBSD >= 200006
1058 # define HASSRANDOMDEV 1 /* has srandomdev(3) */
1059 # endif /* OpenBSD >= 200006 */
1060 # if OpenBSD >= 200012
1061 # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
1062 # endif /* OpenBSD >= 200012 */
1063 # if OpenBSD >= 200405
1064 # define HASCLOSEFROM 1 /* closefrom(3) added in 3.5 */
1065 # endif /* OpenBSD >= 200405 */
1066 # if OpenBSD >= 200505
1067 # undef NETISO /* iso.h removed in 3.7 */
1068 # endif /* OpenBSD >= 200505 */
1069 # if OpenBSD >= 200800
1070 # define HAVE_NANOSLEEP 1 /* has nanosleep(2) */
1071 # endif /* OpenBSD >= 200800 */
1072 # endif /* defined(__OpenBSD__) */
1073 # endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */
1079 ** For mt Xinu's Mach386 system.
1082 # if defined(MACH) && defined(i386) && !defined(__GNU__)
1084 # define HASUNSETENV 1 /* has unsetenv(3) call */
1085 # define HASINITGROUPS 1 /* has initgroups(3) call */
1087 # define HASFLOCK 1 /* has flock(2) call */
1088 # endif /* ! HASFLOCK */
1089 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
1090 # define NEEDSTRTOL 1 /* need the strtol() function */
1091 # define setpgid setpgrp
1093 # define LA_TYPE LA_FLOAT
1094 # endif /* ! LA_TYPE */
1095 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1096 # undef HASSETVBUF /* don't actually have setvbuf(3) */
1099 # ifndef _PATH_VENDOR_CF
1100 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1101 # endif /* ! _PATH_VENDOR_CF */
1102 # ifndef _PATH_SENDMAILPID
1103 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1104 # endif /* ! _PATH_SENDMAILPID */
1105 # endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */
1111 ** Largely BSD & posix compatible.
1112 ** Port contributed by Miles Bader <miles@gnu.ai.mit.edu>.
1113 ** Updated by Mark Kettenis <kettenis@wins.uva.nl>.
1116 # if defined(__GNU__) && !defined(NeXT)
1118 # define HASFCHMOD 1 /* has fchmod(2) call */
1119 # define HASFCHOWN 1 /* has fchown(2) call */
1120 # define HASUNAME 1 /* has uname(2) call */
1121 # define HASUNSETENV 1 /* has unsetenv(3) call */
1122 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */
1123 # define HASSTRERROR 1 /* has strerror(3) */
1124 # define GIDSET_T gid_t
1125 # define SOCKADDR_LEN_T socklen_t
1126 # define SOCKOPT_LEN_T socklen_t
1127 # if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2
1128 # define LA_TYPE LA_SUBR
1129 # else /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
1130 # define LA_TYPE LA_MACH
1131 /* GNU uses mach[34], which renames some rpcs from mach2.x. */
1132 # define host_self mach_host_self
1133 # endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
1134 # define SFS_TYPE SFS_STATFS
1135 # define SPT_TYPE SPT_CHANGEARGV
1136 # define ERRLIST_PREDEFINED 1 /* don't declare sys_errlist */
1137 # define BSD4_4_SOCKADDR 1 /* has sa_len */
1138 # define SIOCGIFCONF_IS_BROKEN 1 /* SIOCGFCONF doesn't work */
1139 # define HAS_IN_H 1 /* GNU has netinet/in.h. */
1140 /* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */
1141 # define MAXPATHLEN 2048
1142 # endif /* defined(__GNU__) && !defined(NeXT) */
1145 ** 4.3 BSD -- this is for very old systems
1147 ** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
1149 ** You'll also have to install a new resolver library.
1150 ** I don't guarantee that support for this environment is complete.
1153 # if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
1154 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
1155 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
1156 # define ARBPTR_T char *
1157 # define setpgid setpgrp
1159 # define LA_TYPE LA_FLOAT
1160 # endif /* ! LA_TYPE */
1161 # ifndef _PATH_VENDOR_CF
1162 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1163 # endif /* ! _PATH_VENDOR_CF */
1165 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
1166 # endif /* ! IDENTPROTO */
1169 typedef short pid_t;
1170 # endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */
1176 ** This includes three parts:
1178 ** The first is for SCO OpenServer 5.
1179 ** (Contributed by Keith Reynolds <keithr@sco.COM>).
1181 ** SCO OpenServer 5 has a compiler version number macro,
1182 ** which we can use to figure out what version we're on.
1183 ** This may have to change in future releases.
1185 ** The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0.
1186 ** (Contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
1188 ** The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier.
1191 /* SCO OpenServer 5 */
1194 # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM returns bogus value */
1195 # define HASFCHMOD 1 /* has fchmod(2) call */
1196 # define HASFCHOWN 1 /* has fchown(2) call */
1197 # define HASSETRLIMIT 1 /* has setrlimit(2) call */
1198 # define USESETEUID 1 /* has seteuid(2) call */
1199 # define HASINITGROUPS 1 /* has initgroups(3) call */
1200 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
1201 # define RLIMIT_NEEDS_SYS_TIME_H 1
1202 # define LDA_USE_LOCKF 1
1204 # define LA_TYPE LA_DEVSHORT
1205 # endif /* ! LA_TYPE */
1206 # define _PATH_AVENRUN "/dev/table/avenrun"
1207 # ifndef _SCO_unix_4_2
1208 # define _SCO_unix_4_2
1209 # else /* ! _SCO_unix_4_2 */
1210 # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */
1211 # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */
1212 # endif /* ! _SCO_unix_4_2 */
1213 # endif /* _SCO_DS >= 1 */
1215 /* SCO UNIX 3.2v4.2/Open Desktop 3.0 */
1216 # ifdef _SCO_unix_4_2
1218 # define HASSETREUID 1 /* has setreuid(2) call */
1219 # endif /* _SCO_unix_4_2 */
1221 /* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */
1223 # include <sys/stream.h> /* needed for IP_SRCROUTE */
1224 # define SYSTEM5 1 /* include all the System V defines */
1225 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1226 # define NOFTRUNCATE 0 /* has (simulated) ftruncate call */
1227 # ifndef USE_SIGLONGJMP
1228 # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
1229 # endif /* ! USE_SIGLONGJMP */
1230 # define MAXPATHLEN PATHSIZE
1231 # define SFS_TYPE SFS_4ARGS /* use <sys/statfs.h> 4-arg impl */
1232 # define SFS_BAVAIL f_bfree /* alternate field name */
1233 # define SPT_TYPE SPT_SCO /* write kernel u. area */
1234 # define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */
1235 # define UID_T uid_t
1236 # define GID_T gid_t
1237 # define GIDSET_T gid_t
1238 # define _PATH_UNIX "/unix"
1239 # ifndef _PATH_VENDOR_CF
1240 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1241 # endif /* ! _PATH_VENDOR_CF */
1242 # ifndef _PATH_SENDMAILPID
1243 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1244 # endif /* ! _PATH_SENDMAILPID */
1246 /* stuff fixed in later releases */
1247 # ifndef _SCO_unix_4_2
1248 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1249 # endif /* ! _SCO_unix_4_2 */
1252 # define ftruncate chsize /* use chsize(2) to emulate ftruncate */
1253 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */
1254 # define NETUNIX 0 /* no unix domain socket support */
1255 # define LA_TYPE LA_SHORT
1256 # endif /* ! _SCO_DS */
1258 # endif /* _SCO_unix_ */
1261 ** ISC (SunSoft) Unix.
1263 ** Contributed by J.J. Bailey <jjb@jagware.bcc.com>
1267 # include <net/errno.h>
1268 # include <sys/stream.h> /* needed for IP_SRCROUTE */
1269 # include <sys/bsdtypes.h>
1270 # define SYSTEM5 1 /* include all the System V defines */
1271 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1272 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1273 # define HASSETREUID 1 /* has setreuid(2) call */
1274 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */
1275 # define NETUNIX 0 /* no unix domain socket support */
1276 # define MAXPATHLEN 1024
1277 # define LA_TYPE LA_SHORT
1278 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
1279 # define SFS_BAVAIL f_bfree /* alternate field name */
1280 # define _PATH_UNIX "/unix"
1281 # ifndef _PATH_VENDOR_CF
1282 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1283 # endif /* ! _PATH_VENDOR_CF */
1284 # ifndef _PATH_SENDMAILPID
1285 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1286 # endif /* ! _PATH_SENDMAILPID */
1287 # endif /* ISC_UNIX */
1291 ** Altos System V (5.3.1)
1292 ** Contributed by Tim Rice <tim@trr.metro.net>.
1295 # ifdef ALTOS_SYSTEM_V
1296 # include <sys/stream.h>
1297 # include <limits.h>
1298 # define SYSTEM5 1 /* include all the System V defines */
1299 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1300 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1301 # define WAITUNION 1 /* use "union wait" as wait argument type */
1302 # define NEEDFSYNC 1 /* no fsync(2) in system library */
1303 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */
1304 # define NOFTRUNCATE 1 /* do not have ftruncate(2) */
1305 # define MAXPATHLEN PATH_MAX
1306 # define LA_TYPE LA_SHORT
1307 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
1308 # define SFS_BAVAIL f_bfree /* alternate field name */
1309 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
1310 # define NETUNIX 0 /* no unix domain socket support */
1313 # define strtoul strtol /* gcc library bogosity */
1315 typedef unsigned short uid_t;
1316 typedef unsigned short gid_t;
1317 typedef short pid_t;
1318 typedef unsigned long mode_t;
1320 /* some stuff that should have been in the include files */
1321 extern char *malloc();
1322 extern struct passwd *getpwent();
1323 extern struct passwd *getpwnam();
1324 extern struct passwd *getpwuid();
1325 extern char *getenv();
1326 extern struct group *getgrgid();
1327 extern struct group *getgrnam();
1329 # endif /* ALTOS_SYSTEM_V */
1333 ** ConvexOS 11.0 and later
1335 ** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
1336 ** works on 9.1 as well.
1338 ** ConvexOS 11.5 and later, should work on 11.0 as defined.
1339 ** For pre-ConvexOOS 11.0, define SM_CONF_GETOPT=0, undef IDENTPROTO
1341 ** Eric Schnoebelen (eric@cirr.com) For CONVEX Computer Corp.
1342 ** (now the CONVEX Technologies Center of Hewlett Packard)
1345 # ifdef _CONVEX_SOURCE
1346 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) */
1347 # define HASINITGROUPS 1 /* has initgroups(3) */
1348 # define HASUNAME 1 /* use System V uname(2) system call */
1349 # define HASSETSID 1 /* has POSIX setsid(2) call */
1350 # define HASUNSETENV 1 /* has unsetenv(3) */
1351 # define HASFLOCK 1 /* has flock(2) */
1352 # define HASSETRLIMIT 1 /* has setrlimit(2) */
1353 # define HASSETREUID 1 /* has setreuid(2) */
1354 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_error=0 */
1355 # define NEEDPUTENV 1 /* needs putenv (written in terms of setenv) */
1356 # define SM_CONF_GETOPT 1 /* need a replacement for getopt(3) */
1357 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */
1358 # define LA_TYPE LA_FLOAT
1359 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1360 # ifndef _PATH_VENDOR_CF
1361 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1362 # endif /* ! _PATH_VENDOR_CF */
1364 # define S_IREAD _S_IREAD
1365 # define S_IWRITE _S_IWRITE
1366 # define S_IEXEC _S_IEXEC
1367 # define S_IFMT _S_IFMT
1368 # define S_IFCHR _S_IFCHR
1369 # define S_IFBLK _S_IFBLK
1370 # endif /* ! S_IREAD */
1372 # define TZ_TYPE TZ_TIMEZONE
1373 # endif /* ! TZ_TYPE */
1375 # define IDENTPROTO 1
1376 # endif /* ! IDENTPROTO */
1378 # define SHARE_V1 1 /* version 1 of the fair share scheduler */
1379 # endif /* ! SHARE_V1 */
1380 # if !defined(__GNUC__ )
1381 # define UID_T int /* GNUC gets it right, ConvexC botches */
1382 # define GID_T int /* GNUC gets it right, ConvexC botches */
1383 # endif /* !defined(__GNUC__ ) */
1385 # define FORK fork /* SecureWare wants the real fork! */
1386 # else /* SECUREWARE */
1387 # define FORK vfork /* the rest of the OS versions don't care */
1388 # endif /* SECUREWARE */
1389 # endif /* _CONVEX_SOURCE */
1395 ** Gives a ton of warning messages, but otherwise compiles.
1400 # define HASUNSETENV 1 /* has unsetenv(3) call */
1402 # define HASFLOCK 1 /* has flock(2) call */
1403 # endif /* ! HASFLOCK */
1404 # define WAITUNION 1 /* use "union wait" as wait argument type */
1405 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
1406 # define NEEDPUTENV 1 /* need putenv(3) call */
1407 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */
1408 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1409 # define LA_TYPE LA_INT
1410 # define LA_AVENRUN "avenrun"
1411 # define _PATH_UNIX "/unix"
1414 # define setpgid setpgrp
1417 # define SIGFUNC_DEFINED
1418 # define SIGFUNC_RETURN (0)
1419 # define SIGFUNC_DECL int
1420 typedef int (*sigfunc_t)();
1421 extern char *getenv();
1422 extern void *malloc();
1424 /* added for RISC/os 4.01...which is dumber than 4.50 */
1427 # define ARBPTR_T char *
1428 # endif /* ! ARBPTR_T */
1431 # endif /* RISCOS_4_0 */
1433 # include <sys/time.h>
1435 # endif /* RISCOS */
1439 ** Linux 0.99pl10 and above...
1441 ** Thanks to, in reverse order of contact:
1443 ** John Kennedy <warlock@csuchico.edu>
1444 ** Andrew Pam <avatar@aus.xanadu.com>
1445 ** Florian La Roche <rzsfl@rz.uni-sb.de>
1446 ** Karl London <karl@borg.demon.co.uk>
1448 ** NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style
1449 ** file locking is no longer allowed. In particular, make sure
1450 ** your DBM library and sendmail are both using either flock(2)
1451 ** *or* fcntl(2) file locking, but not both.
1455 # include <linux/version.h>
1456 # if !defined(KERNEL_VERSION) /* not defined in 2.0.x kernel series */
1457 # define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
1458 # endif /* !defined(KERNEL_VERSION) */
1459 # define BSD 1 /* include BSD defines */
1460 # define HASSETREGID 1 /* use setregid(2) to set saved gid */
1461 # ifndef REQUIRES_DIR_FSYNC
1462 # define REQUIRES_DIR_FSYNC 1 /* requires fsync() on directory */
1463 # endif /* REQUIRES_DIR_FSYNC */
1465 # define USESETEUID 0 /* has it due to POSIX, but doesn't work */
1466 # endif /* USESETEUID */
1467 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
1468 # define HASUNAME 1 /* use System V uname(2) system call */
1469 # define HASUNSETENV 1 /* has unsetenv(3) call */
1470 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
1471 # define GIDSET_T gid_t /* from <linux/types.h> */
1472 # ifndef HASGETUSERSHELL
1473 # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */
1474 # endif /* HASGETUSERSHELL */
1475 # ifndef IP_SRCROUTE
1476 # define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */
1477 # endif /* ! IP_SRCROUTE */
1479 # define HAS_IN_H 1 /* use netinet/in.h */
1480 # endif /* ! HAS_IN_H */
1481 # ifndef USE_SIGLONGJMP
1482 # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
1483 # endif /* ! USE_SIGLONGJMP */
1485 # if LINUX_VERSION_CODE < 66399
1486 # define HASFLOCK 0 /* flock(2) is broken after 0.99.13 */
1487 # else /* LINUX_VERSION_CODE < 66399 */
1488 # if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
1489 # define HASFLOCK 1 /* flock(2) fixed after 1.3.95 */
1490 # else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
1491 # define HASFLOCK 0 /* flock(2) is broken (again) after 2.4.0 */
1492 # endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
1493 # endif /* LINUX_VERSION_CODE < 66399 */
1494 # endif /* ! HASFLOCK */
1496 # define LA_TYPE LA_PROCSTR
1497 # endif /* ! LA_TYPE */
1498 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */
1499 # define SPT_PADCHAR '\0' /* pad process title with nulls */
1500 # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0))
1501 # ifndef HASURANDOMDEV
1502 # define HASURANDOMDEV 1 /* 2.0 (at least) has linux/drivers/char/random.c */
1503 # endif /* ! HASURANDOMDEV */
1504 # endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) */
1505 # if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1506 # define HASSTRERROR 1 /* has strerror(3) */
1507 # endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
1509 # define TZ_TYPE TZ_NONE /* no standard for Linux */
1510 # endif /* ! TZ_TYPE */
1511 # if (__GLIBC__ >= 2)
1513 # endif /* (__GLIBC__ >= 2) */
1514 # ifndef _PATH_SENDMAILPID
1515 # define _PATH_SENDMAILPID "/var/run/sendmail.pid"
1516 # endif /* ! _PATH_SENDMAILPID */
1517 # include <sys/sysmacros.h>
1518 # undef atol /* wounded in <stdlib.h> */
1521 ** Linux doesn't have a good way to tell userland what interfaces are
1522 ** IPv6-capable. Therefore, the BIND resolver can not determine if there
1523 ** are IPv6 interfaces to honor AI_ADDRCONFIG. Unfortunately, it assumes
1524 ** that none are present. (Excuse the macro name ADDRCONFIG_IS_BROKEN.)
1526 # define ADDRCONFIG_IS_BROKEN 1
1529 ** Indirectly included from glibc's <feature.h>. IPv6 support is native
1530 ** in 2.1 and later, but the APIs appear before the functions.
1532 # if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1533 # define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__)
1534 # if (GLIBC_VERSION >= 0x201)
1535 # define SOCKADDR_LEN_T socklen_t
1536 # define SOCKOPT_LEN_T socklen_t
1537 # undef IPPROTO_ICMPV6 /* linux #defines, glibc enums */
1538 # else /* (GLIBC_VERSION >= 0x201) */
1539 # include <linux/in6.h> /* IPv6 support */
1540 # endif /* (GLIBC_VERSION >= 0x201) */
1541 # if (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE))
1542 /* Have APIs in <netdb.h>, but no support in glibc */
1543 # define NEEDSGETIPNODE 1
1544 # endif /* (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) */
1545 # undef GLIBC_VERSION
1546 # endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
1547 # endif /* NETINET6 */
1549 # define HASFCHOWN 1 /* fchown(2) */
1550 # endif /* ! HASFCHOWN */
1551 # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD)
1552 # define HASFCHMOD 1 /* fchmod(2) */
1553 # endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) */
1554 # endif /* __linux__ */
1558 ** DELL SVR4 Issue 2.2, and others
1559 ** From Kimmo Suominen <kim@grendel.lut.fi>
1561 ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
1562 ** defined, and the definitions conflict.
1564 ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
1565 ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
1566 ** (SVR4.0/386 version 3.0).
1570 /* no changes necessary */
1571 /* see general __svr4__ defines below */
1572 # endif /* DELL_SVR4 */
1580 # include <sys/sysmacros.h>
1581 # define BSD /* has BSD routines */
1582 # define HASSETRLIMIT 0 /* ... but not setrlimit(2) */
1583 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */
1584 # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */
1585 # define HASUNAME 1 /* use System V uname(2) system call */
1586 # define HASFCHMOD 1 /* has fchmod(2) syscall */
1587 # define HASINITGROUPS 1 /* has initgroups(3) call */
1588 # define HASSETVBUF 1 /* has setvbuf(3) in libc */
1589 # define HASSTRERROR 1 /* has strerror(3) */
1590 # define SIGFUNC_DEFINED /* sigfunc_t already defined */
1591 # define SIGFUNC_RETURN /* POSIX-mode */
1592 # define SIGFUNC_DECL void /* POSIX-mode */
1593 # define ERRLIST_PREDEFINED 1
1595 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
1596 # endif /* ! IDENTPROTO */
1598 # define LA_TYPE LA_INT
1600 # endif /* ! LA_TYPE */
1601 # define LA_AVENRUN "avenrun"
1602 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1603 # define TZ_TYPE TZ_TZNAME
1605 # define _PATH_UNIX "/unix" /* should be in <paths.h> */
1606 # endif /* ! _PATH_UNIX */
1607 # ifndef _PATH_VENDOR_CF
1608 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1609 # endif /* ! _PATH_VENDOR_CF */
1612 # endif /* _AUX_SOURCE */
1618 ** Not extensively tested.
1622 # define HASUNAME 1 /* use System V uname(2) system call */
1623 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */
1624 # define HASINITGROUPS 1 /* has initgroups(3) call */
1625 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1626 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1627 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
1628 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
1629 # define MAXPATHLEN PATH_MAX
1630 extern struct passwd *getpwent(), *getpwnam(), *getpwuid();
1631 extern struct group *getgrent(), *getgrnam(), *getgrgid();
1638 ** Stardent Titan 3000 running TitanOS 4.2.
1640 ** Must be compiled in "cc -43" mode.
1642 ** From Kate Hedstrom <kate@ahab.rutgers.edu>.
1644 ** Note the tweaking below after the BSD defines are set.
1648 # define setpgid setpgrp
1656 ** Sequent DYNIX 3.2.0
1658 ** From Jim Davis <jdavis@cs.arizona.edu>.
1664 # define HASUNSETENV 1
1665 # define BSD4_3 1 /* to get signal() in conf.c */
1666 # define WAITUNION 1
1667 # define LA_TYPE LA_FLOAT
1668 # ifdef _POSIX_VERSION
1669 # undef _POSIX_VERSION /* set in <unistd.h> */
1670 # endif /* _POSIX_VERSION */
1671 # undef HASSETVBUF /* don't actually have setvbuf(3) */
1672 # define setpgid setpgrp
1674 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
1676 # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \
1677 ((union wait*)&(s))->w_termsig == 0)
1678 # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode)
1680 # define isgraph(c) (isprint(c) && (c != ' '))
1683 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
1684 # endif /* ! IDENTPROTO */
1687 # define _PATH_UNIX "/dynix"
1688 # endif /* ! _PATH_UNIX */
1689 # ifndef _PATH_VENDOR_CF
1690 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1691 # endif /* ! _PATH_VENDOR_CF */
1692 # endif /* sequent */
1696 ** Sequent DYNIX/ptx v2.0 (and higher)
1698 ** For DYNIX/ptx v1.x, undefine HASSETREUID.
1700 ** From Tim Wright <timw@sequent.com>.
1701 ** Update from Jack Woolley <jwoolley@sctcorp.com>, 26 Dec 1995,
1702 ** for DYNIX/ptx 4.0.2.
1706 # include <sys/stream.h>
1707 # define SYSTEM5 1 /* include all the System V defines */
1708 # define HASSETSID 1 /* has POSIX setsid(2) call */
1709 # define HASINITGROUPS 1 /* has initgroups(3) call */
1710 # define HASSETREUID 1 /* has setreuid(2) call */
1711 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1712 # define GIDSET_T gid_t
1713 # define LA_TYPE LA_INT
1714 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
1715 # define SPT_TYPE SPT_NONE /* don't use setproctitle */
1717 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
1718 # endif /* ! IDENTPROTO */
1719 # ifndef _PATH_VENDOR_CF
1720 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1721 # endif /* ! _PATH_VENDOR_CF */
1722 # ifndef _PATH_SENDMAILPID
1723 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1724 # endif /* ! _PATH_SENDMAILPID */
1725 # endif /* _SEQUENT_ */
1728 ** Cray UNICOS, UNICOS/mk, and UNICOS/mp
1731 ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
1732 ** Update Brian Ginsbach <ginsbach@cray.com>
1733 ** UNICOS/mk (Cray T3E):
1734 ** Contributed by Manu Mahonen <mailadm@csc.fi>
1735 ** of Center for Scientific Computing.
1736 ** Update Brian Ginsbach <ginsbach@cray.com>
1738 ** From Aaron Davis <awd@cray.com> & Brian Ginsbach <ginsbach@cray.com>
1741 # if defined(_CRAY) || defined(UNICOS) || defined(_UNICOSMP)
1742 # define SYSTEM5 1 /* include all the System V defines */
1743 # define HASFCHMOD 1 /* has fchmod(2) syscall */
1744 # define HASFCHOWN 1 /* has fchown(2) */
1745 # define HASUNSETENV 1 /* has unsetenv(3) call */
1746 # define HASINITGROUPS 1 /* has initgroups(3) call */
1747 # define HASSETREUID 1 /* has setreuid(2) call */
1748 # define USESETEUID 1 /* has usable seteuid(2) call */
1749 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */
1750 # define HASSTRERROR 1 /* has strerror(3) */
1751 # define GIDSET_T gid_t
1752 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
1753 # define SFS_BAVAIL f_bfree /* alternate field name */
1754 # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */
1756 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1757 # define LA_TYPE LA_ZERO
1758 # define _PATH_MAILDIR "/usr/spool/mail"
1759 # define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst)
1761 # define MAXPATHLEN PATHSIZE
1762 # endif /* ! MAXPATHLEN */
1765 # define _PATH_UNIX "/unicosmk.ar"
1767 # define _PATH_UNIX "/unicos"
1768 # endif /* UNICOSMK */
1769 # endif /* ! _PATH_UNIX */
1770 # ifndef _PATH_VENDOR_CF
1771 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1772 # endif /* ! _PATH_VENDOR_CF */
1773 # endif /* UNICOS */
1775 # if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
1776 /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */
1777 # define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
1778 # endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */
1779 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1780 # define HASSETRLIMIT 1 /* has setrlimit(2) syscall */
1781 # define LA_TYPE LA_IRIX6 /* figure out at run time */
1782 # include <sys/cdefs.h>
1784 # define ARGV_T char *const *
1785 # endif /* _UNICOSMP */
1791 ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
1793 ** 15 Jan 1994; updated 2 Aug 1995
1798 # define HASSETREUID 1 /* has setreuid(2) call */
1799 # define HASINITGROUPS 1 /* has initgroups(2) call */
1800 # define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */
1801 # define SPT_TYPE SPT_NONE /* don't use setproctitle */
1802 # define LA_TYPE LA_SUBR /* use getloadavg.c */
1803 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
1804 # define SFS_BAVAIL f_bfree /* alternate field name */
1805 # define TZ_TYPE TZ_TZNAME
1806 # ifndef _PATH_VENDOR_CF
1807 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1808 # endif /* ! _PATH_VENDOR_CF */
1809 # ifndef _PATH_SENDMAILPID
1810 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1811 # endif /* ! _PATH_SENDMAILPID */
1812 # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */
1814 # define S_IFIFO 0010000
1816 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
1817 # endif /* ! IDENTPROTO */
1818 # define RLIMIT_NEEDS_SYS_TIME_H 1
1819 # if defined(NGROUPS_MAX) && !NGROUPS_MAX
1821 # endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */
1822 # endif /* apollo */
1827 ** Requires MPE 6.0 or greater. See sendmail/README for more info.
1829 ** From Mark Bixby <mark_bixby@hp.com> or <mark@bixby.org>.
1834 # include <sys/sysmacros.h>
1837 /* Sendmail stuff */
1838 # define HASFCHOWN 0 /* lacks fchown() */
1839 # define HASGETUSERSHELL 0 /* lacks getusershell() */
1842 # endif /* HASNICE */
1843 # define HASNICE 0 /* lacks nice() */
1844 # define HASRANDOM 0 /* lacks random() */
1845 # ifdef HASRRESVPORT
1846 # undef HASRRESVPORT
1847 # endif /* HASRRESVPORT */
1848 # define HASRRESVPORT 0 /* lacks rresvport() */
1849 # define IP_SRCROUTE 0 /* lacks IP source routing fields */
1852 # endif /* MATCHGECOS */
1853 # define MATCHGECOS 0 /* lacks an initialized GECOS field */
1854 # define NEEDFSYNC 1 /* use sendmail's fsync() */
1855 # define NEEDLINK 1 /* use sendmail's link() */
1856 # define NOFTRUNCATE 1 /* lacks ftruncate() */
1857 # define SFS_TYPE SFS_NONE /* can't determine disk space */
1858 # define SM_CONF_SYSLOG 0 /* use sendmail decl of syslog() */
1859 # define USE_DOUBLE_FORK 0 /* don't fork an intermediate zombie */
1860 # define USE_ENVIRON 1 /* use environ instead of envp */
1862 /* Missing header stuff */
1863 # define AF_UNSPEC 0
1864 # define AF_MAX AF_INET
1865 # define IFF_LOOPBACK 0x8
1866 # define IN_LOOPBACKNET 127
1867 # define MAXNAMLEN NAME_MAX
1868 # define S_IEXEC S_IXUSR
1869 # define S_IREAD S_IRUSR
1870 # define S_IWRITE S_IWUSR
1872 /* Present header stuff that needs to be missing */
1875 /* Shadow functions */
1876 # define bind sendmail_mpe_bind
1877 # define _exit sendmail_mpe__exit
1878 # define exit sendmail_mpe_exit
1879 # define fcntl sendmail_mpe_fcntl
1880 # define getegid sendmail_mpe_getegid
1881 # define geteuid sendmail_mpe_geteuid
1882 # define getpwnam sendmail_mpe_getpwnam
1883 # define getpwuid sendmail_mpe_getpwuid
1884 # define setgid sendmail_mpe_setgid
1885 # define setuid sendmail_mpe_setuid
1886 extern int sendmail_mpe_fcntl __P((int, int, ...));
1887 extern struct passwd * sendmail_mpe_getpwnam __P((const char *));
1888 extern struct passwd * sendmail_mpe_getpwuid __P((uid_t));
1892 ** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native)
1894 ** Contributed by Paul Gampe <paulg@apnic.net>
1898 # include <sys/mkdev.h>
1900 # define SYS5SIGNALS 1
1901 # define HASFCHOWN 1 /* has fchown(2) call */
1902 # define HASSETSID 1 /* has POSIX setsid(2) call */
1903 # define HASSETREUID 1
1904 # define HASWAITPID 1
1905 # define HASGETDTABLESIZE 1
1906 # define GIDSET_T gid_t
1907 # define SOCKADDR_LEN_T size_t
1908 # define SOCKOPT_LEN_T size_t
1910 # define _PATH_UNIX "/stand/unix"
1911 # endif /* ! _PATH_UNIX */
1912 # define SPT_PADCHAR '\0' /* pad process title with nulls */
1913 # ifndef SYSLOG_BUFSIZE
1914 # define SYSLOG_BUFSIZE 1024 /* unsure */
1915 # endif /* ! SYSLOG_BUFSIZE */
1916 # ifndef _PATH_VENDOR_CF
1917 # define _PATH_VENDOR_CF "/etc/sendmail.cf"
1918 # endif /* ! _PATH_VENDOR_CF */
1919 # ifndef _PATH_SENDMAILPID
1920 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1921 # endif /* ! _PATH_SENDMAILPID */
1922 # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */
1923 #if !defined(SM_SET_H_ERRNO) && defined(_REENTRANT)
1924 # define SM_SET_H_ERRNO(err) set_h_errno((err))
1925 #endif /* ! SM_SET_H_ERRNO && _REENTRANT */
1926 # endif /* __svr5__ */
1928 /* ###################################################################### */
1936 # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */
1937 # endif /* UNIXWARE2 */
1943 ** Updated by Petr Lampa <lampa@fee.vutbr.cz>.
1944 ** From Evan Champion <evanc@spatial.synapse.org>.
1948 # include <sys/mkdev.h>
1950 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1951 # define HASSETREUID 1
1952 # define HASSETSID 1 /* has POSIX setsid(2) call */
1953 # define HASINITGROUPS 1
1954 # define GIDSET_T gid_t
1955 # define SLEEP_T unsigned
1956 # define SFS_TYPE SFS_STATVFS
1957 # define LA_TYPE LA_ZERO
1961 # define _PATH_UNIX "/unix"
1962 # endif /* ! _PATH_UNIX */
1963 # ifndef _PATH_VENDOR_CF
1964 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
1965 # endif /* ! _PATH_VENDOR_CF */
1966 # ifndef _PATH_SENDMAILPID
1967 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
1968 # endif /* ! _PATH_SENDMAILPID */
1969 # define SYSLOG_BUFSIZE 128
1970 # endif /* UNIXWARE */
1974 ** Intergraph CLIX 3.1
1976 ** From Paul Southworth <pauls@locust.cic.net>
1980 # define SYSTEM5 1 /* looks like System V */
1981 # ifndef HASGETUSERSHELL
1982 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1983 # endif /* ! HASGETUSERSHELL */
1984 # define DEV_BSIZE 512 /* device block size not defined */
1985 # define GIDSET_T gid_t
1986 # undef LOG /* syslog not available */
1987 # define NEEDFSYNC 1 /* no fsync in system library */
1988 # define GETSHORT _getshort
1993 ** NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP
1995 ** From Kevin Darcy <kevin@tech.mis.cfc.com>.
1999 # include <sys/sockio.h>
2001 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */
2002 # define SYSLOG_BUFSIZE 1024
2003 # define SPT_TYPE SPT_NONE
2004 # endif /* NCR_MP_RAS2 */
2008 ** NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP
2010 ** From Tom Moore <Tom.Moore@DaytonOH.NCR.COM>
2015 # define HASFCHOWN 1 /* has fchown(2) call */
2016 # define LDA_USE_LOCKF 1
2017 # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM has non-std interface */
2018 # define SO_REUSEADDR_IS_BROKEN 1 /* doesn't work if accept() fails */
2019 # define SYSLOG_BUFSIZE 1024
2020 # define SPT_TYPE SPT_NONE
2021 # define _PATH_MAILDIR "/var/mail"
2022 # ifndef _XOPEN_SOURCE
2023 # define _XOPEN_SOURCE
2024 # define _XOPEN_SOURCE_EXTENDED 1
2025 # include <sys/resource.h>
2026 # undef _XOPEN_SOURCE
2027 # undef _XOPEN_SOURCE_EXTENDED
2028 # endif /* ! _XOPEN_SOURCE */
2029 # endif /* NCR_MP_RAS3 */
2033 ** Tandem NonStop-UX SVR4
2035 ** From Rick McCarty <mccarty@mpd.tandem.com>.
2038 # ifdef NonStop_UX_BXX
2040 # endif /* NonStop_UX_BXX */
2044 ** Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2.
2046 ** Tested for 1.04, 1.03
2047 ** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
2049 ** Tested for 4.02, 6.10 and 7.10
2050 ** From Motonori NAKAMURA <motonori@media.kyoto-u.ac.jp>.
2053 # if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE))
2054 # define SYSTEM5 1 /* include all the System V defines */
2055 # define HASINITGROUPS 1 /* has initgroups(3) call */
2056 # define HASFCHMOD 1 /* has fchmod(2) syscall */
2057 # define setreuid(r, e) setresuid(r, e, -1)
2058 # define LA_TYPE LA_FLOAT
2059 # define SPT_TYPE SPT_PSTAT
2060 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
2062 # define HASSETVBUF /* HI-UX has no setlinebuf */
2063 # endif /* ! HASSETVBUF */
2065 # define GIDSET_T gid_t
2066 # endif /* ! GIDSET_T */
2068 # define _PATH_UNIX "/HI-UX"
2069 # endif /* ! _PATH_UNIX */
2070 # ifndef _PATH_VENDOR_CF
2071 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
2072 # endif /* ! _PATH_VENDOR_CF */
2074 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
2075 # endif /* ! IDENTPROTO */
2076 # ifndef HASGETUSERSHELL
2077 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
2078 # endif /* ! HASGETUSERSHELL */
2079 # define FDSET_CAST (int *) /* cast for fd_set parameters to select */
2082 ** avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h
2087 # define SM_CONF_SYSLOG 0
2089 # endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */
2093 ** Amdahl UTS System V 2.1.5 (SVr3-based)
2095 ** From: Janet Jackson <janet@dialix.oz.au>.
2099 # include <sys/sysmacros.h>
2100 # undef HASLSTAT /* has symlinks, but they cause problems */
2101 # define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */
2102 # define SYS5SIGNALS 1 /* System V signal semantics */
2103 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
2104 # define HASUNAME 1 /* use System V uname(2) system call */
2105 # define HASINITGROUPS 1 /* has initgroups(3) function */
2106 # define HASSETVBUF 1 /* has setvbuf(3) function */
2107 # ifndef HASGETUSERSHELL
2108 # define HASGETUSERSHELL 0 /* does not have getusershell(3) function */
2109 # endif /* ! HASGETUSERSHELL */
2110 # define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */
2111 # define LA_TYPE LA_ZERO /* doesn't have load average */
2112 # define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */
2113 # define SFS_BAVAIL f_bfree /* alternate field name */
2114 # define _PATH_UNIX "/unix"
2115 # ifndef _PATH_VENDOR_CF
2116 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
2117 # endif /* ! _PATH_VENDOR_CF */
2121 ** Cray Computer Corporation's CSOS
2123 ** From Scott Bolte <scott@craycos.com>.
2127 # define SYSTEM5 1 /* include all the System V defines */
2128 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
2129 # define NEEDFSYNC 1 /* no fsync in system library */
2130 # define MAXPATHLEN PATHSIZE
2131 # define LA_TYPE LA_ZERO
2132 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
2133 # define SFS_BAVAIL f_bfree /* alternate field name */
2134 # define _POSIX_CHOWN_RESTRICTED -1
2135 extern struct group *getgrent(), *getgrnam(), *getgrgid();
2136 # endif /* _CRAYCOM */
2140 ** Sony NEWS-OS 4.2.1R and 6.0.3
2142 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
2147 /* NEWS-OS 4.2.1R */
2149 # define BSD /* has BSD routines */
2151 # define HASUNSETENV 1 /* has unsetenv(2) call */
2152 # undef HASSETVBUF /* don't actually have setvbuf(3) */
2153 # define WAITUNION 1 /* use "union wait" as wait argument type */
2154 # define LA_TYPE LA_INT
2155 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
2157 # define HASFLOCK 1 /* has flock(2) call */
2158 # endif /* ! HASFLOCK */
2159 # define setpgid setpgrp
2162 # define MODE_T int /* system include files have no mode_t */
2164 typedef int (*sigfunc_t)();
2165 # define SIGFUNC_DEFINED
2166 # define SIGFUNC_RETURN (0)
2167 # define SIGFUNC_DECL int
2169 # else /* ! __svr4 */
2170 /* NEWS-OS 6.0.3 with /bin/cc */
2172 # define __svr4__ /* use all System V Release 4 defines below */
2173 # endif /* ! __svr4__ */
2174 # define HASSETSID 1 /* has POSIX setsid(2) call */
2175 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */
2176 # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */
2178 # define SPT_TYPE SPT_SYSMIPS /* use sysmips() (OS 6.0.2 or later) */
2179 # endif /* ! SPT_TYPE */
2180 # define GIDSET_T gid_t
2183 # ifndef SYSLOG_BUFSIZE
2184 # define SYSLOG_BUFSIZE 256
2185 # endif /* ! SYSLOG_BUFSIZE */
2186 # define _PATH_UNIX "/stand/unix"
2187 # ifndef _PATH_VENDOR_CF
2188 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf"
2189 # endif /* ! _PATH_VENDOR_CF */
2190 # ifndef _PATH_SENDMAILPID
2191 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
2192 # endif /* ! _PATH_SENDMAILPID */
2194 # endif /* ! __svr4 */
2195 # endif /* sony_news */
2199 ** Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
2201 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
2206 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
2207 # endif /* ! IDENTPROTO */
2208 # define HASUNSETENV 1 /* has unsetenv(2) call */
2209 # define NEEDPUTENV 1 /* need putenv(3) call */
2210 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
2211 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */
2212 # define WAITUNION 1 /* use "union wait" as wait argument type */
2214 # include <sys/time.h>
2215 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
2216 # define LA_TYPE LA_INT
2217 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */
2218 # endif /* uniosb */
2220 # define LA_TYPE LA_SUBR
2221 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */
2224 # define LA_TYPE LA_INT
2225 # endif /* luna88k */
2226 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
2227 # define setpgid setpgrp
2231 typedef int (*sigfunc_t)();
2232 # define SIGFUNC_DEFINED
2233 # define SIGFUNC_RETURN (0)
2234 # define SIGFUNC_DECL int
2235 extern char *getenv();
2236 # ifndef _PATH_VENDOR_CF
2237 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
2238 # endif /* ! _PATH_VENDOR_CF */
2243 ** NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
2245 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
2248 # if defined(nec_ews_svr4) || defined(_nec_ews_svr4)
2250 # define __svr4__ /* use all System V Release 4 defines below */
2251 # endif /* ! __svr4__ */
2252 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
2253 # define HASSETSID 1 /* has POSIX setsid(2) call */
2254 # define LA_TYPE LA_READKSYM /* use MIOC_READSYM ioctl */
2255 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */
2256 # define GIDSET_T gid_t
2259 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */
2260 # ifndef _PATH_VENDOR_CF
2261 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
2262 # endif /* ! _PATH_VENDOR_CF */
2263 # ifndef _PATH_SENDMAILPID
2264 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
2265 # endif /* ! _PATH_SENDMAILPID */
2266 # ifndef SYSLOG_BUFSIZE
2267 # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */
2268 # endif /* ! SYSLOG_BUFSIZE */
2269 # endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */
2273 ** Fujitsu/ICL UXP/DS (For the DS/90 Series)
2275 ** From Diego R. Lopez <drlopez@cica.es>.
2276 ** Additional changes from Fumio Moriya and Toshiaki Nomura of the
2277 ** Fujitsu Fresoftware group <dsfrsoft@oai6.yk.fujitsu.co.jp>.
2281 # include <arpa/nameser.h>
2282 # include <sys/sysmacros.h>
2283 # include <sys/mkdev.h>
2285 # define HASGETUSERSHELL 0
2287 # define _PATH_UNIX "/stand/unix"
2288 # ifndef _PATH_VENDOR_CF
2289 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
2290 # endif /* ! _PATH_VENDOR_CF */
2291 # ifndef _PATH_SENDMAILPID
2292 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
2293 # endif /* ! _PATH_SENDMAILPID */
2294 # endif /* __uxp__ */
2299 ** From Earle Ake <akee@wpdiss1.wpafb.af.mil>.
2303 # define GIDSET_T gid_t
2305 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
2306 # endif /* ! IDENTPROTO */
2310 ** Concurrent Computer Corporation Maxion
2312 ** From Donald R. Laster Jr. <laster@access.digex.net>.
2317 # include <sys/stream.h>
2318 # define __svr4__ 1 /* SVR4.2MP */
2319 # define HASSETREUID 1 /* have setreuid(2) */
2320 # define HASLSTAT 1 /* have lstat(2) */
2321 # define HASSETRLIMIT 1 /* have setrlimit(2) */
2322 # define HASGETDTABLESIZE 1 /* have getdtablesize(2) */
2323 # define HASGETUSERSHELL 1 /* have getusershell(3) */
2324 # define NOFTRUNCATE 1 /* do not have ftruncate(2) */
2325 # define SLEEP_T unsigned
2326 # define SFS_TYPE SFS_STATVFS
2327 # define SFS_BAVAIL f_bavail
2328 # ifndef SYSLOG_BUFSIZE
2329 # define SYSLOG_BUFSIZE 256 /* Use 256 bytes */
2330 # endif /* ! SYSLOG_BUFSIZE */
2340 # endif /* __MAXION__ */
2343 ** Harris Nighthawk PowerUX (nh6000 box)
2345 ** Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com>
2351 # endif /* ! __svr4__ */
2352 # ifndef _PATH_VENDOR_CF
2353 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf"
2354 # endif /* ! _PATH_VENDOR_CF */
2355 # ifndef _PATH_SENDMAILPID
2356 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
2357 # endif /* ! _PATH_SENDMAILPID */
2358 # define SYSLOG_BUFSIZE 1024
2359 # define LA_TYPE LA_ZERO
2360 typedef struct msgb mblk_t;
2361 # undef offsetof /* avoid stddefs.h and sys/sysmacros.h conflict */
2362 # endif /* _PowerUX */
2365 ** Siemens Nixdorf Informationssysteme AG SINIX
2367 ** Contributed by Gerald Rinske of Siemens Business Services VAS.
2370 # define HASRANDOM 0 /* has random(3) */
2371 # define SYSLOG_BUFSIZE 1024
2372 # define SM_INT32 int /* 32bit integer */
2377 ** Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3
2379 ** Contributed by Sergey Rusanov <rsm@utfoms.udmnet.ru>
2383 # define HASFCHMOD 1
2384 # define HASSETRLIMIT 0
2385 # define HASSETSID 1 /* has POSIX setsid(2) call */
2386 # define HASSETREUID 1
2387 # define HASULIMIT 1
2388 # define HASWAITPID 1
2389 # define HASGETDTABLESIZE 1
2390 # define HASGETUSERSHELL 1
2391 # define IP_SRCROUTE 0
2392 # define IDENTPROTO 0
2393 # define RES_DNSRCH_VARIABLE _res_dnsrch
2394 # define _PATH_UNIX "/unix"
2395 # define _PATH_VENDOR_CF "/etc/sendmail.cf"
2396 # define _PATH_SENDMAILPID "/var/run/sendmail.pid"
2401 ** Contributed by Nedelcho Stanev <nedelcho.stanev@atlanticsky.com>
2403 ** Used for Interix support.
2406 # if defined(__INTERIX)
2407 # define HASURANDOMDEV 1
2408 # define HASGETUSERSHELL 0
2409 # define HASSTRERROR 1
2410 # define HASUNSETENV 1
2411 # define HASFCHOWN 1
2412 # undef HAVE_SYS_ERRLIST
2413 # define sys_errlist __sys_errlist
2414 # define sys_nerr __sys_nerr
2415 # include <sys/mkdev.h>
2417 # define major(dev) ((int)(((dev) >> 8) & 0xff))
2418 # endif /* ! major */
2420 # define minor(dev) ((int)((dev) & 0xff))
2421 # endif /* ! minor */
2422 # endif /* defined(__INTERIX) */
2425 /**********************************************************************
2426 ** End of Per-Operating System defines
2427 **********************************************************************/
2428 /**********************************************************************
2429 ** More general defines
2430 **********************************************************************/
2432 /* general BSD defines */
2434 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
2435 # ifndef HASSETREUID
2436 # define HASSETREUID 1 /* has setreuid(2) call */
2437 # endif /* ! HASSETREUID */
2438 # define HASINITGROUPS 1 /* has initgroups(3) call */
2439 # ifndef IP_SRCROUTE
2440 # define IP_SRCROUTE 1 /* can check IP source routing */
2441 # endif /* ! IP_SRCROUTE */
2442 # ifndef HASSETRLIMIT
2443 # define HASSETRLIMIT 1 /* has setrlimit(2) call */
2444 # endif /* ! HASSETRLIMIT */
2446 # define HASFLOCK 1 /* has flock(2) call */
2447 # endif /* ! HASFLOCK */
2449 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */
2450 # endif /* ! TZ_TYPE */
2453 /* general System V Release 4 defines */
2456 # define USESETEUID 1 /* has usable seteuid(2) call */
2457 # define HASINITGROUPS 1 /* has initgroups(3) call */
2458 # define BSD_COMP 1 /* get BSD ioctl calls */
2459 # ifndef HASSETRLIMIT
2460 # define HASSETRLIMIT 1 /* has setrlimit(2) call */
2461 # endif /* ! HASSETRLIMIT */
2462 # ifndef HASGETUSERSHELL
2463 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
2464 # endif /* ! HASGETUSERSHELL */
2466 # define HASFCHMOD 1 /* most (all?) SVr4s seem to have fchmod(2) */
2467 # endif /* ! HASFCHMOD */
2470 # define _PATH_UNIX "/unix"
2471 # endif /* ! _PATH_UNIX */
2472 # ifndef _PATH_VENDOR_CF
2473 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
2474 # endif /* ! _PATH_VENDOR_CF */
2475 # ifndef _PATH_SENDMAILPID
2476 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
2477 # endif /* ! _PATH_SENDMAILPID */
2478 # ifndef SYSLOG_BUFSIZE
2479 # define SYSLOG_BUFSIZE 128
2480 # endif /* ! SYSLOG_BUFSIZE */
2482 # define SFS_TYPE SFS_STATVFS
2483 # endif /* ! SFS_TYPE */
2485 # ifndef USE_SIGLONGJMP
2486 # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
2487 # endif /* ! USE_SIGLONGJMP */
2488 # endif /* __svr4__ */
2491 # define LDA_USE_LOCKF 1
2492 # define LDA_USE_SETEUID 1
2493 # define _PATH_MAILDIR "/var/mail"
2494 # endif /* __SVR4 */
2496 /* general System V defines */
2498 # include <sys/sysmacros.h>
2499 # define HASUNAME 1 /* use System V uname(2) system call */
2500 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
2501 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */
2503 # define HASULIMIT 1 /* has the ulimit(2) syscall */
2504 # endif /* ! HASULIMIT */
2506 # ifdef MIOC_READKSYM
2507 # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */
2508 # else /* MIOC_READKSYM */
2509 # define LA_TYPE LA_INT /* assume integer load average */
2510 # endif /* MIOC_READKSYM */
2511 # endif /* ! LA_TYPE */
2513 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */
2514 # endif /* ! SFS_TYPE */
2516 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
2517 # endif /* ! TZ_TYPE */
2518 # endif /* SYSTEM5 */
2520 /* general POSIX defines */
2521 # ifdef _POSIX_VERSION
2522 # define HASSETSID 1 /* has POSIX setsid(2) call */
2523 # define HASWAITPID 1 /* has POSIX waitpid(2) call */
2524 # if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
2525 # define USESETEUID 1 /* has usable seteuid(2) call */
2526 # endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */
2527 # endif /* _POSIX_VERSION */
2529 ** Tweaking for systems that (for example) claim to be BSD or POSIX
2530 ** but don't have all the standard BSD or POSIX routines (boo hiss).
2534 # undef HASINITGROUPS /* doesn't have initgroups(3) call */
2538 # undef HASSETSID /* despite POSIX claim, doesn't have setsid */
2539 # endif /* _CRAYCOM */
2546 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and
2547 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message
2548 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
2549 ** are closed. Some firewalls return this error if you try to connect
2550 ** to the IDENT port (113), so you can't receive email from these hosts
2551 ** on these systems. The firewall really should use a more specific
2552 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB. If
2553 ** not explicitly set to zero above, default it on.
2557 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */
2558 # endif /* ! IDENTPROTO */
2560 # ifndef IP_SRCROUTE
2561 # define IP_SRCROUTE 1 /* Detect IP source routing */
2562 # endif /* ! IP_SRCROUTE */
2564 # ifndef HASGETUSERSHELL
2565 # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */
2566 # endif /* ! HASGETUSERSHELL */
2569 # define NETUNIX 1 /* include unix domain support */
2570 # endif /* ! NETUNIX */
2573 # define HASRANDOM 1 /* has random(3) support */
2574 # endif /* ! HASRANDOM */
2577 # define HASFLOCK 0 /* assume no flock(2) support */
2578 # endif /* ! HASFLOCK */
2580 # ifndef HASSETREUID
2581 # define HASSETREUID 0 /* assume no setreuid(2) call */
2582 # endif /* ! HASSETREUID */
2585 # define HASFCHMOD 0 /* assume no fchmod(2) syscall */
2586 # endif /* ! HASFCHMOD */
2589 # define USESETEUID 0 /* assume no seteuid(2) call or no saved ids */
2590 # endif /* ! USESETEUID */
2592 # ifndef HASSETRLIMIT
2593 # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */
2594 # endif /* ! HASSETRLIMIT */
2597 # define HASULIMIT 0 /* assume no ulimit(2) support */
2598 # endif /* ! HASULIMIT */
2601 # define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */
2602 # endif /* ! SECUREWARE */
2604 # ifndef USE_DOUBLE_FORK
2605 # define USE_DOUBLE_FORK 1 /* avoid intermediate zombies */
2606 # endif /* ! USE_DOUBLE_FORK */
2608 # ifndef USE_ENVIRON
2609 # define USE_ENVIRON 0 /* use main() envp instead of extern environ */
2610 # endif /* ! USE_ENVIRON */
2612 # ifndef USE_SIGLONGJMP
2613 # define USE_SIGLONGJMP 0 /* assume setjmp handles signals properly */
2614 # endif /* ! USE_SIGLONGJMP */
2617 # define FDSET_CAST /* (empty) cast for fd_set arg to select */
2618 # endif /* ! FDSET_CAST */
2621 ** Pick a mailer setuid method for changing the current uid
2624 # define USE_SETEUID 0
2625 # define USE_SETREUID 1
2626 # define USE_SETUID 2
2629 # define MAILER_SETUID_METHOD USE_SETEUID
2630 # else /* USESETEUID */
2632 # define MAILER_SETUID_METHOD USE_SETREUID
2633 # else /* HASSETREUID */
2634 # define MAILER_SETUID_METHOD USE_SETUID
2635 # endif /* HASSETREUID */
2636 # endif /* USESETEUID */
2639 ** If no type for argument two of getgroups call is defined, assume
2640 ** it's an integer -- unfortunately, there seem to be several choices
2645 # define GIDSET_T int
2646 # endif /* ! GIDSET_T */
2649 # define UID_T uid_t
2650 # endif /* ! UID_T */
2653 # define GID_T gid_t
2654 # endif /* ! GID_T */
2657 # define MODE_T mode_t
2658 # endif /* ! MODE_T */
2661 # define ARGV_T char **
2662 # endif /* ! ARGV_T */
2664 # ifndef SOCKADDR_LEN_T
2665 # define SOCKADDR_LEN_T int
2666 # endif /* ! SOCKADDR_LEN_T */
2668 # ifndef SOCKOPT_LEN_T
2669 # define SOCKOPT_LEN_T int
2670 # endif /* ! SOCKOPT_LEN_T */
2673 # define QUAD_T unsigned long
2674 # endif /* ! QUAD_T */
2675 /**********************************************************************
2676 ** Remaining definitions should never have to be changed. They are
2677 ** primarily to provide back compatibility for older systems -- for
2678 ** example, it includes some POSIX compatibility definitions
2679 **********************************************************************/
2681 /* System 5 compatibility */
2683 # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG)
2684 # endif /* ! S_ISREG */
2686 # define S_ISDIR(foo) ((foo & S_IFMT) == S_IFDIR)
2687 # endif /* ! S_ISDIR */
2688 # if !defined(S_ISLNK) && defined(S_IFLNK)
2689 # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK)
2690 # endif /* !defined(S_ISLNK) && defined(S_IFLNK) */
2691 # if !defined(S_ISFIFO)
2692 # if defined(S_IFIFO)
2693 # define S_ISFIFO(foo) ((foo & S_IFMT) == S_IFIFO)
2694 # else /* defined(S_IFIFO) */
2695 # define S_ISFIFO(foo) false
2696 # endif /* defined(S_IFIFO) */
2697 # endif /* !defined(S_ISFIFO) */
2699 # define S_IRUSR 0400
2700 # endif /* ! S_IRUSR */
2702 # define S_IWUSR 0200
2703 # endif /* ! S_IWUSR */
2705 # define S_IRGRP 0040
2706 # endif /* ! S_IRGRP */
2708 # define S_IWGRP 0020
2709 # endif /* ! S_IWGRP */
2711 # define S_IROTH 0004
2712 # endif /* ! S_IROTH */
2714 # define S_IWOTH 0002
2715 # endif /* ! S_IWOTH */
2717 /* close-on-exec flag */
2719 # define FD_CLOEXEC 1
2720 # endif /* ! FD_CLOEXEC */
2723 ** Older systems don't have this error code -- it should be in
2724 ** /usr/include/sysexits.h.
2728 # define EX_CONFIG 78 /* configuration error */
2729 # endif /* ! EX_CONFIG */
2732 # define EX_QUIT 22 /* drop out of server immediately */
2733 # define EX_RESTART 23 /* restart sendmail daemon */
2734 # define EX_SHUTDOWN 24 /* shutdown sendmail daemon */
2737 # define EX_NOTFOUND EX_NOHOST
2738 #endif /* ! EX_NOTFOUND */
2740 /* pseudo-code used for mci_setstat */
2741 # define EX_NOTSTICKY (-5) /* don't save persistent status */
2745 ** An "impossible" file mode to indicate that the file does not exist.
2748 # define ST_MODE_NOFILE 0171147 /* unlikely to occur */
2751 /* type of arbitrary pointer */
2753 # define ARBPTR_T void *
2754 # endif /* ! ARBPTR_T */
2757 # include "sm/cdefs.h"
2760 # if HESIOD && !defined(NAMED_BIND)
2761 # define NAMED_BIND 1 /* not one without the other */
2762 # endif /* HESIOD && !defined(NAMED_BIND) */
2764 # if NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno )
2766 # endif /* NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) */
2769 extern int putenv __P((char *));
2770 # endif /* NEEDPUTENV */
2773 extern void unsetenv __P((char *));
2774 #endif /* !HASUNSETENV */
2777 # include <sys/time.h>
2781 /* Some LDAP constants */
2782 # define LDAPMAP_FALSE 0
2783 # define LDAPMAP_TRUE 1
2786 ** ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1.
2787 ** Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations
2788 ** and assume (falsely) that all old API implementations are broken.
2789 ** (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT)
2792 # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT)
2793 # define USE_LDAP_INIT 1
2794 # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) */
2797 ** LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x,
2798 ** hence ldap_set_option() must not exist.
2801 # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION)
2802 # define USE_LDAP_SET_OPTION 1
2803 # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) */
2805 # endif /* LDAPMAP */
2808 # include <sys/utsname.h>
2811 # endif /* newstr */
2812 # else /* HASUNAME */
2813 # define NODE_LENGTH 32
2816 char nodename[NODE_LENGTH + 1];
2818 # endif /* HASUNAME */
2820 # if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V)
2821 # define MAXHOSTNAMELEN 256
2822 # endif /* !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) */
2825 # if _FFR_LINUX_MHNL && defined(__linux__) && MAXHOSTNAMELEN < 255
2827 ** override Linux weirdness: a FQHN can be 255 chars long
2828 ** SUSv3 requires HOST_NAME_MAX ("Maximum length of a host
2829 ** name (not including the terminating null) as returned from the
2830 ** gethostname() function.") to be at least 255. c.f.:
2831 ** http://www.opengroup.org/onlinepubs/009695399
2832 ** but Linux defines that to 64 too.
2834 # undef MAXHOSTNAMELEN
2835 # define MAXHOSTNAMELEN 256
2836 # endif /* _FFR_LINUX_MHNL && defined(__linux__) && MAXHOSTNAMELEN < 255 */
2838 # if !defined(SIGCHLD) && defined(SIGCLD)
2839 # define SIGCHLD SIGCLD
2840 # endif /* !defined(SIGCHLD) && defined(SIGCLD) */
2842 # ifndef STDIN_FILENO
2843 # define STDIN_FILENO 0
2844 # endif /* ! STDIN_FILENO */
2846 # ifndef STDOUT_FILENO
2847 # define STDOUT_FILENO 1
2848 # endif /* ! STDOUT_FILENO */
2850 # ifndef STDERR_FILENO
2851 # define STDERR_FILENO 2
2852 # endif /* ! STDERR_FILENO */
2855 # define LOCK_SH 0x01 /* shared lock */
2856 # define LOCK_EX 0x02 /* exclusive lock */
2857 # define LOCK_NB 0x04 /* non-blocking lock */
2858 # define LOCK_UN 0x08 /* unlock */
2859 # endif /* ! LOCK_SH */
2862 # define S_IXOTH (S_IEXEC >> 6)
2863 # endif /* ! S_IXOTH */
2866 # define S_IXGRP (S_IEXEC >> 3)
2867 # endif /* ! S_IXGRP */
2870 # define S_IXUSR (S_IEXEC)
2871 # endif /* ! S_IXUSR */
2874 # define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
2875 #endif /* ! O_ACCMODE */
2881 # endif /* ! SEEK_SET */
2884 # define SIG_ERR ((void (*)()) -1)
2885 # endif /* ! SIG_ERR */
2887 # ifndef WEXITSTATUS
2888 # define WEXITSTATUS(st) (((st) >> 8) & 0377)
2889 # endif /* ! WEXITSTATUS */
2891 # define WIFEXITED(st) (((st) & 0377) == 0)
2892 # endif /* ! WIFEXITED */
2894 # define WIFSTOPPED(st) (((st) & 0100) == 0)
2895 # endif /* ! WIFSTOPPED */
2897 # define WCOREDUMP(st) (((st) & 0200) != 0)
2898 # endif /* ! WCOREDUMP */
2900 # define WTERMSIG(st) (((st) & 0177))
2901 # endif /* ! WTERMSIG */
2903 # ifndef SIGFUNC_DEFINED
2904 typedef void (*sigfunc_t) __P((int));
2905 # endif /* ! SIGFUNC_DEFINED */
2906 # ifndef SIGFUNC_RETURN
2907 # define SIGFUNC_RETURN
2908 # endif /* ! SIGFUNC_RETURN */
2909 # ifndef SIGFUNC_DECL
2910 # define SIGFUNC_DECL void
2911 # endif /* ! SIGFUNC_DECL */
2913 /* size of syslog buffer */
2914 # ifndef SYSLOG_BUFSIZE
2915 # define SYSLOG_BUFSIZE 1024
2916 # endif /* ! SYSLOG_BUFSIZE */
2920 # define FD_SETSIZE 256
2921 #endif /* ! FD_SETSIZE */
2924 ** Size of prescan buffer.
2925 ** Despite comments in the _sendmail_ book, this probably should
2926 ** not be changed; there are some hard-to-define dependencies.
2929 # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */
2931 /* fork routine -- set above using #ifdef _osname_ or in Makefile */
2933 # define FORK fork /* function to call to fork mailer */
2934 # endif /* ! FORK */
2936 /* setting h_errno */
2937 # ifndef SM_SET_H_ERRNO
2938 # define SM_SET_H_ERRNO(err) h_errno = (err)
2939 # endif /* SM_SET_H_ERRNO */
2941 # ifndef SM_CONF_GETOPT
2942 # define SM_CONF_GETOPT 1
2943 # endif /* ! SM_CONF_GETOPT */
2945 /* random routine -- set above using #ifdef _osname_ or in Makefile */
2947 # define get_random() random()
2948 # else /* HASRANDOM */
2949 # define get_random() ((long) rand())
2950 # ifndef RANDOMSHIFT
2951 # define RANDOMSHIFT 8
2952 # endif /* ! RANDOMSHIFT */
2953 # endif /* HASRANDOM */
2956 ** Default to using scanf in readcf.
2961 # endif /* ! SCANF */
2963 /* XXX 32 bit type */
2965 # define SM_INT32 int32_t
2966 # endif /* ! SM_INT32 */
2968 /* XXX 16 bit type */
2970 # define SM_UINT16 uint16_t
2971 # endif /* ! SM_UINT16 */
2974 ** SVr4 and similar systems use different routines for setjmp/longjmp
2975 ** with signal support
2981 # endif /* jmp_buf */
2982 # define jmp_buf sigjmp_buf
2985 # endif /* setjmp */
2986 # define setjmp(env) sigsetjmp(env, 1)
2989 # endif /* longjmp */
2990 # define longjmp(env, val) siglongjmp(env, val)
2991 # endif /* USE_SIGLONGJMP */
2993 # if !defined(NGROUPS_MAX) && defined(NGROUPS)
2994 # define NGROUPS_MAX NGROUPS /* POSIX naming convention */
2995 # endif /* !defined(NGROUPS_MAX) && defined(NGROUPS) */
2998 ** Some snprintf() implementations are rumored not to NUL terminate.
3000 # if SNPRINTF_IS_BROKEN
3003 # endif /* snprintf */
3004 # define snprintf sm_snprintf
3007 # endif /* vsnprintf */
3008 # define vsnprintf sm_vsnprintf
3009 # endif /* SNPRINTF_IS_BROKEN */
3012 ** If we don't have a system syslog, simulate it.
3016 # define LOG_EMERG 0 /* system is unusable */
3017 # define LOG_ALERT 1 /* action must be taken immediately */
3018 # define LOG_CRIT 2 /* critical conditions */
3019 # define LOG_ERR 3 /* error conditions */
3020 # define LOG_WARNING 4 /* warning conditions */
3021 # define LOG_NOTICE 5 /* normal but significant condition */
3022 # define LOG_INFO 6 /* informational */
3023 # define LOG_DEBUG 7 /* debug-level messages */
3026 # ifndef SM_CONF_SYSLOG
3027 # define SM_CONF_SYSLOG 1 /* syslog.h has prototype for syslog() */
3028 # endif /* SM_CONF_SYSLOG */
3030 # if !SM_CONF_SYSLOG
3032 extern void syslog(int, const char *, ...);
3033 # else /* __STDC__ */
3034 extern void syslog();
3035 # endif /* __STDC__ */
3036 # endif /* !SM_CONF_SYSLOG */
3038 /* portable(?) definition for alignment */
3039 # ifndef SM_ALIGN_SIZE
3048 void (*al_f) __P((void));
3051 # define SM_ALIGN_SIZE offsetof(struct sm_align, al_u)
3052 # endif /* ! SM_ALIGN_SIZE */
3053 # define SM_ALIGN_BITS (SM_ALIGN_SIZE - 1)
3055 char *sm_inet6_ntop __P((const void *, char *, size_t));
3057 #endif /* ! SM_CONF_H */