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