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