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 */
477 # define SIGWAIT_TAKES_1_ARG 1 /* S12 moves to UNIX V7 semantic */
478 # endif /* SOLARIS < 21200 */
481 /* SunOS 4.0.3 or 4.1.x */
482 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */
483 # define HASSETREUID 1 /* has setreuid(2) call */
485 # define HASFLOCK 1 /* has flock(2) call */
486 # endif /* ! HASFLOCK */
487 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
488 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */
492 # define strtoul strtol /* gcc library bogosity */
493 # endif /* __GNUC__ */
494 # define memmove(d, s, l) (bcopy((s), (d), (l)))
495 # define atexit(f) on_exit((f), 0) /* ugly hack for SunOS */
496 # define SM_INT32 int /* 32bit integer */
497 # define SM_ALIGN_SIZE (sizeof(long))
498 # define GIDSET_T int
499 # define SM_CONF_SYSLOG 0
502 /* special tweaking for SunOS 4.0.3 */
504 # define BSD4_3 1 /* 4.3 BSD-based */
505 # define NEEDSTRSTR 1 /* need emulation of strstr(3) routine */
506 # define WAITUNION 1 /* use "union wait" as wait argument type */
510 # define setpgid setpgrp
513 extern char *getenv();
515 # else /* SUNOS403 */
516 /* 4.1.x specifics */
517 # define HASSETSID 1 /* has POSIX setsid(2) call */
518 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */
520 # endif /* SUNOS403 */
521 # endif /* SOLARIS */
524 # define LA_TYPE LA_INT
525 # endif /* ! LA_TYPE */
527 # endif /* defined(sun) && !defined(BSD) */
532 ** Tested on 5.4.2 and 5.4.3. Use DGUX_5_4_2 to get the
534 ** 5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
539 # endif /* DGUX_5_4_2 */
543 # define LA_TYPE LA_DGUX
544 # define HASSETREUID 1 /* has setreuid(2) call */
545 # define HASUNAME 1 /* use System V uname(2) system call */
546 # define HASSETSID 1 /* has POSIX setsid(2) call */
547 # define HASINITGROUPS 1 /* has initgroups(3) call */
548 # define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */
549 # define HASGETUSERSHELL 0 /* does not have getusershell(3) */
551 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
552 # endif /* ! IDENTPROTO */
553 # define SPT_TYPE SPT_NONE /* don't use setproctitle */
554 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
555 # define LDA_USE_LOCKF 1
557 /* these include files must be included early on DG/UX */
558 # include <netinet/in.h>
559 # include <arpa/inet.h>
561 /* compiler doesn't understand const? */
565 # define inet_addr dgux_inet_addr
566 extern long dgux_inet_addr();
567 # endif /* DGUX_5_4_2 */
572 ** Digital Ultrix 4.2 - 4.5
574 ** Apparently, fcntl locking is broken on 4.2A, in that locks are
575 ** not dropped when the process exits. This causes major problems,
576 ** so flock is the only alternative.
580 # define HASSETREUID 1 /* has setreuid(2) call */
581 # define HASUNSETENV 1 /* has unsetenv(3) call */
582 # define HASINITGROUPS 1 /* has initgroups(3) call */
583 # define HASUNAME 1 /* use System V uname(2) system call */
584 # define HASFCHMOD 1 /* has fchmod(2) syscall */
585 # define HASFCHOWN 1 /* has fchown(2) syscall */
587 # define HASFLOCK 1 /* has flock(2) call */
588 # endif /* ! HASFLOCK */
589 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
590 # ifndef BROKEN_RES_SEARCH
591 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */
592 # endif /* ! BROKEN_RES_SEARCH */
593 # if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621
594 # define NEEDLOCAL_HOSTNAME_LENGTH 1 /* see sendmail/README */
595 # endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */
597 # define LA_TYPE LA_FLOAT
599 # define LA_TYPE LA_INT
600 # define LA_AVENRUN "avenrun"
602 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
604 # define IDENTPROTO 0 /* pre-4.4 TCP/IP implementation is broken */
605 # endif /* ! IDENTPROTO */
606 # define SYSLOG_BUFSIZE 256
607 # define SM_CONF_SYSLOG 0
614 ** Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu>
618 # define __osf__ 1 /* get OSF/1 defines below */
620 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
621 # endif /* ! TZ_TYPE */
622 # endif /* __ksr__ */
626 ** OSF/1 for Intel Paragon.
628 ** Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
629 ** of Intel Scalable Systems Divison.
633 # define __osf__ 1 /* get OSF/1 defines below */
635 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
636 # endif /* ! TZ_TYPE */
637 # define GIDSET_T gid_t
638 # define MAXNAMLEN NAME_MAX
639 # endif /* __PARAGON__ */
643 ** Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1
645 ** Tested for 3.2 and 4.0.
649 # define HASUNAME 1 /* has uname(2) call */
650 # define HASUNSETENV 1 /* has unsetenv(3) call */
651 # define USESETEUID 1 /* has usable seteuid(2) call */
652 # define HASINITGROUPS 1 /* has initgroups(3) call */
653 # define HASFCHMOD 1 /* has fchmod(2) syscall */
654 # define HASFCHOWN 1 /* has fchown(2) syscall */
655 # define HASSETLOGIN 1 /* has setlogin(2) */
656 # define IP_SRCROUTE 1 /* can check IP source routing */
657 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */
658 # define GIDSET_T gid_t
659 # define SM_INT32 int /* 32bit integer */
661 # include <standards.h>
662 # if _XOPEN_SOURCE+0 >= 400
663 # define HASFLOCK 0 /* 5.0 and later has bad flock(2) call */
664 # else /* _XOPEN_SOURCE+0 >= 400 */
665 # define HASFLOCK 1 /* has flock(2) call */
666 # endif /* _XOPEN_SOURCE+0 >= 400 */
667 # endif /* ! HASFLOCK */
668 # define LA_TYPE LA_ALPHAOSF
669 # define SFS_TYPE SFS_STATVFS /* use <sys/statvfs.h> statfs() impl */
670 # ifndef _PATH_VENDOR_CF
671 # define _PATH_VENDOR_CF "/var/adm/sendmail/sendmail.cf"
672 # endif /* ! _PATH_VENDOR_CF */
673 # ifndef _PATH_SENDMAILPID
674 # define _PATH_SENDMAILPID "/var/run/sendmail.pid"
675 # endif /* ! _PATH_SENDMAILPID */
676 # if _FFR_DIGUNIX_SAFECHOWN
678 ** Testing on a Digital UNIX 4.0a system showed this to be the correct
679 ** setting but given the security consequences, more testing and
680 ** verification is needed. Unfortunately, the man page offers no
683 # define IS_SAFE_CHOWN >= 0
684 # endif /* _FFR_DIGUNIX_SAFECHOWN */
685 # endif /* __osf__ */
693 # define HASINITGROUPS 1 /* has initgroups(3) call */
694 # define NEEDPUTENV 2 /* need putenv(3) call; no setenv(3) call */
696 # define HASFLOCK 1 /* has flock(2) call */
697 # endif /* ! HASFLOCK */
698 # define UID_T int /* compiler gripes on uid_t */
699 # define GID_T int /* ditto for gid_t */
700 # define MODE_T int /* and mode_t */
701 # define setpgid setpgrp
702 # ifndef NOT_SENDMAIL
703 # define sleep sleepX
704 # endif /* ! NOT_SENDMAIL */
706 # define LA_TYPE LA_MACH
707 # endif /* ! LA_TYPE */
708 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
709 # ifdef _POSIX_SOURCE
710 extern struct passwd *getpwent();
711 # else /* _POSIX_SOURCE */
712 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
713 # define WAITUNION 1 /* use "union wait" as wait argument type */
719 # endif /* _POSIX_SOURCE */
720 # ifndef _PATH_VENDOR_CF
721 # define _PATH_VENDOR_CF "/etc/sendmail/sendmail.cf"
722 # endif /* ! _PATH_VENDOR_CF */
723 # ifndef _PATH_SENDMAILPID
724 # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid"
725 # endif /* ! _PATH_SENDMAILPID */
726 # define SM_INT32 int /* 32bit integer */
730 # define HASUNSETENV 1
731 # endif /* ! HASUNSETENV */
733 # endif /* TCPWRAPPERS */
737 # define S_IRUSR S_IREAD
738 # endif /* ! S_IRUSR */
740 # define S_IWUSR S_IWRITE
741 # endif /* ! S_IWUSR */
742 # define _PATH_MAILDIR "/usr/spool/mail"
743 # endif /* ! __APPLE__ */
745 # define isascii(c) ((unsigned)(c) <= 0177)
746 # endif /* ! isascii */
751 ** Contributed by Wilfredo Sanchez <wsanchez@mit.edu>
755 # define HASFCHMOD 1 /* has fchmod(2) */
756 # define HASFCHOWN 1 /* has fchown(2) */
757 # define HASFLOCK 1 /* has flock(2) */
758 # define HASUNAME 1 /* has uname(2) */
759 # define HASUNSETENV 1 /* has unsetenv(3) */
760 # define HASSETSID 1 /* has POSIX setsid(2) call */
761 # define HASINITGROUPS 1 /* has initgroups(3) */
762 # define HASSETVBUF 1 /* has setvbuf (3) */
763 # define HASSETREUID 0 /* setreuid(2) unusable */
764 # define HASSETEUID 1 /* has seteuid(2) */
765 # define USESETEUID 1 /* has seteuid(2) */
766 # define HASSETEGID 1 /* has setegid(2) */
767 # define HASSETREGID 1 /* has setregid(2) */
768 # define HASSETRESGID 0 /* no setresgid(2) */
769 # define HASLSTAT 1 /* has lstat(2) */
770 # define HASSETRLIMIT 1 /* has setrlimit(2) */
771 # define HASWAITPID 1 /* has waitpid(2) */
772 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) */
773 # define HAS_ST_GEN 1 /* has st_gen field in struct stat */
774 # define HASURANDOMDEV 1 /* has urandom(4) */
775 # define HASSTRERROR 1 /* has strerror(3) */
776 # define HASGETUSERSHELL 1 /* had getusershell(3) */
777 # define GIDSET_T gid_t /* getgroups(2) takes gid_t */
778 # define LA_TYPE LA_SUBR /* use getloadavg(3) */
779 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
781 # define SOCKADDR_LEN_T socklen_t
784 # define SPT_TYPE SPT_REUSEARGV
785 # define SPT_PADCHAR '\0'
786 # define SOCKOPT_LEN_T socklen_t
788 # define SPT_TYPE SPT_PSSTRINGS /* use magic PS_STRINGS pointer for setproctitle */
790 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
791 # define BSD4_4_SOCKADDR /* struct sockaddr has sa_len */
792 # define SAFENFSPATHCONF 0 /* unverified: pathconf(2) doesn't work on NFS */
794 # define NETLINK 1 /* supports AF_LINK */
795 # ifndef NOT_SENDMAIL
796 # define sleep sleepX
797 extern unsigned int sleepX __P((unsigned int seconds));
798 # endif /* ! NOT_SENDMAIL */
799 # endif /* defined(DARWIN) */
805 ** See also BSD defines.
808 # if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN)
810 # define HASUNSETENV 1 /* has unsetenv(3) call */
811 # define USESETEUID 1 /* has usable seteuid(2) call */
812 # define HASFCHMOD 1 /* has fchmod(2) syscall */
813 # define HASFCHOWN 1 /* has fchown(2) syscall */
814 # define HASSTRERROR 1 /* has strerror(3) */
815 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */
816 # include <sys/cdefs.h>
817 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
818 # define BSD4_4_SOCKADDR /* has sa_len */
819 # define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */
820 # define NETLINK 1 /* supports AF_LINK */
822 # define LA_TYPE LA_SUBR
823 # endif /* ! LA_TYPE */
824 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
825 # define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */
826 # endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN)*/
830 ** BSD/OS (was BSD/386) (all versions)
831 ** From Tony Sanders, BSDI
836 # define HASUNSETENV 1 /* has the unsetenv(3) call */
837 # define HASSETREUID 0 /* BSD-OS has broken setreuid(2) emulation */
838 # define HASSETSID 1 /* has POSIX setsid(2) call */
839 # define USESETEUID 1 /* has usable seteuid(2) call */
840 # define HASFCHMOD 1 /* has fchmod(2) syscall */
841 # define HASSETLOGIN 1 /* has setlogin(2) */
842 # define HASUNAME 1 /* has uname(2) syscall */
843 # define HASSTRERROR 1 /* has strerror(3) */
844 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */
845 # include <sys/cdefs.h>
846 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
847 # define BSD4_4_SOCKADDR /* has sa_len */
848 # define NETLINK 1 /* supports AF_LINK */
849 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
851 # define LA_TYPE LA_SUBR
852 # endif /* ! LA_TYPE */
853 # define GIDSET_T gid_t
854 # define QUAD_T quad_t
855 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
856 /* version 1.1 or later */
858 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
859 # else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
860 /* version 1.0 or earlier */
861 # define SPT_PADCHAR '\0' /* pad process title with nulls */
862 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */
863 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 /* on 3.x */
864 # define HASSETUSERCONTEXT 1 /* has setusercontext */
865 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */
866 # if defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 /* 3.1 and earlier */
867 # define MODE_T int /* va_arg() can't handle less than int */
868 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 */
869 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 /* on 4.x */
870 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */
871 # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 */
872 # endif /* __bsdi__ */
875 # if defined(__QNX__)
876 # if defined(__QNXNTO__)
879 # define HASUNSETENV 1 /* has unsetenv(3) call */
880 # define HASINITGROUPS 1 /* has initgroups(3) call */
881 # define HASSETSID 1 /* has POSIX setsid(2) call */
882 # define USESETEUID 1 /* has usable seteuid(2) call */
883 # define HASFCHMOD 1 /* has fchmod(2) syscall */
884 # define HASFCHOWN 1 /* has fchown(2) syscall */
885 # define HASUNAME 1 /* has uname(2) syscall */
886 # define HASSTRERROR 1 /* has strerror(3) */
887 # define BSD4_4_SOCKADDR /* has sa_len */
888 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
889 # define NETLINK 1 /* supports AF_LINK */
890 # define GIDSET_T gid_t
891 # define QUAD_T uint64_t
892 # define HASSNPRINTF 1 /* has snprintf(3) (all versions?) */
893 # define HASGETUSERSHELL 0
896 ** We have a strrev() that doesn't allocate anything.
897 ** Make sure the one here is used.
900 # define strrev strrev_sendmail
902 # else /* defined(__QNXNTO__) */
906 ** Contributed by Glen McCready <glen@qnx.com>.
908 ** Should work with all versions of QNX 4.
912 # include <sys/select.h>
914 # define HASSETSID 1 /* has POSIX setsid(2) call */
915 # define USESETEUID 1 /* has usable seteuid(2) call */
916 # define HASFCHMOD 1 /* has fchmod(2) syscall */
917 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
918 # define HASSETREUID 1 /* has setreuid(2) call */
919 # define HASSTRERROR 1 /* has strerror(3) */
921 # undef HASINITGROUPS /* has initgroups(3) call */
922 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
923 # define IP_SRCROUTE 1 /* can check IP source routing */
924 # define TZ_TYPE TZ_TMNAME /* use tmname variable */
925 # define GIDSET_T gid_t
926 # define LA_TYPE LA_ZERO
927 # define SFS_TYPE SFS_NONE
928 # define SPT_TYPE SPT_REUSEARGV
929 # define SPT_PADCHAR '\0' /* pad process title with nulls */
930 # define HASGETUSERSHELL 0
931 # define _FILE_H_INCLUDED
932 # endif /* defined(__QNXNTO__) */
933 # endif /* defined(__QNX__) */
937 ** DragonFly BSD/ FreeBSD / NetBSD / OpenBSD (all architectures, all versions)
939 ** 4.3BSD clone, closer to 4.4BSD for FreeBSD 1.x and NetBSD 0.9x
940 ** 4.4BSD-Lite based for FreeBSD 2.x and NetBSD 1.x
942 ** See also BSD defines.
945 # if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
947 # define HASUNSETENV 1 /* has unsetenv(3) call */
948 # define HASSETSID 1 /* has POSIX setsid(2) call */
949 # define USESETEUID 1 /* has usable seteuid(2) call */
950 # define HASFCHMOD 1 /* has fchmod(2) syscall */
951 # define HASFCHOWN 1 /* has fchown(2) syscall */
952 # define HASUNAME 1 /* has uname(2) syscall */
953 # define HASSTRERROR 1 /* has strerror(3) */
954 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */
955 # define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */
956 # include <sys/cdefs.h>
957 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
958 # define BSD4_4_SOCKADDR /* has sa_len */
959 # define NETLINK 1 /* supports AF_LINK */
960 # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */
961 # define GIDSET_T gid_t
962 # define QUAD_T unsigned long long
963 # define HASSNPRINTF 1 /* has snprintf(3) (all versions?) */
965 # define LA_TYPE LA_SUBR
966 # endif /* ! LA_TYPE */
967 # if defined(__NetBSD__) && defined(__NetBSD_Version__) && \
968 ((__NetBSD_Version__ >= 200040000 && __NetBSD_Version__ < 200090000) || \
969 (__NetBSD_Version__ >= 299000900))
971 # define SFS_TYPE SFS_STATVFS
973 # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */
975 # if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1)
977 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
978 # endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */
979 # if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3))
980 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */
981 # endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */
982 # if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104170000
983 # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
985 # if defined(__NetBSD__) && defined(__NetBSD_Version__) && \
986 ((__NetBSD_Version__ >= 200060000 && __NetBSD_Version__ < 200090000) || \
987 (__NetBSD_Version__ >= 299000900))
988 # define HASCLOSEFROM 1 /* closefrom(3) added in 2.0F */
990 # if defined(__NetBSD__)
991 # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */
992 # include <sys/param.h>
993 # include <sys/sysctl.h>
995 # if defined(__DragonFly__)
996 # define HASSETLOGIN 1 /* has setlogin(2) */
997 # define HASSRANDOMDEV 1 /* has srandomdev(3) */
998 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */
1000 # include <libutil.h>
1001 # define SPT_TYPE SPT_BUILTIN
1002 # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
1003 # ifndef SMRSH_CMDDIR
1004 # define SMRSH_CMDDIR "/usr/libexec/sm.bin"
1005 # endif /* ! SMRSH_CMDDIR */
1007 # define SMRSH_PATH "/bin:/usr/bin"
1008 # endif /* ! SMRSH_PATH */
1009 # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */
1010 # include <sys/sysctl.h>
1011 # endif /* defined(__DragonFly__) */
1012 # if defined(__FreeBSD__)
1013 # define HASSETLOGIN 1 /* has setlogin(2) */
1014 # if __FreeBSD_version >= 227001
1015 # define HASSRANDOMDEV 1 /* has srandomdev(3) */
1016 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */
1017 # endif /* __FreeBSD_version >= 227001 */
1019 # if __FreeBSD__ >= 2
1020 # include <osreldate.h>
1021 # if __FreeBSD_version >= 199512 /* 2.2-current when it appeared */
1022 # include <libutil.h>
1023 # define SPT_TYPE SPT_BUILTIN
1024 # endif /* __FreeBSD_version >= 199512 */
1025 # if __FreeBSD_version >= 222000 /* 2.2.2-release and later */
1026 # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
1027 # endif /* __FreeBSD_version >= 222000 */
1028 # if __FreeBSD_version >= 300000 /* 3.0.0-release and later */
1029 # define HAVE_NANOSLEEP 1 /* has nanosleep(2) */
1030 # endif /* __FreeBSD_version >= 300000 */
1031 # if __FreeBSD_version >= 330000 /* 3.3.0-release and later */
1032 # ifndef SMRSH_CMDDIR
1033 # define SMRSH_CMDDIR "/usr/libexec/sm.bin"
1034 # endif /* ! SMRSH_CMDDIR */
1036 # define SMRSH_PATH "/bin:/usr/bin"
1037 # endif /* ! SMRSH_PATH */
1038 # endif /* __FreeBSD_version >= 330000 */
1039 # if __FreeBSD_version >= 430000 /* 4.3.0-release and later */
1040 # define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */
1041 # define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */
1042 # endif /* __FreeBSD_version >= 430000 */
1043 # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */
1044 # include <sys/sysctl.h>
1045 # endif /* __FreeBSD__ >= 2 */
1047 # define SPT_TYPE SPT_REUSEARGV
1048 # define SPT_PADCHAR '\0' /* pad process title with nulls */
1049 # endif /* ! SPT_TYPE */
1050 # endif /* defined(__FreeBSD__) */
1051 # if defined(__OpenBSD__)
1053 # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */
1054 # define HASSETLOGIN 1 /* has setlogin(2) */
1055 # if OpenBSD < 200305
1056 # define HASSETREUID 0 /* setreuid(2) broken in OpenBSD < 3.3 */
1057 # endif /* OpenBSD < 200305 */
1058 # define HASSETEGID 1 /* use setegid(2) to set saved gid */
1059 # define HASURANDOMDEV 1 /* has /dev/urandom(4) */
1060 # if OpenBSD >= 200006
1061 # define HASSRANDOMDEV 1 /* has srandomdev(3) */
1062 # endif /* OpenBSD >= 200006 */
1063 # if OpenBSD >= 200012
1064 # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */
1065 # endif /* OpenBSD >= 200012 */
1066 # if OpenBSD >= 200405
1067 # define HASCLOSEFROM 1 /* closefrom(3) added in 3.5 */
1068 # endif /* OpenBSD >= 200405 */
1069 # if OpenBSD >= 200505
1070 # undef NETISO /* iso.h removed in 3.7 */
1071 # endif /* OpenBSD >= 200505 */
1072 # if OpenBSD >= 200800
1073 # define HAVE_NANOSLEEP 1 /* has nanosleep(2) */
1074 # endif /* OpenBSD >= 200800 */
1075 # endif /* defined(__OpenBSD__) */
1076 # endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */
1082 ** For mt Xinu's Mach386 system.
1085 # if defined(MACH) && defined(i386) && !defined(__GNU__)
1087 # define HASUNSETENV 1 /* has unsetenv(3) call */
1088 # define HASINITGROUPS 1 /* has initgroups(3) call */
1090 # define HASFLOCK 1 /* has flock(2) call */
1091 # endif /* ! HASFLOCK */
1092 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
1093 # define NEEDSTRTOL 1 /* need the strtol() function */
1094 # define setpgid setpgrp
1096 # define LA_TYPE LA_FLOAT
1097 # endif /* ! LA_TYPE */
1098 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1099 # undef HASSETVBUF /* don't actually have setvbuf(3) */
1102 # ifndef _PATH_VENDOR_CF
1103 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1104 # endif /* ! _PATH_VENDOR_CF */
1105 # ifndef _PATH_SENDMAILPID
1106 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1107 # endif /* ! _PATH_SENDMAILPID */
1108 # endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */
1114 ** Largely BSD & posix compatible.
1115 ** Port contributed by Miles Bader <miles@gnu.ai.mit.edu>.
1116 ** Updated by Mark Kettenis <kettenis@wins.uva.nl>.
1119 # if defined(__GNU__) && !defined(NeXT)
1121 # define HASFCHMOD 1 /* has fchmod(2) call */
1122 # define HASFCHOWN 1 /* has fchown(2) call */
1123 # define HASUNAME 1 /* has uname(2) call */
1124 # define HASUNSETENV 1 /* has unsetenv(3) call */
1125 # define HAS_ST_GEN 1 /* has st_gen field in stat struct */
1126 # define HASSTRERROR 1 /* has strerror(3) */
1127 # define GIDSET_T gid_t
1128 # define SOCKADDR_LEN_T socklen_t
1129 # define SOCKOPT_LEN_T socklen_t
1130 # if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2
1131 # define LA_TYPE LA_SUBR
1132 # else /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
1133 # define LA_TYPE LA_MACH
1134 /* GNU uses mach[34], which renames some rpcs from mach2.x. */
1135 # define host_self mach_host_self
1136 # endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */
1137 # define SFS_TYPE SFS_STATFS
1138 # define SPT_TYPE SPT_CHANGEARGV
1139 # define ERRLIST_PREDEFINED 1 /* don't declare sys_errlist */
1140 # define BSD4_4_SOCKADDR 1 /* has sa_len */
1141 # define SIOCGIFCONF_IS_BROKEN 1 /* SIOCGFCONF doesn't work */
1142 # define HAS_IN_H 1 /* GNU has netinet/in.h. */
1143 /* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */
1144 # define MAXPATHLEN 2048
1145 # endif /* defined(__GNU__) && !defined(NeXT) */
1148 ** 4.3 BSD -- this is for very old systems
1150 ** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
1152 ** You'll also have to install a new resolver library.
1153 ** I don't guarantee that support for this environment is complete.
1156 # if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
1157 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
1158 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
1159 # define ARBPTR_T char *
1160 # define setpgid setpgrp
1162 # define LA_TYPE LA_FLOAT
1163 # endif /* ! LA_TYPE */
1164 # ifndef _PATH_VENDOR_CF
1165 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1166 # endif /* ! _PATH_VENDOR_CF */
1168 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
1169 # endif /* ! IDENTPROTO */
1172 typedef short pid_t;
1173 # endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */
1179 ** This includes three parts:
1181 ** The first is for SCO OpenServer 5.
1182 ** (Contributed by Keith Reynolds <keithr@sco.COM>).
1184 ** SCO OpenServer 5 has a compiler version number macro,
1185 ** which we can use to figure out what version we're on.
1186 ** This may have to change in future releases.
1188 ** The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0.
1189 ** (Contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
1191 ** The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier.
1194 /* SCO OpenServer 5 */
1197 # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM returns bogus value */
1198 # define HASFCHMOD 1 /* has fchmod(2) call */
1199 # define HASFCHOWN 1 /* has fchown(2) call */
1200 # define HASSETRLIMIT 1 /* has setrlimit(2) call */
1201 # define USESETEUID 1 /* has seteuid(2) call */
1202 # define HASINITGROUPS 1 /* has initgroups(3) call */
1203 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
1204 # define RLIMIT_NEEDS_SYS_TIME_H 1
1205 # define LDA_USE_LOCKF 1
1207 # define LA_TYPE LA_DEVSHORT
1208 # endif /* ! LA_TYPE */
1209 # define _PATH_AVENRUN "/dev/table/avenrun"
1210 # ifndef _SCO_unix_4_2
1211 # define _SCO_unix_4_2
1212 # else /* ! _SCO_unix_4_2 */
1213 # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */
1214 # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */
1215 # endif /* ! _SCO_unix_4_2 */
1216 # endif /* _SCO_DS >= 1 */
1218 /* SCO UNIX 3.2v4.2/Open Desktop 3.0 */
1219 # ifdef _SCO_unix_4_2
1221 # define HASSETREUID 1 /* has setreuid(2) call */
1222 # endif /* _SCO_unix_4_2 */
1224 /* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */
1226 # include <sys/stream.h> /* needed for IP_SRCROUTE */
1227 # define SYSTEM5 1 /* include all the System V defines */
1228 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1229 # define NOFTRUNCATE 0 /* has (simulated) ftruncate call */
1230 # ifndef USE_SIGLONGJMP
1231 # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
1232 # endif /* ! USE_SIGLONGJMP */
1233 # define MAXPATHLEN PATHSIZE
1234 # define SFS_TYPE SFS_4ARGS /* use <sys/statfs.h> 4-arg impl */
1235 # define SFS_BAVAIL f_bfree /* alternate field name */
1236 # define SPT_TYPE SPT_SCO /* write kernel u. area */
1237 # define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */
1238 # define UID_T uid_t
1239 # define GID_T gid_t
1240 # define GIDSET_T gid_t
1241 # define _PATH_UNIX "/unix"
1242 # ifndef _PATH_VENDOR_CF
1243 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1244 # endif /* ! _PATH_VENDOR_CF */
1245 # ifndef _PATH_SENDMAILPID
1246 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1247 # endif /* ! _PATH_SENDMAILPID */
1249 /* stuff fixed in later releases */
1250 # ifndef _SCO_unix_4_2
1251 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1252 # endif /* ! _SCO_unix_4_2 */
1255 # define ftruncate chsize /* use chsize(2) to emulate ftruncate */
1256 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */
1257 # define NETUNIX 0 /* no unix domain socket support */
1258 # define LA_TYPE LA_SHORT
1259 # endif /* ! _SCO_DS */
1261 # endif /* _SCO_unix_ */
1264 ** ISC (SunSoft) Unix.
1266 ** Contributed by J.J. Bailey <jjb@jagware.bcc.com>
1270 # include <net/errno.h>
1271 # include <sys/stream.h> /* needed for IP_SRCROUTE */
1272 # include <sys/bsdtypes.h>
1273 # define SYSTEM5 1 /* include all the System V defines */
1274 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1275 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1276 # define HASSETREUID 1 /* has setreuid(2) call */
1277 # define NEEDFSYNC 1 /* needs the fsync(2) call stub */
1278 # define NETUNIX 0 /* no unix domain socket support */
1279 # define MAXPATHLEN 1024
1280 # define LA_TYPE LA_SHORT
1281 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
1282 # define SFS_BAVAIL f_bfree /* alternate field name */
1283 # define _PATH_UNIX "/unix"
1284 # ifndef _PATH_VENDOR_CF
1285 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1286 # endif /* ! _PATH_VENDOR_CF */
1287 # ifndef _PATH_SENDMAILPID
1288 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1289 # endif /* ! _PATH_SENDMAILPID */
1290 # endif /* ISC_UNIX */
1294 ** Altos System V (5.3.1)
1295 ** Contributed by Tim Rice <tim@trr.metro.net>.
1298 # ifdef ALTOS_SYSTEM_V
1299 # include <sys/stream.h>
1300 # include <limits.h>
1301 # define SYSTEM5 1 /* include all the System V defines */
1302 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1303 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1304 # define WAITUNION 1 /* use "union wait" as wait argument type */
1305 # define NEEDFSYNC 1 /* no fsync(2) in system library */
1306 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */
1307 # define NOFTRUNCATE 1 /* do not have ftruncate(2) */
1308 # define MAXPATHLEN PATH_MAX
1309 # define LA_TYPE LA_SHORT
1310 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
1311 # define SFS_BAVAIL f_bfree /* alternate field name */
1312 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
1313 # define NETUNIX 0 /* no unix domain socket support */
1316 # define strtoul strtol /* gcc library bogosity */
1318 typedef unsigned short uid_t;
1319 typedef unsigned short gid_t;
1320 typedef short pid_t;
1321 typedef unsigned long mode_t;
1323 /* some stuff that should have been in the include files */
1324 extern char *malloc();
1325 extern struct passwd *getpwent();
1326 extern struct passwd *getpwnam();
1327 extern struct passwd *getpwuid();
1328 extern char *getenv();
1329 extern struct group *getgrgid();
1330 extern struct group *getgrnam();
1332 # endif /* ALTOS_SYSTEM_V */
1336 ** ConvexOS 11.0 and later
1338 ** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
1339 ** works on 9.1 as well.
1341 ** ConvexOS 11.5 and later, should work on 11.0 as defined.
1342 ** For pre-ConvexOOS 11.0, define SM_CONF_GETOPT=0, undef IDENTPROTO
1344 ** Eric Schnoebelen (eric@cirr.com) For CONVEX Computer Corp.
1345 ** (now the CONVEX Technologies Center of Hewlett Packard)
1348 # ifdef _CONVEX_SOURCE
1349 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) */
1350 # define HASINITGROUPS 1 /* has initgroups(3) */
1351 # define HASUNAME 1 /* use System V uname(2) system call */
1352 # define HASSETSID 1 /* has POSIX setsid(2) call */
1353 # define HASUNSETENV 1 /* has unsetenv(3) */
1354 # define HASFLOCK 1 /* has flock(2) */
1355 # define HASSETRLIMIT 1 /* has setrlimit(2) */
1356 # define HASSETREUID 1 /* has setreuid(2) */
1357 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_error=0 */
1358 # define NEEDPUTENV 1 /* needs putenv (written in terms of setenv) */
1359 # define SM_CONF_GETOPT 1 /* need a replacement for getopt(3) */
1360 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */
1361 # define LA_TYPE LA_FLOAT
1362 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1363 # ifndef _PATH_VENDOR_CF
1364 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1365 # endif /* ! _PATH_VENDOR_CF */
1367 # define S_IREAD _S_IREAD
1368 # define S_IWRITE _S_IWRITE
1369 # define S_IEXEC _S_IEXEC
1370 # define S_IFMT _S_IFMT
1371 # define S_IFCHR _S_IFCHR
1372 # define S_IFBLK _S_IFBLK
1373 # endif /* ! S_IREAD */
1375 # define TZ_TYPE TZ_TIMEZONE
1376 # endif /* ! TZ_TYPE */
1378 # define IDENTPROTO 1
1379 # endif /* ! IDENTPROTO */
1381 # define SHARE_V1 1 /* version 1 of the fair share scheduler */
1382 # endif /* ! SHARE_V1 */
1383 # if !defined(__GNUC__ )
1384 # define UID_T int /* GNUC gets it right, ConvexC botches */
1385 # define GID_T int /* GNUC gets it right, ConvexC botches */
1386 # endif /* !defined(__GNUC__ ) */
1388 # define FORK fork /* SecureWare wants the real fork! */
1389 # else /* SECUREWARE */
1390 # define FORK vfork /* the rest of the OS versions don't care */
1391 # endif /* SECUREWARE */
1392 # endif /* _CONVEX_SOURCE */
1398 ** Gives a ton of warning messages, but otherwise compiles.
1403 # define HASUNSETENV 1 /* has unsetenv(3) call */
1405 # define HASFLOCK 1 /* has flock(2) call */
1406 # endif /* ! HASFLOCK */
1407 # define WAITUNION 1 /* use "union wait" as wait argument type */
1408 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
1409 # define NEEDPUTENV 1 /* need putenv(3) call */
1410 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */
1411 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1412 # define LA_TYPE LA_INT
1413 # define LA_AVENRUN "avenrun"
1414 # define _PATH_UNIX "/unix"
1417 # define setpgid setpgrp
1420 # define SIGFUNC_DEFINED
1421 # define SIGFUNC_RETURN (0)
1422 # define SIGFUNC_DECL int
1423 typedef int (*sigfunc_t)();
1424 extern char *getenv();
1425 extern void *malloc();
1427 /* added for RISC/os 4.01...which is dumber than 4.50 */
1430 # define ARBPTR_T char *
1431 # endif /* ! ARBPTR_T */
1434 # endif /* RISCOS_4_0 */
1436 # include <sys/time.h>
1438 # endif /* RISCOS */
1442 ** Linux 0.99pl10 and above...
1444 ** Thanks to, in reverse order of contact:
1446 ** John Kennedy <warlock@csuchico.edu>
1447 ** Andrew Pam <avatar@aus.xanadu.com>
1448 ** Florian La Roche <rzsfl@rz.uni-sb.de>
1449 ** Karl London <karl@borg.demon.co.uk>
1451 ** NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style
1452 ** file locking is no longer allowed. In particular, make sure
1453 ** your DBM library and sendmail are both using either flock(2)
1454 ** *or* fcntl(2) file locking, but not both.
1458 # include <linux/version.h>
1459 # if !defined(KERNEL_VERSION) /* not defined in 2.0.x kernel series */
1460 # define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
1461 # endif /* !defined(KERNEL_VERSION) */
1462 # define BSD 1 /* include BSD defines */
1463 # define HASSETREGID 1 /* use setregid(2) to set saved gid */
1464 # ifndef REQUIRES_DIR_FSYNC
1465 # define REQUIRES_DIR_FSYNC 1 /* requires fsync() on directory */
1466 # endif /* REQUIRES_DIR_FSYNC */
1468 # define USESETEUID 0 /* has it due to POSIX, but doesn't work */
1469 # endif /* USESETEUID */
1470 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
1471 # define HASUNAME 1 /* use System V uname(2) system call */
1472 # define HASUNSETENV 1 /* has unsetenv(3) call */
1473 # define ERRLIST_PREDEFINED /* don't declare sys_errlist */
1474 # define GIDSET_T gid_t /* from <linux/types.h> */
1475 # ifndef HASGETUSERSHELL
1476 # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */
1477 # endif /* HASGETUSERSHELL */
1478 # ifndef IP_SRCROUTE
1479 # define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */
1480 # endif /* ! IP_SRCROUTE */
1482 # define HAS_IN_H 1 /* use netinet/in.h */
1483 # endif /* ! HAS_IN_H */
1484 # ifndef USE_SIGLONGJMP
1485 # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
1486 # endif /* ! USE_SIGLONGJMP */
1488 # if LINUX_VERSION_CODE < 66399
1489 # define HASFLOCK 0 /* flock(2) is broken after 0.99.13 */
1490 # else /* LINUX_VERSION_CODE < 66399 */
1491 # if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0))
1492 # define HASFLOCK 1 /* flock(2) fixed after 1.3.95 */
1493 # else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
1494 # define HASFLOCK 0 /* flock(2) is broken (again) after 2.4.0 */
1495 # endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */
1496 # endif /* LINUX_VERSION_CODE < 66399 */
1497 # endif /* ! HASFLOCK */
1499 # define LA_TYPE LA_PROCSTR
1500 # endif /* ! LA_TYPE */
1501 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */
1502 # define SPT_PADCHAR '\0' /* pad process title with nulls */
1503 # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0))
1504 # ifndef HASURANDOMDEV
1505 # define HASURANDOMDEV 1 /* 2.0 (at least) has linux/drivers/char/random.c */
1506 # endif /* ! HASURANDOMDEV */
1507 # endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) */
1508 # if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1509 # define HASSTRERROR 1 /* has strerror(3) */
1510 # endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
1512 # define TZ_TYPE TZ_NONE /* no standard for Linux */
1513 # endif /* ! TZ_TYPE */
1514 # if (__GLIBC__ >= 2)
1516 # endif /* (__GLIBC__ >= 2) */
1517 # ifndef _PATH_SENDMAILPID
1518 # define _PATH_SENDMAILPID "/var/run/sendmail.pid"
1519 # endif /* ! _PATH_SENDMAILPID */
1520 # include <sys/sysmacros.h>
1521 # undef atol /* wounded in <stdlib.h> */
1524 ** Linux doesn't have a good way to tell userland what interfaces are
1525 ** IPv6-capable. Therefore, the BIND resolver can not determine if there
1526 ** are IPv6 interfaces to honor AI_ADDRCONFIG. Unfortunately, it assumes
1527 ** that none are present. (Excuse the macro name ADDRCONFIG_IS_BROKEN.)
1529 # define ADDRCONFIG_IS_BROKEN 1
1532 ** Indirectly included from glibc's <feature.h>. IPv6 support is native
1533 ** in 2.1 and later, but the APIs appear before the functions.
1535 # if defined(__GLIBC__) && defined(__GLIBC_MINOR__)
1536 # define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__)
1537 # if (GLIBC_VERSION >= 0x201)
1538 # define SOCKADDR_LEN_T socklen_t
1539 # define SOCKOPT_LEN_T socklen_t
1540 # undef IPPROTO_ICMPV6 /* linux #defines, glibc enums */
1541 # else /* (GLIBC_VERSION >= 0x201) */
1542 # include <linux/in6.h> /* IPv6 support */
1543 # endif /* (GLIBC_VERSION >= 0x201) */
1544 # if (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE))
1545 /* Have APIs in <netdb.h>, but no support in glibc */
1546 # define NEEDSGETIPNODE 1
1547 # endif /* (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) */
1548 # undef GLIBC_VERSION
1549 # endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */
1550 # endif /* NETINET6 */
1552 # define HASFCHOWN 1 /* fchown(2) */
1553 # endif /* ! HASFCHOWN */
1554 # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD)
1555 # define HASFCHMOD 1 /* fchmod(2) */
1556 # endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) */
1557 # endif /* __linux__ */
1561 ** DELL SVR4 Issue 2.2, and others
1562 ** From Kimmo Suominen <kim@grendel.lut.fi>
1564 ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
1565 ** defined, and the definitions conflict.
1567 ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
1568 ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
1569 ** (SVR4.0/386 version 3.0).
1573 /* no changes necessary */
1574 /* see general __svr4__ defines below */
1575 # endif /* DELL_SVR4 */
1583 # include <sys/sysmacros.h>
1584 # define BSD /* has BSD routines */
1585 # define HASSETRLIMIT 0 /* ... but not setrlimit(2) */
1586 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */
1587 # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */
1588 # define HASUNAME 1 /* use System V uname(2) system call */
1589 # define HASFCHMOD 1 /* has fchmod(2) syscall */
1590 # define HASINITGROUPS 1 /* has initgroups(3) call */
1591 # define HASSETVBUF 1 /* has setvbuf(3) in libc */
1592 # define HASSTRERROR 1 /* has strerror(3) */
1593 # define SIGFUNC_DEFINED /* sigfunc_t already defined */
1594 # define SIGFUNC_RETURN /* POSIX-mode */
1595 # define SIGFUNC_DECL void /* POSIX-mode */
1596 # define ERRLIST_PREDEFINED 1
1598 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
1599 # endif /* ! IDENTPROTO */
1601 # define LA_TYPE LA_INT
1603 # endif /* ! LA_TYPE */
1604 # define LA_AVENRUN "avenrun"
1605 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1606 # define TZ_TYPE TZ_TZNAME
1608 # define _PATH_UNIX "/unix" /* should be in <paths.h> */
1609 # endif /* ! _PATH_UNIX */
1610 # ifndef _PATH_VENDOR_CF
1611 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1612 # endif /* ! _PATH_VENDOR_CF */
1615 # endif /* _AUX_SOURCE */
1621 ** Not extensively tested.
1625 # define HASUNAME 1 /* use System V uname(2) system call */
1626 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */
1627 # define HASINITGROUPS 1 /* has initgroups(3) call */
1628 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1629 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1630 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
1631 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
1632 # define MAXPATHLEN PATH_MAX
1633 extern struct passwd *getpwent(), *getpwnam(), *getpwuid();
1634 extern struct group *getgrent(), *getgrnam(), *getgrgid();
1641 ** Stardent Titan 3000 running TitanOS 4.2.
1643 ** Must be compiled in "cc -43" mode.
1645 ** From Kate Hedstrom <kate@ahab.rutgers.edu>.
1647 ** Note the tweaking below after the BSD defines are set.
1651 # define setpgid setpgrp
1659 ** Sequent DYNIX 3.2.0
1661 ** From Jim Davis <jdavis@cs.arizona.edu>.
1667 # define HASUNSETENV 1
1668 # define BSD4_3 1 /* to get signal() in conf.c */
1669 # define WAITUNION 1
1670 # define LA_TYPE LA_FLOAT
1671 # ifdef _POSIX_VERSION
1672 # undef _POSIX_VERSION /* set in <unistd.h> */
1673 # endif /* _POSIX_VERSION */
1674 # undef HASSETVBUF /* don't actually have setvbuf(3) */
1675 # define setpgid setpgrp
1677 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
1679 # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \
1680 ((union wait*)&(s))->w_termsig == 0)
1681 # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode)
1683 # define isgraph(c) (isprint(c) && (c != ' '))
1686 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
1687 # endif /* ! IDENTPROTO */
1690 # define _PATH_UNIX "/dynix"
1691 # endif /* ! _PATH_UNIX */
1692 # ifndef _PATH_VENDOR_CF
1693 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1694 # endif /* ! _PATH_VENDOR_CF */
1695 # endif /* sequent */
1699 ** Sequent DYNIX/ptx v2.0 (and higher)
1701 ** For DYNIX/ptx v1.x, undefine HASSETREUID.
1703 ** From Tim Wright <timw@sequent.com>.
1704 ** Update from Jack Woolley <jwoolley@sctcorp.com>, 26 Dec 1995,
1705 ** for DYNIX/ptx 4.0.2.
1709 # include <sys/stream.h>
1710 # define SYSTEM5 1 /* include all the System V defines */
1711 # define HASSETSID 1 /* has POSIX setsid(2) call */
1712 # define HASINITGROUPS 1 /* has initgroups(3) call */
1713 # define HASSETREUID 1 /* has setreuid(2) call */
1714 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1715 # define GIDSET_T gid_t
1716 # define LA_TYPE LA_INT
1717 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */
1718 # define SPT_TYPE SPT_NONE /* don't use setproctitle */
1720 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
1721 # endif /* ! IDENTPROTO */
1722 # ifndef _PATH_VENDOR_CF
1723 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1724 # endif /* ! _PATH_VENDOR_CF */
1725 # ifndef _PATH_SENDMAILPID
1726 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1727 # endif /* ! _PATH_SENDMAILPID */
1728 # endif /* _SEQUENT_ */
1731 ** Cray UNICOS, UNICOS/mk, and UNICOS/mp
1734 ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
1735 ** Update Brian Ginsbach <ginsbach@cray.com>
1736 ** UNICOS/mk (Cray T3E):
1737 ** Contributed by Manu Mahonen <mailadm@csc.fi>
1738 ** of Center for Scientific Computing.
1739 ** Update Brian Ginsbach <ginsbach@cray.com>
1741 ** From Aaron Davis <awd@cray.com> & Brian Ginsbach <ginsbach@cray.com>
1744 # if defined(_CRAY) || defined(UNICOS) || defined(_UNICOSMP)
1745 # define SYSTEM5 1 /* include all the System V defines */
1746 # define HASFCHMOD 1 /* has fchmod(2) syscall */
1747 # define HASFCHOWN 1 /* has fchown(2) */
1748 # define HASUNSETENV 1 /* has unsetenv(3) call */
1749 # define HASINITGROUPS 1 /* has initgroups(3) call */
1750 # define HASSETREUID 1 /* has setreuid(2) call */
1751 # define USESETEUID 1 /* has usable seteuid(2) call */
1752 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */
1753 # define HASSTRERROR 1 /* has strerror(3) */
1754 # define GIDSET_T gid_t
1755 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
1756 # define SFS_BAVAIL f_bfree /* alternate field name */
1757 # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */
1759 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
1760 # define LA_TYPE LA_ZERO
1761 # define _PATH_MAILDIR "/usr/spool/mail"
1762 # define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst)
1764 # define MAXPATHLEN PATHSIZE
1765 # endif /* ! MAXPATHLEN */
1768 # define _PATH_UNIX "/unicosmk.ar"
1770 # define _PATH_UNIX "/unicos"
1771 # endif /* UNICOSMK */
1772 # endif /* ! _PATH_UNIX */
1773 # ifndef _PATH_VENDOR_CF
1774 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1775 # endif /* ! _PATH_VENDOR_CF */
1776 # endif /* UNICOS */
1778 # if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN)
1779 /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */
1780 # define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
1781 # endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */
1782 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1783 # define HASSETRLIMIT 1 /* has setrlimit(2) syscall */
1784 # define LA_TYPE LA_IRIX6 /* figure out at run time */
1785 # include <sys/cdefs.h>
1787 # define ARGV_T char *const *
1788 # endif /* _UNICOSMP */
1794 ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
1796 ** 15 Jan 1994; updated 2 Aug 1995
1801 # define HASSETREUID 1 /* has setreuid(2) call */
1802 # define HASINITGROUPS 1 /* has initgroups(2) call */
1803 # define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */
1804 # define SPT_TYPE SPT_NONE /* don't use setproctitle */
1805 # define LA_TYPE LA_SUBR /* use getloadavg.c */
1806 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
1807 # define SFS_BAVAIL f_bfree /* alternate field name */
1808 # define TZ_TYPE TZ_TZNAME
1809 # ifndef _PATH_VENDOR_CF
1810 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
1811 # endif /* ! _PATH_VENDOR_CF */
1812 # ifndef _PATH_SENDMAILPID
1813 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1814 # endif /* ! _PATH_SENDMAILPID */
1815 # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */
1817 # define S_IFIFO 0010000
1819 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
1820 # endif /* ! IDENTPROTO */
1821 # define RLIMIT_NEEDS_SYS_TIME_H 1
1822 # if defined(NGROUPS_MAX) && !NGROUPS_MAX
1824 # endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */
1825 # endif /* apollo */
1830 ** Requires MPE 6.0 or greater. See sendmail/README for more info.
1832 ** From Mark Bixby <mark_bixby@hp.com> or <mark@bixby.org>.
1837 # include <sys/sysmacros.h>
1840 /* Sendmail stuff */
1841 # define HASFCHOWN 0 /* lacks fchown() */
1842 # define HASGETUSERSHELL 0 /* lacks getusershell() */
1845 # endif /* HASNICE */
1846 # define HASNICE 0 /* lacks nice() */
1847 # define HASRANDOM 0 /* lacks random() */
1848 # ifdef HASRRESVPORT
1849 # undef HASRRESVPORT
1850 # endif /* HASRRESVPORT */
1851 # define HASRRESVPORT 0 /* lacks rresvport() */
1852 # define IP_SRCROUTE 0 /* lacks IP source routing fields */
1855 # endif /* MATCHGECOS */
1856 # define MATCHGECOS 0 /* lacks an initialized GECOS field */
1857 # define NEEDFSYNC 1 /* use sendmail's fsync() */
1858 # define NEEDLINK 1 /* use sendmail's link() */
1859 # define NOFTRUNCATE 1 /* lacks ftruncate() */
1860 # define SFS_TYPE SFS_NONE /* can't determine disk space */
1861 # define SM_CONF_SYSLOG 0 /* use sendmail decl of syslog() */
1862 # define USE_DOUBLE_FORK 0 /* don't fork an intermediate zombie */
1863 # define USE_ENVIRON 1 /* use environ instead of envp */
1865 /* Missing header stuff */
1866 # define AF_UNSPEC 0
1867 # define AF_MAX AF_INET
1868 # define IFF_LOOPBACK 0x8
1869 # define IN_LOOPBACKNET 127
1870 # define MAXNAMLEN NAME_MAX
1871 # define S_IEXEC S_IXUSR
1872 # define S_IREAD S_IRUSR
1873 # define S_IWRITE S_IWUSR
1875 /* Present header stuff that needs to be missing */
1878 /* Shadow functions */
1879 # define bind sendmail_mpe_bind
1880 # define _exit sendmail_mpe__exit
1881 # define exit sendmail_mpe_exit
1882 # define fcntl sendmail_mpe_fcntl
1883 # define getegid sendmail_mpe_getegid
1884 # define geteuid sendmail_mpe_geteuid
1885 # define getpwnam sendmail_mpe_getpwnam
1886 # define getpwuid sendmail_mpe_getpwuid
1887 # define setgid sendmail_mpe_setgid
1888 # define setuid sendmail_mpe_setuid
1889 extern int sendmail_mpe_fcntl __P((int, int, ...));
1890 extern struct passwd * sendmail_mpe_getpwnam __P((const char *));
1891 extern struct passwd * sendmail_mpe_getpwuid __P((uid_t));
1895 ** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native)
1897 ** Contributed by Paul Gampe <paulg@apnic.net>
1901 # include <sys/mkdev.h>
1903 # define SYS5SIGNALS 1
1904 # define HASFCHOWN 1 /* has fchown(2) call */
1905 # define HASSETSID 1 /* has POSIX setsid(2) call */
1906 # define HASSETREUID 1
1907 # define HASWAITPID 1
1908 # define HASGETDTABLESIZE 1
1909 # define GIDSET_T gid_t
1910 # define SOCKADDR_LEN_T size_t
1911 # define SOCKOPT_LEN_T size_t
1912 # define SIGWAIT_TAKES_1_ARG 1
1914 # define _PATH_UNIX "/stand/unix"
1915 # endif /* ! _PATH_UNIX */
1916 # define SPT_PADCHAR '\0' /* pad process title with nulls */
1917 # ifndef SYSLOG_BUFSIZE
1918 # define SYSLOG_BUFSIZE 1024 /* unsure */
1919 # endif /* ! SYSLOG_BUFSIZE */
1920 # ifndef _PATH_VENDOR_CF
1921 # define _PATH_VENDOR_CF "/etc/sendmail.cf"
1922 # endif /* ! _PATH_VENDOR_CF */
1923 # ifndef _PATH_SENDMAILPID
1924 # define _PATH_SENDMAILPID "/etc/sendmail.pid"
1925 # endif /* ! _PATH_SENDMAILPID */
1926 # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */
1927 #if !defined(SM_SET_H_ERRNO) && defined(_REENTRANT)
1928 # define SM_SET_H_ERRNO(err) set_h_errno((err))
1929 #endif /* ! SM_SET_H_ERRNO && _REENTRANT */
1930 # endif /* __svr5__ */
1932 /* ###################################################################### */
1940 # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */
1941 # endif /* UNIXWARE2 */
1947 ** Updated by Petr Lampa <lampa@fee.vutbr.cz>.
1948 ** From Evan Champion <evanc@spatial.synapse.org>.
1952 # include <sys/mkdev.h>
1954 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1955 # define HASSETREUID 1
1956 # define HASSETSID 1 /* has POSIX setsid(2) call */
1957 # define HASINITGROUPS 1
1958 # define GIDSET_T gid_t
1959 # define SLEEP_T unsigned
1960 # define SFS_TYPE SFS_STATVFS
1961 # define LA_TYPE LA_ZERO
1965 # define _PATH_UNIX "/unix"
1966 # endif /* ! _PATH_UNIX */
1967 # ifndef _PATH_VENDOR_CF
1968 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
1969 # endif /* ! _PATH_VENDOR_CF */
1970 # ifndef _PATH_SENDMAILPID
1971 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
1972 # endif /* ! _PATH_SENDMAILPID */
1973 # define SYSLOG_BUFSIZE 128
1974 # endif /* UNIXWARE */
1978 ** Intergraph CLIX 3.1
1980 ** From Paul Southworth <pauls@locust.cic.net>
1984 # define SYSTEM5 1 /* looks like System V */
1985 # ifndef HASGETUSERSHELL
1986 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
1987 # endif /* ! HASGETUSERSHELL */
1988 # define DEV_BSIZE 512 /* device block size not defined */
1989 # define GIDSET_T gid_t
1990 # undef LOG /* syslog not available */
1991 # define NEEDFSYNC 1 /* no fsync in system library */
1992 # define GETSHORT _getshort
1997 ** NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP
1999 ** From Kevin Darcy <kevin@tech.mis.cfc.com>.
2003 # include <sys/sockio.h>
2005 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */
2006 # define SYSLOG_BUFSIZE 1024
2007 # define SPT_TYPE SPT_NONE
2008 # endif /* NCR_MP_RAS2 */
2012 ** NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP
2014 ** From Tom Moore <Tom.Moore@DaytonOH.NCR.COM>
2019 # define HASFCHOWN 1 /* has fchown(2) call */
2020 # define LDA_USE_LOCKF 1
2021 # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM has non-std interface */
2022 # define SO_REUSEADDR_IS_BROKEN 1 /* doesn't work if accept() fails */
2023 # define SYSLOG_BUFSIZE 1024
2024 # define SPT_TYPE SPT_NONE
2025 # define _PATH_MAILDIR "/var/mail"
2026 # ifndef _XOPEN_SOURCE
2027 # define _XOPEN_SOURCE
2028 # define _XOPEN_SOURCE_EXTENDED 1
2029 # include <sys/resource.h>
2030 # undef _XOPEN_SOURCE
2031 # undef _XOPEN_SOURCE_EXTENDED
2032 # endif /* ! _XOPEN_SOURCE */
2033 # endif /* NCR_MP_RAS3 */
2037 ** Tandem NonStop-UX SVR4
2039 ** From Rick McCarty <mccarty@mpd.tandem.com>.
2042 # ifdef NonStop_UX_BXX
2044 # endif /* NonStop_UX_BXX */
2048 ** Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2.
2050 ** Tested for 1.04, 1.03
2051 ** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
2053 ** Tested for 4.02, 6.10 and 7.10
2054 ** From Motonori NAKAMURA <motonori@media.kyoto-u.ac.jp>.
2057 # if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE))
2058 # define SYSTEM5 1 /* include all the System V defines */
2059 # define HASINITGROUPS 1 /* has initgroups(3) call */
2060 # define HASFCHMOD 1 /* has fchmod(2) syscall */
2061 # define setreuid(r, e) setresuid(r, e, -1)
2062 # define LA_TYPE LA_FLOAT
2063 # define SPT_TYPE SPT_PSTAT
2064 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
2066 # define HASSETVBUF /* HI-UX has no setlinebuf */
2067 # endif /* ! HASSETVBUF */
2069 # define GIDSET_T gid_t
2070 # endif /* ! GIDSET_T */
2072 # define _PATH_UNIX "/HI-UX"
2073 # endif /* ! _PATH_UNIX */
2074 # ifndef _PATH_VENDOR_CF
2075 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
2076 # endif /* ! _PATH_VENDOR_CF */
2078 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
2079 # endif /* ! IDENTPROTO */
2080 # ifndef HASGETUSERSHELL
2081 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */
2082 # endif /* ! HASGETUSERSHELL */
2083 # define FDSET_CAST (int *) /* cast for fd_set parameters to select */
2086 ** avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h
2091 # define SM_CONF_SYSLOG 0
2093 # endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */
2097 ** Amdahl UTS System V 2.1.5 (SVr3-based)
2099 ** From: Janet Jackson <janet@dialix.oz.au>.
2103 # include <sys/sysmacros.h>
2104 # undef HASLSTAT /* has symlinks, but they cause problems */
2105 # define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */
2106 # define SYS5SIGNALS 1 /* System V signal semantics */
2107 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
2108 # define HASUNAME 1 /* use System V uname(2) system call */
2109 # define HASINITGROUPS 1 /* has initgroups(3) function */
2110 # define HASSETVBUF 1 /* has setvbuf(3) function */
2111 # ifndef HASGETUSERSHELL
2112 # define HASGETUSERSHELL 0 /* does not have getusershell(3) function */
2113 # endif /* ! HASGETUSERSHELL */
2114 # define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */
2115 # define LA_TYPE LA_ZERO /* doesn't have load average */
2116 # define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */
2117 # define SFS_BAVAIL f_bfree /* alternate field name */
2118 # define _PATH_UNIX "/unix"
2119 # ifndef _PATH_VENDOR_CF
2120 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
2121 # endif /* ! _PATH_VENDOR_CF */
2125 ** Cray Computer Corporation's CSOS
2127 ** From Scott Bolte <scott@craycos.com>.
2131 # define SYSTEM5 1 /* include all the System V defines */
2132 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
2133 # define NEEDFSYNC 1 /* no fsync in system library */
2134 # define MAXPATHLEN PATHSIZE
2135 # define LA_TYPE LA_ZERO
2136 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */
2137 # define SFS_BAVAIL f_bfree /* alternate field name */
2138 # define _POSIX_CHOWN_RESTRICTED -1
2139 extern struct group *getgrent(), *getgrnam(), *getgrgid();
2140 # endif /* _CRAYCOM */
2144 ** Sony NEWS-OS 4.2.1R and 6.0.3
2146 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
2151 /* NEWS-OS 4.2.1R */
2153 # define BSD /* has BSD routines */
2155 # define HASUNSETENV 1 /* has unsetenv(2) call */
2156 # undef HASSETVBUF /* don't actually have setvbuf(3) */
2157 # define WAITUNION 1 /* use "union wait" as wait argument type */
2158 # define LA_TYPE LA_INT
2159 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
2161 # define HASFLOCK 1 /* has flock(2) call */
2162 # endif /* ! HASFLOCK */
2163 # define setpgid setpgrp
2166 # define MODE_T int /* system include files have no mode_t */
2168 typedef int (*sigfunc_t)();
2169 # define SIGFUNC_DEFINED
2170 # define SIGFUNC_RETURN (0)
2171 # define SIGFUNC_DECL int
2173 # else /* ! __svr4 */
2174 /* NEWS-OS 6.0.3 with /bin/cc */
2176 # define __svr4__ /* use all System V Release 4 defines below */
2177 # endif /* ! __svr4__ */
2178 # define HASSETSID 1 /* has POSIX setsid(2) call */
2179 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */
2180 # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */
2182 # define SPT_TYPE SPT_SYSMIPS /* use sysmips() (OS 6.0.2 or later) */
2183 # endif /* ! SPT_TYPE */
2184 # define GIDSET_T gid_t
2187 # ifndef SYSLOG_BUFSIZE
2188 # define SYSLOG_BUFSIZE 256
2189 # endif /* ! SYSLOG_BUFSIZE */
2190 # define _PATH_UNIX "/stand/unix"
2191 # ifndef _PATH_VENDOR_CF
2192 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf"
2193 # endif /* ! _PATH_VENDOR_CF */
2194 # ifndef _PATH_SENDMAILPID
2195 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
2196 # endif /* ! _PATH_SENDMAILPID */
2198 # endif /* ! __svr4 */
2199 # endif /* sony_news */
2203 ** Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
2205 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
2210 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
2211 # endif /* ! IDENTPROTO */
2212 # define HASUNSETENV 1 /* has unsetenv(2) call */
2213 # define NEEDPUTENV 1 /* need putenv(3) call */
2214 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */
2215 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */
2216 # define WAITUNION 1 /* use "union wait" as wait argument type */
2218 # include <sys/time.h>
2219 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */
2220 # define LA_TYPE LA_INT
2221 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */
2222 # endif /* uniosb */
2224 # define LA_TYPE LA_SUBR
2225 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */
2228 # define LA_TYPE LA_INT
2229 # endif /* luna88k */
2230 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */
2231 # define setpgid setpgrp
2235 typedef int (*sigfunc_t)();
2236 # define SIGFUNC_DEFINED
2237 # define SIGFUNC_RETURN (0)
2238 # define SIGFUNC_DECL int
2239 extern char *getenv();
2240 # ifndef _PATH_VENDOR_CF
2241 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf"
2242 # endif /* ! _PATH_VENDOR_CF */
2247 ** NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
2249 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
2252 # if defined(nec_ews_svr4) || defined(_nec_ews_svr4)
2254 # define __svr4__ /* use all System V Release 4 defines below */
2255 # endif /* ! __svr4__ */
2256 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */
2257 # define HASSETSID 1 /* has POSIX setsid(2) call */
2258 # define LA_TYPE LA_READKSYM /* use MIOC_READSYM ioctl */
2259 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */
2260 # define GIDSET_T gid_t
2263 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */
2264 # ifndef _PATH_VENDOR_CF
2265 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
2266 # endif /* ! _PATH_VENDOR_CF */
2267 # ifndef _PATH_SENDMAILPID
2268 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
2269 # endif /* ! _PATH_SENDMAILPID */
2270 # ifndef SYSLOG_BUFSIZE
2271 # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */
2272 # endif /* ! SYSLOG_BUFSIZE */
2273 # endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */
2277 ** Fujitsu/ICL UXP/DS (For the DS/90 Series)
2279 ** From Diego R. Lopez <drlopez@cica.es>.
2280 ** Additional changes from Fumio Moriya and Toshiaki Nomura of the
2281 ** Fujitsu Fresoftware group <dsfrsoft@oai6.yk.fujitsu.co.jp>.
2285 # include <arpa/nameser.h>
2286 # include <sys/sysmacros.h>
2287 # include <sys/mkdev.h>
2289 # define HASGETUSERSHELL 0
2291 # define _PATH_UNIX "/stand/unix"
2292 # ifndef _PATH_VENDOR_CF
2293 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
2294 # endif /* ! _PATH_VENDOR_CF */
2295 # ifndef _PATH_SENDMAILPID
2296 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
2297 # endif /* ! _PATH_SENDMAILPID */
2298 # endif /* __uxp__ */
2303 ** From Earle Ake <akee@wpdiss1.wpafb.af.mil>.
2307 # define GIDSET_T gid_t
2309 # define IDENTPROTO 0 /* TCP/IP implementation is broken */
2310 # endif /* ! IDENTPROTO */
2314 ** Concurrent Computer Corporation Maxion
2316 ** From Donald R. Laster Jr. <laster@access.digex.net>.
2321 # include <sys/stream.h>
2322 # define __svr4__ 1 /* SVR4.2MP */
2323 # define HASSETREUID 1 /* have setreuid(2) */
2324 # define HASLSTAT 1 /* have lstat(2) */
2325 # define HASSETRLIMIT 1 /* have setrlimit(2) */
2326 # define HASGETDTABLESIZE 1 /* have getdtablesize(2) */
2327 # define HASGETUSERSHELL 1 /* have getusershell(3) */
2328 # define NOFTRUNCATE 1 /* do not have ftruncate(2) */
2329 # define SLEEP_T unsigned
2330 # define SFS_TYPE SFS_STATVFS
2331 # define SFS_BAVAIL f_bavail
2332 # ifndef SYSLOG_BUFSIZE
2333 # define SYSLOG_BUFSIZE 256 /* Use 256 bytes */
2334 # endif /* ! SYSLOG_BUFSIZE */
2344 # endif /* __MAXION__ */
2347 ** Harris Nighthawk PowerUX (nh6000 box)
2349 ** Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com>
2355 # endif /* ! __svr4__ */
2356 # ifndef _PATH_VENDOR_CF
2357 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf"
2358 # endif /* ! _PATH_VENDOR_CF */
2359 # ifndef _PATH_SENDMAILPID
2360 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid"
2361 # endif /* ! _PATH_SENDMAILPID */
2362 # define SYSLOG_BUFSIZE 1024
2363 # define LA_TYPE LA_ZERO
2364 typedef struct msgb mblk_t;
2365 # undef offsetof /* avoid stddefs.h and sys/sysmacros.h conflict */
2366 # endif /* _PowerUX */
2369 ** Siemens Nixdorf Informationssysteme AG SINIX
2371 ** Contributed by Gerald Rinske of Siemens Business Services VAS.
2374 # define HASRANDOM 0 /* has random(3) */
2375 # define SYSLOG_BUFSIZE 1024
2376 # define SM_INT32 int /* 32bit integer */
2381 ** Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3
2383 ** Contributed by Sergey Rusanov <rsm@utfoms.udmnet.ru>
2387 # define HASFCHMOD 1
2388 # define HASSETRLIMIT 0
2389 # define HASSETSID 1 /* has POSIX setsid(2) call */
2390 # define HASSETREUID 1
2391 # define HASULIMIT 1
2392 # define HASWAITPID 1
2393 # define HASGETDTABLESIZE 1
2394 # define HASGETUSERSHELL 1
2395 # define IP_SRCROUTE 0
2396 # define IDENTPROTO 0
2397 # define RES_DNSRCH_VARIABLE _res_dnsrch
2398 # define _PATH_UNIX "/unix"
2399 # define _PATH_VENDOR_CF "/etc/sendmail.cf"
2400 # define _PATH_SENDMAILPID "/var/run/sendmail.pid"
2405 ** Contributed by Nedelcho Stanev <nedelcho.stanev@atlanticsky.com>
2407 ** Used for Interix support.
2410 # if defined(__INTERIX)
2411 # define HASURANDOMDEV 1
2412 # define HASGETUSERSHELL 0
2413 # define HASSTRERROR 1
2414 # define HASUNSETENV 1
2415 # define HASFCHOWN 1
2416 # undef HAVE_SYS_ERRLIST
2417 # define sys_errlist __sys_errlist
2418 # define sys_nerr __sys_nerr
2419 # include <sys/mkdev.h>
2421 # define major(dev) ((int)(((dev) >> 8) & 0xff))
2422 # endif /* ! major */
2424 # define minor(dev) ((int)((dev) & 0xff))
2425 # endif /* ! minor */
2426 # endif /* defined(__INTERIX) */
2429 /**********************************************************************
2430 ** End of Per-Operating System defines
2431 **********************************************************************/
2432 /**********************************************************************
2433 ** More general defines
2434 **********************************************************************/
2436 /* general BSD defines */
2438 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */
2439 # ifndef HASSETREUID
2440 # define HASSETREUID 1 /* has setreuid(2) call */
2441 # endif /* ! HASSETREUID */
2442 # define HASINITGROUPS 1 /* has initgroups(3) call */
2443 # ifndef IP_SRCROUTE
2444 # define IP_SRCROUTE 1 /* can check IP source routing */
2445 # endif /* ! IP_SRCROUTE */
2446 # ifndef HASSETRLIMIT
2447 # define HASSETRLIMIT 1 /* has setrlimit(2) call */
2448 # endif /* ! HASSETRLIMIT */
2450 # define HASFLOCK 1 /* has flock(2) call */
2451 # endif /* ! HASFLOCK */
2453 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */
2454 # endif /* ! TZ_TYPE */
2457 /* general System V Release 4 defines */
2460 # define USESETEUID 1 /* has usable seteuid(2) call */
2461 # define HASINITGROUPS 1 /* has initgroups(3) call */
2462 # define BSD_COMP 1 /* get BSD ioctl calls */
2463 # ifndef HASSETRLIMIT
2464 # define HASSETRLIMIT 1 /* has setrlimit(2) call */
2465 # endif /* ! HASSETRLIMIT */
2466 # ifndef HASGETUSERSHELL
2467 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */
2468 # endif /* ! HASGETUSERSHELL */
2470 # define HASFCHMOD 1 /* most (all?) SVr4s seem to have fchmod(2) */
2471 # endif /* ! HASFCHMOD */
2474 # define _PATH_UNIX "/unix"
2475 # endif /* ! _PATH_UNIX */
2476 # ifndef _PATH_VENDOR_CF
2477 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf"
2478 # endif /* ! _PATH_VENDOR_CF */
2479 # ifndef _PATH_SENDMAILPID
2480 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid"
2481 # endif /* ! _PATH_SENDMAILPID */
2482 # ifndef SYSLOG_BUFSIZE
2483 # define SYSLOG_BUFSIZE 128
2484 # endif /* ! SYSLOG_BUFSIZE */
2486 # define SFS_TYPE SFS_STATVFS
2487 # endif /* ! SFS_TYPE */
2489 # ifndef USE_SIGLONGJMP
2490 # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */
2491 # endif /* ! USE_SIGLONGJMP */
2492 # endif /* __svr4__ */
2495 # define LDA_USE_LOCKF 1
2496 # define LDA_USE_SETEUID 1
2497 # define _PATH_MAILDIR "/var/mail"
2498 # endif /* __SVR4 */
2500 /* general System V defines */
2502 # include <sys/sysmacros.h>
2503 # define HASUNAME 1 /* use System V uname(2) system call */
2504 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */
2505 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */
2507 # define HASULIMIT 1 /* has the ulimit(2) syscall */
2508 # endif /* ! HASULIMIT */
2510 # ifdef MIOC_READKSYM
2511 # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */
2512 # else /* MIOC_READKSYM */
2513 # define LA_TYPE LA_INT /* assume integer load average */
2514 # endif /* MIOC_READKSYM */
2515 # endif /* ! LA_TYPE */
2517 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */
2518 # endif /* ! SFS_TYPE */
2520 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */
2521 # endif /* ! TZ_TYPE */
2522 # endif /* SYSTEM5 */
2524 /* general POSIX defines */
2525 # ifdef _POSIX_VERSION
2526 # define HASSETSID 1 /* has POSIX setsid(2) call */
2527 # define HASWAITPID 1 /* has POSIX waitpid(2) call */
2528 # if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
2529 # define USESETEUID 1 /* has usable seteuid(2) call */
2530 # endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */
2531 # endif /* _POSIX_VERSION */
2533 ** Tweaking for systems that (for example) claim to be BSD or POSIX
2534 ** but don't have all the standard BSD or POSIX routines (boo hiss).
2538 # undef HASINITGROUPS /* doesn't have initgroups(3) call */
2542 # undef HASSETSID /* despite POSIX claim, doesn't have setsid */
2543 # endif /* _CRAYCOM */
2550 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and
2551 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message
2552 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
2553 ** are closed. Some firewalls return this error if you try to connect
2554 ** to the IDENT port (113), so you can't receive email from these hosts
2555 ** on these systems. The firewall really should use a more specific
2556 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB. If
2557 ** not explicitly set to zero above, default it on.
2561 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */
2562 # endif /* ! IDENTPROTO */
2564 # ifndef IP_SRCROUTE
2565 # define IP_SRCROUTE 1 /* Detect IP source routing */
2566 # endif /* ! IP_SRCROUTE */
2568 # ifndef HASGETUSERSHELL
2569 # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */
2570 # endif /* ! HASGETUSERSHELL */
2573 # define NETUNIX 1 /* include unix domain support */
2574 # endif /* ! NETUNIX */
2577 # define HASRANDOM 1 /* has random(3) support */
2578 # endif /* ! HASRANDOM */
2581 # define HASFLOCK 0 /* assume no flock(2) support */
2582 # endif /* ! HASFLOCK */
2584 # ifndef HASSETREUID
2585 # define HASSETREUID 0 /* assume no setreuid(2) call */
2586 # endif /* ! HASSETREUID */
2589 # define HASFCHMOD 0 /* assume no fchmod(2) syscall */
2590 # endif /* ! HASFCHMOD */
2593 # define USESETEUID 0 /* assume no seteuid(2) call or no saved ids */
2594 # endif /* ! USESETEUID */
2596 # ifndef HASSETRLIMIT
2597 # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */
2598 # endif /* ! HASSETRLIMIT */
2601 # define HASULIMIT 0 /* assume no ulimit(2) support */
2602 # endif /* ! HASULIMIT */
2605 # define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */
2606 # endif /* ! SECUREWARE */
2608 # ifndef USE_DOUBLE_FORK
2609 # define USE_DOUBLE_FORK 1 /* avoid intermediate zombies */
2610 # endif /* ! USE_DOUBLE_FORK */
2612 # ifndef USE_ENVIRON
2613 # define USE_ENVIRON 0 /* use main() envp instead of extern environ */
2614 # endif /* ! USE_ENVIRON */
2616 # ifndef USE_SIGLONGJMP
2617 # define USE_SIGLONGJMP 0 /* assume setjmp handles signals properly */
2618 # endif /* ! USE_SIGLONGJMP */
2621 # define FDSET_CAST /* (empty) cast for fd_set arg to select */
2622 # endif /* ! FDSET_CAST */
2625 ** Pick a mailer setuid method for changing the current uid
2628 # define USE_SETEUID 0
2629 # define USE_SETREUID 1
2630 # define USE_SETUID 2
2633 # define MAILER_SETUID_METHOD USE_SETEUID
2634 # else /* USESETEUID */
2636 # define MAILER_SETUID_METHOD USE_SETREUID
2637 # else /* HASSETREUID */
2638 # define MAILER_SETUID_METHOD USE_SETUID
2639 # endif /* HASSETREUID */
2640 # endif /* USESETEUID */
2643 ** If no type for argument two of getgroups call is defined, assume
2644 ** it's an integer -- unfortunately, there seem to be several choices
2649 # define GIDSET_T int
2650 # endif /* ! GIDSET_T */
2653 # define UID_T uid_t
2654 # endif /* ! UID_T */
2657 # define GID_T gid_t
2658 # endif /* ! GID_T */
2661 # define MODE_T mode_t
2662 # endif /* ! MODE_T */
2665 # define ARGV_T char **
2666 # endif /* ! ARGV_T */
2668 # ifndef SOCKADDR_LEN_T
2669 # define SOCKADDR_LEN_T int
2670 # endif /* ! SOCKADDR_LEN_T */
2672 # ifndef SOCKOPT_LEN_T
2673 # define SOCKOPT_LEN_T int
2674 # endif /* ! SOCKOPT_LEN_T */
2677 # define QUAD_T unsigned long
2678 # endif /* ! QUAD_T */
2679 /**********************************************************************
2680 ** Remaining definitions should never have to be changed. They are
2681 ** primarily to provide back compatibility for older systems -- for
2682 ** example, it includes some POSIX compatibility definitions
2683 **********************************************************************/
2685 /* System 5 compatibility */
2687 # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG)
2688 # endif /* ! S_ISREG */
2690 # define S_ISDIR(foo) ((foo & S_IFMT) == S_IFDIR)
2691 # endif /* ! S_ISDIR */
2692 # if !defined(S_ISLNK) && defined(S_IFLNK)
2693 # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK)
2694 # endif /* !defined(S_ISLNK) && defined(S_IFLNK) */
2695 # if !defined(S_ISFIFO)
2696 # if defined(S_IFIFO)
2697 # define S_ISFIFO(foo) ((foo & S_IFMT) == S_IFIFO)
2698 # else /* defined(S_IFIFO) */
2699 # define S_ISFIFO(foo) false
2700 # endif /* defined(S_IFIFO) */
2701 # endif /* !defined(S_ISFIFO) */
2703 # define S_IRUSR 0400
2704 # endif /* ! S_IRUSR */
2706 # define S_IWUSR 0200
2707 # endif /* ! S_IWUSR */
2709 # define S_IRGRP 0040
2710 # endif /* ! S_IRGRP */
2712 # define S_IWGRP 0020
2713 # endif /* ! S_IWGRP */
2715 # define S_IROTH 0004
2716 # endif /* ! S_IROTH */
2718 # define S_IWOTH 0002
2719 # endif /* ! S_IWOTH */
2721 /* close-on-exec flag */
2723 # define FD_CLOEXEC 1
2724 # endif /* ! FD_CLOEXEC */
2727 ** Older systems don't have this error code -- it should be in
2728 ** /usr/include/sysexits.h.
2732 # define EX_CONFIG 78 /* configuration error */
2733 # endif /* ! EX_CONFIG */
2736 # define EX_QUIT 22 /* drop out of server immediately */
2737 # define EX_RESTART 23 /* restart sendmail daemon */
2738 # define EX_SHUTDOWN 24 /* shutdown sendmail daemon */
2741 # define EX_NOTFOUND EX_NOHOST
2742 #endif /* ! EX_NOTFOUND */
2744 /* pseudo-code used for mci_setstat */
2745 # define EX_NOTSTICKY (-5) /* don't save persistent status */
2749 ** An "impossible" file mode to indicate that the file does not exist.
2752 # define ST_MODE_NOFILE 0171147 /* unlikely to occur */
2755 /* type of arbitrary pointer */
2757 # define ARBPTR_T void *
2758 # endif /* ! ARBPTR_T */
2761 # include "sm/cdefs.h"
2764 # if HESIOD && !defined(NAMED_BIND)
2765 # define NAMED_BIND 1 /* not one without the other */
2766 # endif /* HESIOD && !defined(NAMED_BIND) */
2768 # if NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno )
2770 # endif /* NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) */
2773 extern int putenv __P((char *));
2774 # endif /* NEEDPUTENV */
2777 extern void unsetenv __P((char *));
2778 #endif /* !HASUNSETENV */
2781 # include <sys/time.h>
2785 /* Some LDAP constants */
2786 # define LDAPMAP_FALSE 0
2787 # define LDAPMAP_TRUE 1
2790 ** ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1.
2791 ** Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations
2792 ** and assume (falsely) that all old API implementations are broken.
2793 ** (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT)
2796 # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT)
2797 # define USE_LDAP_INIT 1
2798 # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) */
2801 ** LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x,
2802 ** hence ldap_set_option() must not exist.
2805 # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION)
2806 # define USE_LDAP_SET_OPTION 1
2807 # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) */
2809 # endif /* LDAPMAP */
2812 # include <sys/utsname.h>
2815 # endif /* newstr */
2816 # else /* HASUNAME */
2817 # define NODE_LENGTH 32
2820 char nodename[NODE_LENGTH + 1];
2822 # endif /* HASUNAME */
2824 # if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V)
2825 # define MAXHOSTNAMELEN 256
2826 # endif /* !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) */
2829 # if _FFR_LINUX_MHNL && defined(__linux__) && MAXHOSTNAMELEN < 255
2831 ** override Linux weirdness: a FQHN can be 255 chars long
2832 ** SUSv3 requires HOST_NAME_MAX ("Maximum length of a host
2833 ** name (not including the terminating null) as returned from the
2834 ** gethostname() function.") to be at least 255. c.f.:
2835 ** http://www.opengroup.org/onlinepubs/009695399
2836 ** but Linux defines that to 64 too.
2838 # undef MAXHOSTNAMELEN
2839 # define MAXHOSTNAMELEN 256
2840 # endif /* _FFR_LINUX_MHNL && defined(__linux__) && MAXHOSTNAMELEN < 255 */
2842 # if !defined(SIGCHLD) && defined(SIGCLD)
2843 # define SIGCHLD SIGCLD
2844 # endif /* !defined(SIGCHLD) && defined(SIGCLD) */
2846 # ifndef STDIN_FILENO
2847 # define STDIN_FILENO 0
2848 # endif /* ! STDIN_FILENO */
2850 # ifndef STDOUT_FILENO
2851 # define STDOUT_FILENO 1
2852 # endif /* ! STDOUT_FILENO */
2854 # ifndef STDERR_FILENO
2855 # define STDERR_FILENO 2
2856 # endif /* ! STDERR_FILENO */
2859 # define LOCK_SH 0x01 /* shared lock */
2860 # define LOCK_EX 0x02 /* exclusive lock */
2861 # define LOCK_NB 0x04 /* non-blocking lock */
2862 # define LOCK_UN 0x08 /* unlock */
2863 # endif /* ! LOCK_SH */
2866 # define S_IXOTH (S_IEXEC >> 6)
2867 # endif /* ! S_IXOTH */
2870 # define S_IXGRP (S_IEXEC >> 3)
2871 # endif /* ! S_IXGRP */
2874 # define S_IXUSR (S_IEXEC)
2875 # endif /* ! S_IXUSR */
2878 # define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR)
2879 #endif /* ! O_ACCMODE */
2885 # endif /* ! SEEK_SET */
2888 # define SIG_ERR ((void (*)()) -1)
2889 # endif /* ! SIG_ERR */
2891 # ifndef WEXITSTATUS
2892 # define WEXITSTATUS(st) (((st) >> 8) & 0377)
2893 # endif /* ! WEXITSTATUS */
2895 # define WIFEXITED(st) (((st) & 0377) == 0)
2896 # endif /* ! WIFEXITED */
2898 # define WIFSTOPPED(st) (((st) & 0100) == 0)
2899 # endif /* ! WIFSTOPPED */
2901 # define WCOREDUMP(st) (((st) & 0200) != 0)
2902 # endif /* ! WCOREDUMP */
2904 # define WTERMSIG(st) (((st) & 0177))
2905 # endif /* ! WTERMSIG */
2907 # ifndef SIGFUNC_DEFINED
2908 typedef void (*sigfunc_t) __P((int));
2909 # endif /* ! SIGFUNC_DEFINED */
2910 # ifndef SIGFUNC_RETURN
2911 # define SIGFUNC_RETURN
2912 # endif /* ! SIGFUNC_RETURN */
2913 # ifndef SIGFUNC_DECL
2914 # define SIGFUNC_DECL void
2915 # endif /* ! SIGFUNC_DECL */
2917 /* size of syslog buffer */
2918 # ifndef SYSLOG_BUFSIZE
2919 # define SYSLOG_BUFSIZE 1024
2920 # endif /* ! SYSLOG_BUFSIZE */
2924 # define FD_SETSIZE 256
2925 #endif /* ! FD_SETSIZE */
2927 #ifndef SIGWAIT_TAKES_1_ARG
2928 # define SIGWAIT_TAKES_1_ARG 0
2929 #endif /* ! SIGWAIT_TAKES_1_ARG */
2932 ** Size of prescan buffer.
2933 ** Despite comments in the _sendmail_ book, this probably should
2934 ** not be changed; there are some hard-to-define dependencies.
2937 # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */
2939 /* fork routine -- set above using #ifdef _osname_ or in Makefile */
2941 # define FORK fork /* function to call to fork mailer */
2942 # endif /* ! FORK */
2944 /* setting h_errno */
2945 # ifndef SM_SET_H_ERRNO
2946 # define SM_SET_H_ERRNO(err) h_errno = (err)
2947 # endif /* SM_SET_H_ERRNO */
2949 # ifndef SM_CONF_GETOPT
2950 # define SM_CONF_GETOPT 1
2951 # endif /* ! SM_CONF_GETOPT */
2953 /* random routine -- set above using #ifdef _osname_ or in Makefile */
2955 # define get_random() random()
2956 # else /* HASRANDOM */
2957 # define get_random() ((long) rand())
2958 # ifndef RANDOMSHIFT
2959 # define RANDOMSHIFT 8
2960 # endif /* ! RANDOMSHIFT */
2961 # endif /* HASRANDOM */
2964 ** Default to using scanf in readcf.
2969 # endif /* ! SCANF */
2971 /* XXX 32 bit type */
2973 # define SM_INT32 int32_t
2974 # endif /* ! SM_INT32 */
2976 /* XXX 16 bit type */
2978 # define SM_UINT16 uint16_t
2979 # endif /* ! SM_UINT16 */
2981 /* additional valid chars in user/group names in passwd */
2982 # ifndef SM_PWN_CHARS
2983 # define SM_PWN_CHARS "-_."
2988 ** SVr4 and similar systems use different routines for setjmp/longjmp
2989 ** with signal support
2995 # endif /* jmp_buf */
2996 # define jmp_buf sigjmp_buf
2999 # endif /* setjmp */
3000 # define setjmp(env) sigsetjmp(env, 1)
3003 # endif /* longjmp */
3004 # define longjmp(env, val) siglongjmp(env, val)
3005 # endif /* USE_SIGLONGJMP */
3007 # if !defined(NGROUPS_MAX) && defined(NGROUPS)
3008 # define NGROUPS_MAX NGROUPS /* POSIX naming convention */
3009 # endif /* !defined(NGROUPS_MAX) && defined(NGROUPS) */
3012 ** Some snprintf() implementations are rumored not to NUL terminate.
3014 # if SNPRINTF_IS_BROKEN
3017 # endif /* snprintf */
3018 # define snprintf sm_snprintf
3021 # endif /* vsnprintf */
3022 # define vsnprintf sm_vsnprintf
3023 # endif /* SNPRINTF_IS_BROKEN */
3026 ** If we don't have a system syslog, simulate it.
3030 # define LOG_EMERG 0 /* system is unusable */
3031 # define LOG_ALERT 1 /* action must be taken immediately */
3032 # define LOG_CRIT 2 /* critical conditions */
3033 # define LOG_ERR 3 /* error conditions */
3034 # define LOG_WARNING 4 /* warning conditions */
3035 # define LOG_NOTICE 5 /* normal but significant condition */
3036 # define LOG_INFO 6 /* informational */
3037 # define LOG_DEBUG 7 /* debug-level messages */
3040 # ifndef SM_CONF_SYSLOG
3041 # define SM_CONF_SYSLOG 1 /* syslog.h has prototype for syslog() */
3042 # endif /* SM_CONF_SYSLOG */
3044 # if !SM_CONF_SYSLOG
3046 extern void syslog(int, const char *, ...);
3047 # else /* __STDC__ */
3048 extern void syslog();
3049 # endif /* __STDC__ */
3050 # endif /* !SM_CONF_SYSLOG */
3052 /* portable(?) definition for alignment */
3053 # ifndef SM_ALIGN_SIZE
3062 void (*al_f) __P((void));
3065 # define SM_ALIGN_SIZE offsetof(struct sm_align, al_u)
3066 # endif /* ! SM_ALIGN_SIZE */
3067 # define SM_ALIGN_BITS (SM_ALIGN_SIZE - 1)
3069 char *sm_inet6_ntop __P((const void *, char *, size_t));
3071 #endif /* ! SM_CONF_H */