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.88 2002/05/01 16:09:41 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 # ifndef _PATH_SENDMAILPID 1362 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 1363 # endif /* ! _PATH_SENDMAILPID */ 1364 # include <sys/sysmacros.h> 1365 # undef atol /* wounded in <stdlib.h> */ 1366 # if NETINET6 1367 /* 1368 ** Linux doesn't have a good way to tell userland what interfaces are 1369 ** IPv6-capable. Therefore, the BIND resolver can not determine if there 1370 ** are IPv6 interfaces to honor AI_ADDRCONFIG. Unfortunately, it assumes 1371 ** that none are present. (Excuse the macro name ADDRCONFIG_IS_BROKEN.) 1372 */ 1373 # define ADDRCONFIG_IS_BROKEN 1 1374 1375 /* 1376 ** Indirectly included from glibc's <feature.h>. IPv6 support is native 1377 ** in 2.1 and later, but the APIs appear before the functions. 1378 */ 1379 # if defined(__GLIBC__) && defined(__GLIBC_MINOR__) 1380 # define HASSTRERROR 1 /* has strerror(3) */ 1381 # define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__) 1382 # if (GLIBC_VERSION >= 0x201) 1383 # undef IPPROTO_ICMPV6 /* linux #defines, glibc enums */ 1384 # else /* (GLIBC_VERSION >= 0x201) */ 1385 # include <linux/in6.h> /* IPv6 support */ 1386 # endif /* (GLIBC_VERSION >= 0x201) */ 1387 # if (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) 1388 /* Have APIs in <netdb.h>, but no support in glibc */ 1389 # define NEEDSGETIPNODE 1 1390 # endif /* (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) */ 1391 # undef GLIBC_VERSION 1392 # endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */ 1393 # endif /* NETINET6 */ 1394 # ifndef HASFCHOWN 1395 # define HASFCHOWN 1 /* fchown(2) */ 1396 # endif /* ! HASFCHOWN */ 1397 # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) 1398 # define HASFCHMOD 1 /* fchmod(2) */ 1399 # endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) */ 1400 # endif /* __linux__ */ 1401 1402 1403 /* 1404 ** DELL SVR4 Issue 2.2, and others 1405 ** From Kimmo Suominen <kim@grendel.lut.fi> 1406 ** 1407 ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 1408 ** defined, and the definitions conflict. 1409 ** 1410 ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 1411 ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 1412 ** (SVR4.0/386 version 3.0). 1413 */ 1414 1415 # ifdef DELL_SVR4 1416 /* no changes necessary */ 1417 /* see general __svr4__ defines below */ 1418 # endif /* DELL_SVR4 */ 1419 1420 1421 /* 1422 ** Apple A/UX 3.0 1423 */ 1424 1425 # ifdef _AUX_SOURCE 1426 # include <sys/sysmacros.h> 1427 # define BSD /* has BSD routines */ 1428 # define HASSETRLIMIT 0 /* ... but not setrlimit(2) */ 1429 # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 1430 # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */ 1431 # define HASUNAME 1 /* use System V uname(2) system call */ 1432 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 1433 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1434 # define HASSETVBUF 1 /* has setvbuf(3) in libc */ 1435 # define HASSTRERROR 1 /* has strerror(3) */ 1436 # define SIGFUNC_DEFINED /* sigfunc_t already defined */ 1437 # define SIGFUNC_RETURN /* POSIX-mode */ 1438 # define SIGFUNC_DECL void /* POSIX-mode */ 1439 # define ERRLIST_PREDEFINED 1 1440 # ifndef IDENTPROTO 1441 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1442 # endif /* ! IDENTPROTO */ 1443 # ifndef LA_TYPE 1444 # define LA_TYPE LA_INT 1445 # define FSHIFT 16 1446 # endif /* ! LA_TYPE */ 1447 # define LA_AVENRUN "avenrun" 1448 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1449 # define TZ_TYPE TZ_TZNAME 1450 # ifndef _PATH_UNIX 1451 # define _PATH_UNIX "/unix" /* should be in <paths.h> */ 1452 # endif /* ! _PATH_UNIX */ 1453 # ifndef _PATH_VENDOR_CF 1454 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1455 # endif /* ! _PATH_VENDOR_CF */ 1456 # undef WIFEXITED 1457 # undef WEXITSTATUS 1458 # endif /* _AUX_SOURCE */ 1459 1460 1461 /* 1462 ** Encore UMAX V 1463 ** 1464 ** Not extensively tested. 1465 */ 1466 1467 # ifdef UMAXV 1468 # define HASUNAME 1 /* use System V uname(2) system call */ 1469 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 1470 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1471 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1472 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1473 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 1474 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1475 # define MAXPATHLEN PATH_MAX 1476 extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 1477 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 1478 # undef WIFEXITED 1479 # undef WEXITSTATUS 1480 # endif /* UMAXV */ 1481 1482 1483 /* 1484 ** Stardent Titan 3000 running TitanOS 4.2. 1485 ** 1486 ** Must be compiled in "cc -43" mode. 1487 ** 1488 ** From Kate Hedstrom <kate@ahab.rutgers.edu>. 1489 ** 1490 ** Note the tweaking below after the BSD defines are set. 1491 */ 1492 1493 # ifdef titan 1494 # define setpgid setpgrp 1495 typedef int pid_t; 1496 # undef WIFEXITED 1497 # undef WEXITSTATUS 1498 # endif /* titan */ 1499 1500 1501 /* 1502 ** Sequent DYNIX 3.2.0 1503 ** 1504 ** From Jim Davis <jdavis@cs.arizona.edu>. 1505 */ 1506 1507 # ifdef sequent 1508 1509 # define BSD 1 1510 # define HASUNSETENV 1 1511 # define BSD4_3 1 /* to get signal() in conf.c */ 1512 # define WAITUNION 1 1513 # define LA_TYPE LA_FLOAT 1514 # ifdef _POSIX_VERSION 1515 # undef _POSIX_VERSION /* set in <unistd.h> */ 1516 # endif /* _POSIX_VERSION */ 1517 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 1518 # define setpgid setpgrp 1519 1520 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 1521 # undef WIFEXITED 1522 # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 1523 ((union wait*)&(s))->w_termsig == 0) 1524 # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 1525 typedef int pid_t; 1526 # define isgraph(c) (isprint(c) && (c != ' ')) 1527 1528 # ifndef IDENTPROTO 1529 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1530 # endif /* ! IDENTPROTO */ 1531 1532 # ifndef _PATH_UNIX 1533 # define _PATH_UNIX "/dynix" 1534 # endif /* ! _PATH_UNIX */ 1535 # ifndef _PATH_VENDOR_CF 1536 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1537 # endif /* ! _PATH_VENDOR_CF */ 1538 # endif /* sequent */ 1539 1540 1541 /* 1542 ** Sequent DYNIX/ptx v2.0 (and higher) 1543 ** 1544 ** For DYNIX/ptx v1.x, undefine HASSETREUID. 1545 ** 1546 ** From Tim Wright <timw@sequent.com>. 1547 ** Update from Jack Woolley <jwoolley@sctcorp.com>, 26 Dec 1995, 1548 ** for DYNIX/ptx 4.0.2. 1549 */ 1550 1551 # ifdef _SEQUENT_ 1552 # include <sys/stream.h> 1553 # define SYSTEM5 1 /* include all the System V defines */ 1554 # define HASSETSID 1 /* has POSIX setsid(2) call */ 1555 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1556 # define HASSETREUID 1 /* has setreuid(2) call */ 1557 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1558 # define GIDSET_T gid_t 1559 # define LA_TYPE LA_INT 1560 # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 1561 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 1562 # ifndef IDENTPROTO 1563 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1564 # endif /* ! IDENTPROTO */ 1565 # ifndef _PATH_VENDOR_CF 1566 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1567 # endif /* ! _PATH_VENDOR_CF */ 1568 # ifndef _PATH_SENDMAILPID 1569 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 1570 # endif /* ! _PATH_SENDMAILPID */ 1571 # endif /* _SEQUENT_ */ 1572 1573 1574 /* 1575 ** Cray Unicos 1576 ** 1577 ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 1578 */ 1579 1580 # ifdef UNICOS 1581 # define SYSTEM5 1 /* include all the System V defines */ 1582 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1583 # define MAXPATHLEN PATHSIZE 1584 # define LA_TYPE LA_ZERO 1585 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1586 # define SFS_BAVAIL f_bfree /* alternate field name */ 1587 # endif /* UNICOS */ 1588 1589 1590 /* 1591 ** Apollo DomainOS 1592 ** 1593 ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com> 1594 ** 1595 ** 15 Jan 1994; updated 2 Aug 1995 1596 ** 1597 */ 1598 1599 # ifdef apollo 1600 # define HASSETREUID 1 /* has setreuid(2) call */ 1601 # define HASINITGROUPS 1 /* has initgroups(2) call */ 1602 # define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */ 1603 # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 1604 # define LA_TYPE LA_SUBR /* use getloadavg.c */ 1605 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1606 # define SFS_BAVAIL f_bfree /* alternate field name */ 1607 # define TZ_TYPE TZ_TZNAME 1608 # ifndef _PATH_VENDOR_CF 1609 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1610 # endif /* ! _PATH_VENDOR_CF */ 1611 # ifndef _PATH_SENDMAILPID 1612 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 1613 # endif /* ! _PATH_SENDMAILPID */ 1614 # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ 1615 # undef S_IFIFO 1616 # define S_IFIFO 0010000 1617 # ifndef IDENTPROTO 1618 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1619 # endif /* ! IDENTPROTO */ 1620 # define RLIMIT_NEEDS_SYS_TIME_H 1 1621 # if defined(NGROUPS_MAX) && !NGROUPS_MAX 1622 # undef NGROUPS_MAX 1623 # endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */ 1624 # endif /* apollo */ 1625 1626 /* 1627 ** MPE-iX 1628 ** 1629 ** Requires MPE 6.0 or greater. See sendmail/README for more info. 1630 ** 1631 ** From Mark Bixby <mark_bixby@hp.com> or <mark@bixby.org>. 1632 */ 1633 1634 # ifdef MPE 1635 1636 # include <sys/sysmacros.h> 1637 # include <fcntl.h> 1638 1639 /* Sendmail stuff */ 1640 # define HASFCHOWN 0 /* lacks fchown() */ 1641 # define HASGETUSERSHELL 0 /* lacks getusershell() */ 1642 # ifdef HASNICE 1643 # undef HASNICE 1644 # endif /* HASNICE */ 1645 # define HASNICE 0 /* lacks nice() */ 1646 # define HASRANDOM 0 /* lacks random() */ 1647 # ifdef HASRRESVPORT 1648 # undef HASRRESVPORT 1649 # endif /* HASRRESVPORT */ 1650 # define HASRRESVPORT 0 /* lacks rresvport() */ 1651 # define IP_SRCROUTE 0 /* lacks IP source routing fields */ 1652 # ifdef MATCHGECOS 1653 # undef MATCHGECOS 1654 # endif /* MATCHGECOS */ 1655 # define MATCHGECOS 0 /* lacks an initialized GECOS field */ 1656 # define NEEDFSYNC 1 /* use sendmail's fsync() */ 1657 # define NEEDLINK 1 /* use sendmail's link() */ 1658 # define NOFTRUNCATE 1 /* lacks ftruncate() */ 1659 # define SFS_TYPE SFS_NONE /* can't determine disk space */ 1660 # define SM_CONF_SYSLOG 0 /* use sendmail decl of syslog() */ 1661 # define USE_DOUBLE_FORK 0 /* don't fork an intermediate zombie */ 1662 # define USE_ENVIRON 1 /* use environ instead of envp */ 1663 1664 /* Missing header stuff */ 1665 # define AF_UNSPEC 0 1666 # define AF_MAX AF_INET 1667 # define IFF_LOOPBACK 0x8 1668 # define IN_LOOPBACKNET 127 1669 # define MAXNAMLEN NAME_MAX 1670 # define S_IEXEC S_IXUSR 1671 # define S_IREAD S_IRUSR 1672 # define S_IWRITE S_IWUSR 1673 1674 /* Present header stuff that needs to be missing */ 1675 # undef NGROUPS_MAX 1676 1677 /* Shadow functions */ 1678 # define bind sendmail_mpe_bind 1679 # define _exit sendmail_mpe__exit 1680 # define exit sendmail_mpe_exit 1681 # define fcntl sendmail_mpe_fcntl 1682 # define getegid sendmail_mpe_getegid 1683 # define geteuid sendmail_mpe_geteuid 1684 # define getpwnam sendmail_mpe_getpwnam 1685 # define getpwuid sendmail_mpe_getpwuid 1686 # define setgid sendmail_mpe_setgid 1687 # define setuid sendmail_mpe_setuid 1688 extern int sendmail_mpe_fcntl __P((int, int, ...)); 1689 extern struct passwd * sendmail_mpe_getpwnam __P((const char *)); 1690 extern struct passwd * sendmail_mpe_getpwuid __P((uid_t)); 1691 # endif /* MPE */ 1692 1693 /* 1694 ** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native) 1695 ** 1696 ** Contributed by Paul Gampe <paulg@apnic.net> 1697 */ 1698 1699 # ifdef __svr5__ 1700 # include <sys/mkdev.h> 1701 # define __svr4__ 1702 # define SYS5SIGNALS 1 1703 # define HASFCHOWN 1 /* has fchown(2) call */ 1704 # define HASSETSID 1 1705 # define HASSETREUID 1 1706 # define HASWAITPID 1 1707 # define HASGETDTABLESIZE 1 1708 # define GIDSET_T gid_t 1709 # define SOCKADDR_LEN_T size_t 1710 # define SOCKOPT_LEN_T size_t 1711 # ifndef _PATH_UNIX 1712 # define _PATH_UNIX "/stand/unix" 1713 # endif /* ! _PATH_UNIX */ 1714 # define SPT_PADCHAR '\0' /* pad process title with nulls */ 1715 # ifndef SYSLOG_BUFSIZE 1716 # define SYSLOG_BUFSIZE 1024 /* unsure */ 1717 # endif /* ! SYSLOG_BUFSIZE */ 1718 # ifndef _PATH_VENDOR_CF 1719 # define _PATH_VENDOR_CF "/etc/sendmail.cf" 1720 # endif /* ! _PATH_VENDOR_CF */ 1721 # ifndef _PATH_SENDMAILPID 1722 # define _PATH_SENDMAILPID "/etc/sendmail.pid" 1723 # endif /* ! _PATH_SENDMAILPID */ 1724 # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */ 1725 #if !defined(SM_SET_H_ERRNO) && defined(_REENTRANT) 1726 # define SM_SET_H_ERRNO(err) set_h_errno((err)) 1727 #endif /* ! SM_SET_H_ERRNO && _REENTRANT */ 1728 # endif /* __svr5__ */ 1729 1730 /* ###################################################################### */ 1731 1732 /* 1733 ** UnixWare 2.x 1734 */ 1735 1736 # ifdef UNIXWARE2 1737 # define UNIXWARE 1 1738 # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */ 1739 # endif /* UNIXWARE2 */ 1740 1741 1742 /* 1743 ** UnixWare 1.1.2. 1744 ** 1745 ** Updated by Petr Lampa <lampa@fee.vutbr.cz>. 1746 ** From Evan Champion <evanc@spatial.synapse.org>. 1747 */ 1748 1749 # ifdef UNIXWARE 1750 # include <sys/mkdev.h> 1751 # define SYSTEM5 1 1752 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1753 # define HASSETREUID 1 1754 # define HASSETSID 1 1755 # define HASINITGROUPS 1 1756 # define GIDSET_T gid_t 1757 # define SLEEP_T unsigned 1758 # define SFS_TYPE SFS_STATVFS 1759 # define LA_TYPE LA_ZERO 1760 # undef WIFEXITED 1761 # undef WEXITSTATUS 1762 # ifndef _PATH_UNIX 1763 # define _PATH_UNIX "/unix" 1764 # endif /* ! _PATH_UNIX */ 1765 # ifndef _PATH_VENDOR_CF 1766 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 1767 # endif /* ! _PATH_VENDOR_CF */ 1768 # ifndef _PATH_SENDMAILPID 1769 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 1770 # endif /* ! _PATH_SENDMAILPID */ 1771 # define SYSLOG_BUFSIZE 128 1772 # endif /* UNIXWARE */ 1773 1774 1775 /* 1776 ** Intergraph CLIX 3.1 1777 ** 1778 ** From Paul Southworth <pauls@locust.cic.net> 1779 */ 1780 1781 # ifdef CLIX 1782 # define SYSTEM5 1 /* looks like System V */ 1783 # ifndef HASGETUSERSHELL 1784 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1785 # endif /* ! HASGETUSERSHELL */ 1786 # define DEV_BSIZE 512 /* device block size not defined */ 1787 # define GIDSET_T gid_t 1788 # undef LOG /* syslog not available */ 1789 # define NEEDFSYNC 1 /* no fsync in system library */ 1790 # define GETSHORT _getshort 1791 # endif /* CLIX */ 1792 1793 1794 /* 1795 ** NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP 1796 ** 1797 ** From Kevin Darcy <kevin@tech.mis.cfc.com>. 1798 */ 1799 1800 # ifdef NCR_MP_RAS2 1801 # include <sys/sockio.h> 1802 # define __svr4__ 1803 # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 1804 # define SYSLOG_BUFSIZE 1024 1805 # define SPT_TYPE SPT_NONE 1806 # endif /* NCR_MP_RAS2 */ 1807 1808 1809 /* 1810 ** NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP 1811 ** 1812 ** From Tom Moore <Tom.Moore@DaytonOH.NCR.COM> 1813 */ 1814 1815 # ifdef NCR_MP_RAS3 1816 # define __svr4__ 1817 # define HASFCHOWN 1 /* has fchown(2) call */ 1818 # define LDA_USE_LOCKF 1 1819 # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM has non-std interface */ 1820 # define SO_REUSEADDR_IS_BROKEN 1 /* doesn't work if accept() fails */ 1821 # define SYSLOG_BUFSIZE 1024 1822 # define SPT_TYPE SPT_NONE 1823 # define _PATH_MAILDIR "/var/mail" 1824 # ifndef _XOPEN_SOURCE 1825 # define _XOPEN_SOURCE 1826 # define _XOPEN_SOURCE_EXTENDED 1 1827 # include <sys/resource.h> 1828 # undef _XOPEN_SOURCE 1829 # undef _XOPEN_SOURCE_EXTENDED 1830 # endif /* ! _XOPEN_SOURCE */ 1831 # endif /* NCR_MP_RAS3 */ 1832 1833 1834 /* 1835 ** Tandem NonStop-UX SVR4 1836 ** 1837 ** From Rick McCarty <mccarty@mpd.tandem.com>. 1838 */ 1839 1840 # ifdef NonStop_UX_BXX 1841 # define __svr4__ 1842 # endif /* NonStop_UX_BXX */ 1843 1844 1845 /* 1846 ** Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2. 1847 ** 1848 ** Tested for 1.04, 1.03 1849 ** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>. 1850 ** 1851 ** Tested for 4.02, 6.10 and 7.10 1852 ** From Motonori NAKAMURA <motonori@media.kyoto-u.ac.jp>. 1853 */ 1854 1855 # if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) 1856 # define SYSTEM5 1 /* include all the System V defines */ 1857 # define HASINITGROUPS 1 /* has initgroups(3) call */ 1858 # define HASFCHMOD 1 /* has fchmod(2) syscall */ 1859 # define setreuid(r, e) setresuid(r, e, -1) 1860 # define LA_TYPE LA_FLOAT 1861 # define SPT_TYPE SPT_PSTAT 1862 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1863 # ifndef HASSETVBUF 1864 # define HASSETVBUF /* HI-UX has no setlinebuf */ 1865 # endif /* ! HASSETVBUF */ 1866 # ifndef GIDSET_T 1867 # define GIDSET_T gid_t 1868 # endif /* ! GIDSET_T */ 1869 # ifndef _PATH_UNIX 1870 # define _PATH_UNIX "/HI-UX" 1871 # endif /* ! _PATH_UNIX */ 1872 # ifndef _PATH_VENDOR_CF 1873 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1874 # endif /* ! _PATH_VENDOR_CF */ 1875 # ifndef IDENTPROTO 1876 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1877 # endif /* ! IDENTPROTO */ 1878 # ifndef HASGETUSERSHELL 1879 # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 1880 # endif /* ! HASGETUSERSHELL */ 1881 # define FDSET_CAST (int *) /* cast for fd_set parameters to select */ 1882 1883 /* 1884 ** avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h 1885 ** on HIUX 3050 1886 */ 1887 # undef m_flags 1888 1889 # define SM_CONF_SYSLOG 0 1890 1891 # endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */ 1892 1893 1894 /* 1895 ** Amdahl UTS System V 2.1.5 (SVr3-based) 1896 ** 1897 ** From: Janet Jackson <janet@dialix.oz.au>. 1898 */ 1899 1900 # ifdef _UTS 1901 # include <sys/sysmacros.h> 1902 # undef HASLSTAT /* has symlinks, but they cause problems */ 1903 # define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */ 1904 # define SYS5SIGNALS 1 /* System V signal semantics */ 1905 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 1906 # define HASUNAME 1 /* use System V uname(2) system call */ 1907 # define HASINITGROUPS 1 /* has initgroups(3) function */ 1908 # define HASSETVBUF 1 /* has setvbuf(3) function */ 1909 # ifndef HASGETUSERSHELL 1910 # define HASGETUSERSHELL 0 /* does not have getusershell(3) function */ 1911 # endif /* ! HASGETUSERSHELL */ 1912 # define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */ 1913 # define LA_TYPE LA_ZERO /* doesn't have load average */ 1914 # define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */ 1915 # define SFS_BAVAIL f_bfree /* alternate field name */ 1916 # define _PATH_UNIX "/unix" 1917 # ifndef _PATH_VENDOR_CF 1918 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1919 # endif /* ! _PATH_VENDOR_CF */ 1920 # endif /* _UTS */ 1921 1922 /* 1923 ** Cray Computer Corporation's CSOS 1924 ** 1925 ** From Scott Bolte <scott@craycos.com>. 1926 */ 1927 1928 # ifdef _CRAYCOM 1929 # define SYSTEM5 1 /* include all the System V defines */ 1930 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1931 # define NEEDFSYNC 1 /* no fsync in system library */ 1932 # define MAXPATHLEN PATHSIZE 1933 # define LA_TYPE LA_ZERO 1934 # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1935 # define SFS_BAVAIL f_bfree /* alternate field name */ 1936 # define _POSIX_CHOWN_RESTRICTED -1 1937 extern struct group *getgrent(), *getgrnam(), *getgrgid(); 1938 # endif /* _CRAYCOM */ 1939 1940 1941 /* 1942 ** Sony NEWS-OS 4.2.1R and 6.0.3 1943 ** 1944 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 1945 */ 1946 1947 # ifdef sony_news 1948 # ifndef __svr4 1949 /* NEWS-OS 4.2.1R */ 1950 # ifndef BSD 1951 # define BSD /* has BSD routines */ 1952 # endif /* ! BSD */ 1953 # define HASUNSETENV 1 /* has unsetenv(2) call */ 1954 # undef HASSETVBUF /* don't actually have setvbuf(3) */ 1955 # define WAITUNION 1 /* use "union wait" as wait argument type */ 1956 # define LA_TYPE LA_INT 1957 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1958 # ifndef HASFLOCK 1959 # define HASFLOCK 1 /* has flock(2) call */ 1960 # endif /* ! HASFLOCK */ 1961 # define setpgid setpgrp 1962 # undef WIFEXITED 1963 # undef WEXITSTATUS 1964 # define MODE_T int /* system include files have no mode_t */ 1965 typedef int pid_t; 1966 typedef int (*sigfunc_t)(); 1967 # define SIGFUNC_DEFINED 1968 # define SIGFUNC_RETURN (0) 1969 # define SIGFUNC_DECL int 1970 1971 # else /* ! __svr4 */ 1972 /* NEWS-OS 6.0.3 with /bin/cc */ 1973 # ifndef __svr4__ 1974 # define __svr4__ /* use all System V Release 4 defines below */ 1975 # endif /* ! __svr4__ */ 1976 # define HASSETSID 1 /* has Posix setsid(2) call */ 1977 # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 1978 # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ 1979 # ifndef SPT_TYPE 1980 # define SPT_TYPE SPT_SYSMIPS /* use sysmips() (OS 6.0.2 or later) */ 1981 # endif /* ! SPT_TYPE */ 1982 # define GIDSET_T gid_t 1983 # undef WIFEXITED 1984 # undef WEXITSTATUS 1985 # ifndef SYSLOG_BUFSIZE 1986 # define SYSLOG_BUFSIZE 256 1987 # endif /* ! SYSLOG_BUFSIZE */ 1988 # define _PATH_UNIX "/stand/unix" 1989 # ifndef _PATH_VENDOR_CF 1990 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 1991 # endif /* ! _PATH_VENDOR_CF */ 1992 # ifndef _PATH_SENDMAILPID 1993 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 1994 # endif /* ! _PATH_SENDMAILPID */ 1995 1996 # endif /* ! __svr4 */ 1997 # endif /* sony_news */ 1998 1999 2000 /* 2001 ** Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach 2002 ** 2003 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 2004 */ 2005 2006 # ifdef luna 2007 # ifndef IDENTPROTO 2008 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 2009 # endif /* ! IDENTPROTO */ 2010 # define HASUNSETENV 1 /* has unsetenv(2) call */ 2011 # define NEEDPUTENV 1 /* need putenv(3) call */ 2012 # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 2013 # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 2014 # define WAITUNION 1 /* use "union wait" as wait argument type */ 2015 # ifdef uniosb 2016 # include <sys/time.h> 2017 # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 2018 # define LA_TYPE LA_INT 2019 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 2020 # endif /* uniosb */ 2021 # ifdef luna2 2022 # define LA_TYPE LA_SUBR 2023 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 2024 # endif /* luna2 */ 2025 # ifdef luna88k 2026 # define LA_TYPE LA_INT 2027 # endif /* luna88k */ 2028 # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 2029 # define setpgid setpgrp 2030 # undef WIFEXITED 2031 # undef WEXITSTATUS 2032 typedef int pid_t; 2033 typedef int (*sigfunc_t)(); 2034 # define SIGFUNC_DEFINED 2035 # define SIGFUNC_RETURN (0) 2036 # define SIGFUNC_DECL int 2037 extern char *getenv(); 2038 # ifndef _PATH_VENDOR_CF 2039 # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 2040 # endif /* ! _PATH_VENDOR_CF */ 2041 # endif /* luna */ 2042 2043 2044 /* 2045 ** NEC EWS-UX/V 4.2 (with /usr/ucb/cc) 2046 ** 2047 ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 2048 */ 2049 2050 # if defined(nec_ews_svr4) || defined(_nec_ews_svr4) 2051 # ifndef __svr4__ 2052 # define __svr4__ /* use all System V Release 4 defines below */ 2053 # endif /* ! __svr4__ */ 2054 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 2055 # define HASSETSID 1 /* has Posix setsid(2) call */ 2056 # define LA_TYPE LA_READKSYM /* use MIOC_READSYM ioctl */ 2057 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 2058 # define GIDSET_T gid_t 2059 # undef WIFEXITED 2060 # undef WEXITSTATUS 2061 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ 2062 # ifndef _PATH_VENDOR_CF 2063 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 2064 # endif /* ! _PATH_VENDOR_CF */ 2065 # ifndef _PATH_SENDMAILPID 2066 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 2067 # endif /* ! _PATH_SENDMAILPID */ 2068 # ifndef SYSLOG_BUFSIZE 2069 # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 2070 # endif /* ! SYSLOG_BUFSIZE */ 2071 # endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */ 2072 2073 2074 /* 2075 ** Fujitsu/ICL UXP/DS (For the DS/90 Series) 2076 ** 2077 ** From Diego R. Lopez <drlopez@cica.es>. 2078 ** Additional changes from Fumio Moriya and Toshiaki Nomura of the 2079 ** Fujitsu Fresoftware group <dsfrsoft@oai6.yk.fujitsu.co.jp>. 2080 */ 2081 2082 # ifdef __uxp__ 2083 # include <arpa/nameser.h> 2084 # include <sys/sysmacros.h> 2085 # include <sys/mkdev.h> 2086 # define __svr4__ 2087 # define HASGETUSERSHELL 0 2088 # define HASFLOCK 0 2089 # define _PATH_UNIX "/stand/unix" 2090 # ifndef _PATH_VENDOR_CF 2091 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 2092 # endif /* ! _PATH_VENDOR_CF */ 2093 # ifndef _PATH_SENDMAILPID 2094 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 2095 # endif /* ! _PATH_SENDMAILPID */ 2096 # endif /* __uxp__ */ 2097 2098 /* 2099 ** Pyramid DC/OSx 2100 ** 2101 ** From Earle Ake <akee@wpdiss1.wpafb.af.mil>. 2102 */ 2103 2104 # ifdef DCOSx 2105 # define GIDSET_T gid_t 2106 # ifndef IDENTPROTO 2107 # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 2108 # endif /* ! IDENTPROTO */ 2109 # endif /* DCOSx */ 2110 2111 /* 2112 ** Concurrent Computer Corporation Maxion 2113 ** 2114 ** From Donald R. Laster Jr. <laster@access.digex.net>. 2115 */ 2116 2117 # ifdef __MAXION__ 2118 2119 # include <sys/stream.h> 2120 # define __svr4__ 1 /* SVR4.2MP */ 2121 # define HASSETREUID 1 /* have setreuid(2) */ 2122 # define HASLSTAT 1 /* have lstat(2) */ 2123 # define HASSETRLIMIT 1 /* have setrlimit(2) */ 2124 # define HASGETDTABLESIZE 1 /* have getdtablesize(2) */ 2125 # define HASGETUSERSHELL 1 /* have getusershell(3) */ 2126 # define NOFTRUNCATE 1 /* do not have ftruncate(2) */ 2127 # define SLEEP_T unsigned 2128 # define SFS_TYPE SFS_STATVFS 2129 # define SFS_BAVAIL f_bavail 2130 # ifndef SYSLOG_BUFSIZE 2131 # define SYSLOG_BUFSIZE 256 /* Use 256 bytes */ 2132 # endif /* ! SYSLOG_BUFSIZE */ 2133 2134 # undef WUNTRACED 2135 # undef WIFEXITED 2136 # undef WIFSIGNALED 2137 # undef WIFSTOPPED 2138 # undef WEXITSTATUS 2139 # undef WTERMSIG 2140 # undef WSTOPSIG 2141 2142 # endif /* __MAXION__ */ 2143 2144 /* 2145 ** Harris Nighthawk PowerUX (nh6000 box) 2146 ** 2147 ** Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com> 2148 */ 2149 2150 # ifdef _PowerUX 2151 # ifndef __svr4__ 2152 # define __svr4__ 2153 # endif /* ! __svr4__ */ 2154 # ifndef _PATH_VENDOR_CF 2155 # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 2156 # endif /* ! _PATH_VENDOR_CF */ 2157 # ifndef _PATH_SENDMAILPID 2158 # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 2159 # endif /* ! _PATH_SENDMAILPID */ 2160 # define SYSLOG_BUFSIZE 1024 2161 # define LA_TYPE LA_ZERO 2162 typedef struct msgb mblk_t; 2163 # undef offsetof /* avoid stddefs.h and sys/sysmacros.h conflict */ 2164 # endif /* _PowerUX */ 2165 2166 /* 2167 ** Siemens Nixdorf Informationssysteme AG SINIX 2168 ** 2169 ** Contributed by Gerald Rinske of Siemens Business Services VAS. 2170 */ 2171 # ifdef sinix 2172 # define HASRANDOM 0 /* has random(3) */ 2173 # define SYSLOG_BUFSIZE 1024 2174 # define SM_INT32 int /* 32bit integer */ 2175 # endif /* sinix */ 2176 2177 /* 2178 ** CRAY T3E 2179 ** 2180 ** Contributed by Manu Mahonen <mailadm@csc.fi> 2181 ** of Center for Scientific Computing. 2182 */ 2183 # ifdef _CRAY 2184 # define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst) 2185 # define _PATH_MAILDIR "/usr/spool/mail" 2186 # if !defined(MAXPATHLEN) 2187 # define MAXPATHLEN PATHSIZE 2188 # endif /* !defined(MAXPATHLEN) */ 2189 # endif /* _CRAY */ 2190 2191 /* 2192 ** Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3 2193 ** 2194 ** Contributed by Sergey Rusanov <rsm@utfoms.udmnet.ru> 2195 */ 2196 2197 # ifdef MOTO 2198 # define HASFCHMOD 1 2199 # define HASSETRLIMIT 0 2200 # define HASSETSID 1 2201 # define HASSETREUID 1 2202 # define HASULIMIT 1 2203 # define HASWAITPID 1 2204 # define HASGETDTABLESIZE 1 2205 # define HASGETUSERSHELL 1 2206 # define IP_SRCROUTE 0 2207 # define IDENTPROTO 0 2208 # define RES_DNSRCH_VARIABLE _res_dnsrch 2209 # define _PATH_UNIX "/unix" 2210 # define _PATH_VENDOR_CF "/etc/sendmail.cf" 2211 # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 2212 # endif /* MOTO */ 2213 2214 2215 /********************************************************************** 2216 ** End of Per-Operating System defines 2217 **********************************************************************/ 2218 /********************************************************************** 2219 ** More general defines 2220 **********************************************************************/ 2221 2222 /* general BSD defines */ 2223 # ifdef BSD 2224 # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 2225 # ifndef HASSETREUID 2226 # define HASSETREUID 1 /* has setreuid(2) call */ 2227 # endif /* ! HASSETREUID */ 2228 # define HASINITGROUPS 1 /* has initgroups(3) call */ 2229 # ifndef IP_SRCROUTE 2230 # define IP_SRCROUTE 1 /* can check IP source routing */ 2231 # endif /* ! IP_SRCROUTE */ 2232 # ifndef HASSETRLIMIT 2233 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 2234 # endif /* ! HASSETRLIMIT */ 2235 # ifndef HASFLOCK 2236 # define HASFLOCK 1 /* has flock(2) call */ 2237 # endif /* ! HASFLOCK */ 2238 # ifndef TZ_TYPE 2239 # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */ 2240 # endif /* ! TZ_TYPE */ 2241 # endif /* BSD */ 2242 2243 /* general System V Release 4 defines */ 2244 # ifdef __svr4__ 2245 # define SYSTEM5 1 2246 # define USESETEUID 1 /* has usable seteuid(2) call */ 2247 # define HASINITGROUPS 1 /* has initgroups(3) call */ 2248 # define BSD_COMP 1 /* get BSD ioctl calls */ 2249 # ifndef HASSETRLIMIT 2250 # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 2251 # endif /* ! HASSETRLIMIT */ 2252 # ifndef HASGETUSERSHELL 2253 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 2254 # endif /* ! HASGETUSERSHELL */ 2255 # ifndef HASFCHMOD 2256 # define HASFCHMOD 1 /* most (all?) SVr4s seem to have fchmod(2) */ 2257 # endif /* ! HASFCHMOD */ 2258 2259 # ifndef _PATH_UNIX 2260 # define _PATH_UNIX "/unix" 2261 # endif /* ! _PATH_UNIX */ 2262 # ifndef _PATH_VENDOR_CF 2263 # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 2264 # endif /* ! _PATH_VENDOR_CF */ 2265 # ifndef _PATH_SENDMAILPID 2266 # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 2267 # endif /* ! _PATH_SENDMAILPID */ 2268 # ifndef SYSLOG_BUFSIZE 2269 # define SYSLOG_BUFSIZE 128 2270 # endif /* ! SYSLOG_BUFSIZE */ 2271 # ifndef SFS_TYPE 2272 # define SFS_TYPE SFS_STATVFS 2273 # endif /* ! SFS_TYPE */ 2274 2275 # ifndef USE_SIGLONGJMP 2276 # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ 2277 # endif /* ! USE_SIGLONGJMP */ 2278 # endif /* __svr4__ */ 2279 2280 # ifdef __SVR4 2281 # define LDA_USE_LOCKF 1 2282 # define LDA_USE_SETEUID 1 2283 # define _PATH_MAILDIR "/var/mail" 2284 # endif /* __SVR4 */ 2285 2286 /* general System V defines */ 2287 # ifdef SYSTEM5 2288 # include <sys/sysmacros.h> 2289 # define HASUNAME 1 /* use System V uname(2) system call */ 2290 # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 2291 # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 2292 # ifndef HASULIMIT 2293 # define HASULIMIT 1 /* has the ulimit(2) syscall */ 2294 # endif /* ! HASULIMIT */ 2295 # ifndef LA_TYPE 2296 # ifdef MIOC_READKSYM 2297 # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ 2298 # else /* MIOC_READKSYM */ 2299 # define LA_TYPE LA_INT /* assume integer load average */ 2300 # endif /* MIOC_READKSYM */ 2301 # endif /* ! LA_TYPE */ 2302 # ifndef SFS_TYPE 2303 # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 2304 # endif /* ! SFS_TYPE */ 2305 # ifndef TZ_TYPE 2306 # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 2307 # endif /* ! TZ_TYPE */ 2308 # endif /* SYSTEM5 */ 2309 2310 /* general POSIX defines */ 2311 # ifdef _POSIX_VERSION 2312 # define HASSETSID 1 /* has Posix setsid(2) call */ 2313 # define HASWAITPID 1 /* has Posix waitpid(2) call */ 2314 # if _POSIX_VERSION >= 199500 && !defined(USESETEUID) 2315 # define USESETEUID 1 /* has usable seteuid(2) call */ 2316 # endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */ 2317 # endif /* _POSIX_VERSION */ 2318 /* 2319 ** Tweaking for systems that (for example) claim to be BSD or POSIX 2320 ** but don't have all the standard BSD or POSIX routines (boo hiss). 2321 */ 2322 2323 # ifdef titan 2324 # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 2325 # endif /* titan */ 2326 2327 # ifdef _CRAYCOM 2328 # undef HASSETSID /* despite POSIX claim, doesn't have setsid */ 2329 # endif /* _CRAYCOM */ 2330 2331 # ifdef MOTO 2332 # undef USESETEUID 2333 # endif /* MOTO */ 2334 2335 /* 2336 ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 2337 ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 2338 ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 2339 ** are closed. Some firewalls return this error if you try to connect 2340 ** to the IDENT port (113), so you can't receive email from these hosts 2341 ** on these systems. The firewall really should use a more specific 2342 ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB. If 2343 ** not explicitly set to zero above, default it on. 2344 */ 2345 2346 # ifndef IDENTPROTO 2347 # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 2348 # endif /* ! IDENTPROTO */ 2349 2350 # ifndef IP_SRCROUTE 2351 # define IP_SRCROUTE 1 /* Detect IP source routing */ 2352 # endif /* ! IP_SRCROUTE */ 2353 2354 # ifndef HASGETUSERSHELL 2355 # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 2356 # endif /* ! HASGETUSERSHELL */ 2357 2358 # ifndef NETUNIX 2359 # define NETUNIX 1 /* include unix domain support */ 2360 # endif /* ! NETUNIX */ 2361 2362 # ifndef HASRANDOM 2363 # define HASRANDOM 1 /* has random(3) support */ 2364 # endif /* ! HASRANDOM */ 2365 2366 # ifndef HASFLOCK 2367 # define HASFLOCK 0 /* assume no flock(2) support */ 2368 # endif /* ! HASFLOCK */ 2369 2370 # ifndef HASSETREUID 2371 # define HASSETREUID 0 /* assume no setreuid(2) call */ 2372 # endif /* ! HASSETREUID */ 2373 2374 # ifndef HASFCHMOD 2375 # define HASFCHMOD 0 /* assume no fchmod(2) syscall */ 2376 # endif /* ! HASFCHMOD */ 2377 2378 # ifndef USESETEUID 2379 # define USESETEUID 0 /* assume no seteuid(2) call or no saved ids */ 2380 # endif /* ! USESETEUID */ 2381 2382 # ifndef HASSETRLIMIT 2383 # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */ 2384 # endif /* ! HASSETRLIMIT */ 2385 2386 # ifndef HASULIMIT 2387 # define HASULIMIT 0 /* assume no ulimit(2) support */ 2388 # endif /* ! HASULIMIT */ 2389 2390 # ifndef SECUREWARE 2391 # define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */ 2392 # endif /* ! SECUREWARE */ 2393 2394 # ifndef USE_DOUBLE_FORK 2395 # define USE_DOUBLE_FORK 1 /* avoid intermediate zombies */ 2396 # endif /* ! USE_DOUBLE_FORK */ 2397 2398 # ifndef USE_ENVIRON 2399 # define USE_ENVIRON 0 /* use main() envp instead of extern environ */ 2400 # endif /* ! USE_ENVIRON */ 2401 2402 # ifndef USE_SIGLONGJMP 2403 # define USE_SIGLONGJMP 0 /* assume setjmp handles signals properly */ 2404 # endif /* ! USE_SIGLONGJMP */ 2405 2406 # ifndef FDSET_CAST 2407 # define FDSET_CAST /* (empty) cast for fd_set arg to select */ 2408 # endif /* ! FDSET_CAST */ 2409 2410 /* 2411 ** Pick a mailer setuid method for changing the current uid 2412 */ 2413 2414 # define USE_SETEUID 0 2415 # define USE_SETREUID 1 2416 # define USE_SETUID 2 2417 2418 # if USESETEUID 2419 # define MAILER_SETUID_METHOD USE_SETEUID 2420 # else /* USESETEUID */ 2421 # if HASSETREUID 2422 # define MAILER_SETUID_METHOD USE_SETREUID 2423 # else /* HASSETREUID */ 2424 # define MAILER_SETUID_METHOD USE_SETUID 2425 # endif /* HASSETREUID */ 2426 # endif /* USESETEUID */ 2427 2428 /* 2429 ** If no type for argument two of getgroups call is defined, assume 2430 ** it's an integer -- unfortunately, there seem to be several choices 2431 ** here. 2432 */ 2433 2434 # ifndef GIDSET_T 2435 # define GIDSET_T int 2436 # endif /* ! GIDSET_T */ 2437 2438 # ifndef UID_T 2439 # define UID_T uid_t 2440 # endif /* ! UID_T */ 2441 2442 # ifndef GID_T 2443 # define GID_T gid_t 2444 # endif /* ! GID_T */ 2445 2446 # ifndef MODE_T 2447 # define MODE_T mode_t 2448 # endif /* ! MODE_T */ 2449 2450 # ifndef ARGV_T 2451 # define ARGV_T char ** 2452 # endif /* ! ARGV_T */ 2453 2454 # ifndef SOCKADDR_LEN_T 2455 # define SOCKADDR_LEN_T int 2456 # endif /* ! SOCKADDR_LEN_T */ 2457 2458 # ifndef SOCKOPT_LEN_T 2459 # define SOCKOPT_LEN_T int 2460 # endif /* ! SOCKOPT_LEN_T */ 2461 2462 # ifndef QUAD_T 2463 # define QUAD_T unsigned long 2464 # endif /* ! QUAD_T */ 2465 /********************************************************************** 2466 ** Remaining definitions should never have to be changed. They are 2467 ** primarily to provide back compatibility for older systems -- for 2468 ** example, it includes some POSIX compatibility definitions 2469 **********************************************************************/ 2470 2471 /* System 5 compatibility */ 2472 # ifndef S_ISREG 2473 # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 2474 # endif /* ! S_ISREG */ 2475 # ifndef S_ISDIR 2476 # define S_ISDIR(foo) ((foo & S_IFMT) == S_IFDIR) 2477 # endif /* ! S_ISDIR */ 2478 # if !defined(S_ISLNK) && defined(S_IFLNK) 2479 # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 2480 # endif /* !defined(S_ISLNK) && defined(S_IFLNK) */ 2481 # if !defined(S_ISFIFO) 2482 # if defined(S_IFIFO) 2483 # define S_ISFIFO(foo) ((foo & S_IFMT) == S_IFIFO) 2484 # else /* defined(S_IFIFO) */ 2485 # define S_ISFIFO(foo) false 2486 # endif /* defined(S_IFIFO) */ 2487 # endif /* !defined(S_ISFIFO) */ 2488 # ifndef S_IRUSR 2489 # define S_IRUSR 0400 2490 # endif /* ! S_IRUSR */ 2491 # ifndef S_IWUSR 2492 # define S_IWUSR 0200 2493 # endif /* ! S_IWUSR */ 2494 # ifndef S_IRGRP 2495 # define S_IRGRP 0040 2496 # endif /* ! S_IRGRP */ 2497 # ifndef S_IWGRP 2498 # define S_IWGRP 0020 2499 # endif /* ! S_IWGRP */ 2500 # ifndef S_IROTH 2501 # define S_IROTH 0004 2502 # endif /* ! S_IROTH */ 2503 # ifndef S_IWOTH 2504 # define S_IWOTH 0002 2505 # endif /* ! S_IWOTH */ 2506 2507 /* close-on-exec flag */ 2508 # ifndef FD_CLOEXEC 2509 # define FD_CLOEXEC 1 2510 # endif /* ! FD_CLOEXEC */ 2511 2512 /* 2513 ** Older systems don't have this error code -- it should be in 2514 ** /usr/include/sysexits.h. 2515 */ 2516 2517 # ifndef EX_CONFIG 2518 # define EX_CONFIG 78 /* configuration error */ 2519 # endif /* ! EX_CONFIG */ 2520 2521 /* pseudo-codes */ 2522 # define EX_QUIT 22 /* drop out of server immediately */ 2523 # define EX_RESTART 23 /* restart sendmail daemon */ 2524 # define EX_SHUTDOWN 24 /* shutdown sendmail daemon */ 2525 2526 #ifndef EX_NOTFOUND 2527 # define EX_NOTFOUND EX_NOHOST 2528 #endif /* ! EX_NOTFOUND */ 2529 2530 /* pseudo-code used for mci_setstat */ 2531 # define EX_NOTSTICKY -5 /* don't save persistent status */ 2532 2533 2534 /* 2535 ** An "impossible" file mode to indicate that the file does not exist. 2536 */ 2537 2538 # define ST_MODE_NOFILE 0171147 /* unlikely to occur */ 2539 2540 2541 /* type of arbitrary pointer */ 2542 # ifndef ARBPTR_T 2543 # define ARBPTR_T void * 2544 # endif /* ! ARBPTR_T */ 2545 2546 # ifndef __P 2547 # include "sm/cdefs.h" 2548 # endif /* ! __P */ 2549 2550 # if HESIOD && !defined(NAMED_BIND) 2551 # define NAMED_BIND 1 /* not one without the other */ 2552 # endif /* HESIOD && !defined(NAMED_BIND) */ 2553 2554 # if NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) 2555 extern int h_errno; 2556 # endif /* NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) */ 2557 2558 # if NEEDPUTENV 2559 extern int putenv __P((char *)); 2560 # endif /* NEEDPUTENV */ 2561 2562 #if !HASUNSETENV 2563 extern void unsetenv __P((char *)); 2564 #endif /* !HASUNSETENV */ 2565 2566 # ifdef LDAPMAP 2567 # include <sys/time.h> 2568 # include <lber.h> 2569 # include <ldap.h> 2570 2571 /* Some LDAP constants */ 2572 # define LDAPMAP_FALSE 0 2573 # define LDAPMAP_TRUE 1 2574 2575 /* 2576 ** ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1. 2577 ** Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations 2578 ** and assume (falsely) that all old API implementations are broken. 2579 ** (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT) 2580 */ 2581 2582 # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) 2583 # define USE_LDAP_INIT 1 2584 # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) */ 2585 2586 /* 2587 ** LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x, 2588 ** hence ldap_set_option() must not exist. 2589 */ 2590 2591 # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) 2592 # define USE_LDAP_SET_OPTION 1 2593 # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) */ 2594 2595 # endif /* LDAPMAP */ 2596 2597 # if HASUNAME 2598 # include <sys/utsname.h> 2599 # ifdef newstr 2600 # undef newstr 2601 # endif /* newstr */ 2602 # else /* HASUNAME */ 2603 # define NODE_LENGTH 32 2604 struct utsname 2605 { 2606 char nodename[NODE_LENGTH + 1]; 2607 }; 2608 # endif /* HASUNAME */ 2609 2610 # if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) 2611 # define MAXHOSTNAMELEN 256 2612 # endif /* !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) */ 2613 2614 # if !defined(SIGCHLD) && defined(SIGCLD) 2615 # define SIGCHLD SIGCLD 2616 # endif /* !defined(SIGCHLD) && defined(SIGCLD) */ 2617 2618 # ifndef STDIN_FILENO 2619 # define STDIN_FILENO 0 2620 # endif /* ! STDIN_FILENO */ 2621 2622 # ifndef STDOUT_FILENO 2623 # define STDOUT_FILENO 1 2624 # endif /* ! STDOUT_FILENO */ 2625 2626 # ifndef STDERR_FILENO 2627 # define STDERR_FILENO 2 2628 # endif /* ! STDERR_FILENO */ 2629 2630 # ifndef LOCK_SH 2631 # define LOCK_SH 0x01 /* shared lock */ 2632 # define LOCK_EX 0x02 /* exclusive lock */ 2633 # define LOCK_NB 0x04 /* non-blocking lock */ 2634 # define LOCK_UN 0x08 /* unlock */ 2635 # endif /* ! LOCK_SH */ 2636 2637 # ifndef S_IXOTH 2638 # define S_IXOTH (S_IEXEC >> 6) 2639 # endif /* ! S_IXOTH */ 2640 2641 # ifndef S_IXGRP 2642 # define S_IXGRP (S_IEXEC >> 3) 2643 # endif /* ! S_IXGRP */ 2644 2645 # ifndef S_IXUSR 2646 # define S_IXUSR (S_IEXEC) 2647 # endif /* ! S_IXUSR */ 2648 2649 #ifndef O_ACCMODE 2650 # define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) 2651 #endif /* ! O_ACCMODE */ 2652 2653 # ifndef SEEK_SET 2654 # define SEEK_SET 0 2655 # define SEEK_CUR 1 2656 # define SEEK_END 2 2657 # endif /* ! SEEK_SET */ 2658 2659 # ifndef SIG_ERR 2660 # define SIG_ERR ((void (*)()) -1) 2661 # endif /* ! SIG_ERR */ 2662 2663 # ifndef WEXITSTATUS 2664 # define WEXITSTATUS(st) (((st) >> 8) & 0377) 2665 # endif /* ! WEXITSTATUS */ 2666 # ifndef WIFEXITED 2667 # define WIFEXITED(st) (((st) & 0377) == 0) 2668 # endif /* ! WIFEXITED */ 2669 # ifndef WIFSTOPPED 2670 # define WIFSTOPPED(st) (((st) & 0100) == 0) 2671 # endif /* ! WIFSTOPPED */ 2672 # ifndef WCOREDUMP 2673 # define WCOREDUMP(st) (((st) & 0200) != 0) 2674 # endif /* ! WCOREDUMP */ 2675 # ifndef WTERMSIG 2676 # define WTERMSIG(st) (((st) & 0177)) 2677 # endif /* ! WTERMSIG */ 2678 2679 # ifndef SIGFUNC_DEFINED 2680 typedef void (*sigfunc_t) __P((int)); 2681 # endif /* ! SIGFUNC_DEFINED */ 2682 # ifndef SIGFUNC_RETURN 2683 # define SIGFUNC_RETURN 2684 # endif /* ! SIGFUNC_RETURN */ 2685 # ifndef SIGFUNC_DECL 2686 # define SIGFUNC_DECL void 2687 # endif /* ! SIGFUNC_DECL */ 2688 2689 /* size of syslog buffer */ 2690 # ifndef SYSLOG_BUFSIZE 2691 # define SYSLOG_BUFSIZE 1024 2692 # endif /* ! SYSLOG_BUFSIZE */ 2693 2694 /* 2695 ** Size of prescan buffer. 2696 ** Despite comments in the _sendmail_ book, this probably should 2697 ** not be changed; there are some hard-to-define dependencies. 2698 */ 2699 2700 # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 2701 2702 /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 2703 # ifndef FORK 2704 # define FORK fork /* function to call to fork mailer */ 2705 # endif /* ! FORK */ 2706 2707 /* setting h_errno */ 2708 # ifndef SM_SET_H_ERRNO 2709 # define SM_SET_H_ERRNO(err) h_errno = (err) 2710 # endif /* SM_SET_H_ERRNO */ 2711 2712 # ifndef SM_CONF_GETOPT 2713 # define SM_CONF_GETOPT 1 2714 # endif /* ! SM_CONF_GETOPT */ 2715 2716 /* random routine -- set above using #ifdef _osname_ or in Makefile */ 2717 # if HASRANDOM 2718 # define get_random() random() 2719 # else /* HASRANDOM */ 2720 # define get_random() ((long) rand()) 2721 # ifndef RANDOMSHIFT 2722 # define RANDOMSHIFT 8 2723 # endif /* ! RANDOMSHIFT */ 2724 # endif /* HASRANDOM */ 2725 2726 /* 2727 ** Default to using scanf in readcf. 2728 */ 2729 2730 # ifndef SCANF 2731 # define SCANF 1 2732 # endif /* ! SCANF */ 2733 2734 /* XXX 32 bit type */ 2735 # ifndef SM_INT32 2736 # define SM_INT32 int32_t 2737 # endif /* ! SM_INT32 */ 2738 2739 /* 2740 ** SVr4 and similar systems use different routines for setjmp/longjmp 2741 ** with signal support 2742 */ 2743 2744 # if USE_SIGLONGJMP 2745 # ifdef jmp_buf 2746 # undef jmp_buf 2747 # endif /* jmp_buf */ 2748 # define jmp_buf sigjmp_buf 2749 # ifdef setjmp 2750 # undef setjmp 2751 # endif /* setjmp */ 2752 # define setjmp(env) sigsetjmp(env, 1) 2753 # ifdef longjmp 2754 # undef longjmp 2755 # endif /* longjmp */ 2756 # define longjmp(env, val) siglongjmp(env, val) 2757 # endif /* USE_SIGLONGJMP */ 2758 2759 # if !defined(NGROUPS_MAX) && defined(NGROUPS) 2760 # define NGROUPS_MAX NGROUPS /* POSIX naming convention */ 2761 # endif /* !defined(NGROUPS_MAX) && defined(NGROUPS) */ 2762 2763 /* 2764 ** Some snprintf() implementations are rumored not to NUL terminate. 2765 */ 2766 # if SNPRINTF_IS_BROKEN 2767 # ifdef snprintf 2768 # undef snprintf 2769 # endif /* snprintf */ 2770 # define snprintf sm_snprintf 2771 # ifdef vsnprintf 2772 # undef vsnprintf 2773 # endif /* vsnprintf */ 2774 # define vsnprintf sm_vsnprintf 2775 # endif /* SNPRINTF_IS_BROKEN */ 2776 2777 /* 2778 ** If we don't have a system syslog, simulate it. 2779 */ 2780 2781 # if !LOG 2782 # define LOG_EMERG 0 /* system is unusable */ 2783 # define LOG_ALERT 1 /* action must be taken immediately */ 2784 # define LOG_CRIT 2 /* critical conditions */ 2785 # define LOG_ERR 3 /* error conditions */ 2786 # define LOG_WARNING 4 /* warning conditions */ 2787 # define LOG_NOTICE 5 /* normal but significant condition */ 2788 # define LOG_INFO 6 /* informational */ 2789 # define LOG_DEBUG 7 /* debug-level messages */ 2790 # endif /* !LOG */ 2791 2792 # ifndef SM_CONF_SYSLOG 2793 # define SM_CONF_SYSLOG 1 /* syslog.h has prototype for syslog() */ 2794 # endif /* SM_CONF_SYSLOG */ 2795 2796 # if !SM_CONF_SYSLOG 2797 # ifdef __STDC__ 2798 extern void syslog(int, const char *, ...); 2799 # else /* __STDC__ */ 2800 extern void syslog(); 2801 # endif /* __STDC__ */ 2802 # endif /* !SM_CONF_SYSLOG */ 2803 2804 /* portable(?) definition for alignment */ 2805 # ifndef SM_ALIGN_SIZE 2806 struct sm_align 2807 { 2808 char al_c; 2809 union 2810 { 2811 long al_l; 2812 void *al_p; 2813 double al_d; 2814 void (*al_f)(); 2815 } al_u; 2816 }; 2817 # define SM_ALIGN_SIZE offsetof(struct sm_align, al_u) 2818 # endif /* ! SM_ALIGN_SIZE */ 2819 # define SM_ALIGN_BITS (SM_ALIGN_SIZE - 1) 2820 2821 #endif /* ! SM_CONF_H */ 2822