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