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