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