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