1 /* $NetBSD: sys_defs.h,v 1.1.1.1 2009/06/23 10:09:01 tron Exp $ */ 2 3 #ifndef _SYS_DEFS_H_INCLUDED_ 4 #define _SYS_DEFS_H_INCLUDED_ 5 6 /*++ 7 /* NAME 8 /* sys_defs 3h 9 /* SUMMARY 10 /* portability header 11 /* SYNOPSIS 12 /* #include <sys_defs.h> 13 /* DESCRIPTION 14 /* .nf 15 16 /* 17 * Specific platforms. Major release numbers differ for a good reason. So be 18 * a good girl, plan for the future, and at least include the major release 19 * number in the system type (for example, SUNOS5 or FREEBSD2). The system 20 * type is determined by the makedefs shell script in the top-level 21 * directory. Adding support for a new system type means updating the 22 * makedefs script, and adding a section below for the new system. 23 */ 24 25 /* 26 * 4.4BSD and close derivatives. 27 */ 28 #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \ 29 || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \ 30 || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \ 31 || defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \ 32 || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \ 33 || defined(NETBSD4) \ 34 || defined(EKKOBSD1) 35 #define SUPPORTED 36 #include <sys/types.h> 37 #include <sys/param.h> 38 #define UINT32_TYPE unsigned int 39 #define UINT16_TYPE unsigned short 40 #define USE_PATHS_H 41 #define HAS_FLOCK_LOCK 42 #define HAS_FCNTL_LOCK 43 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK 44 #define DEF_MAILBOX_LOCK "flock, dotlock" 45 #define HAS_SUN_LEN 46 #define HAS_FSYNC 47 #define HAS_DB 48 #define HAS_SA_LEN 49 #define DEF_DB_TYPE "hash" 50 #if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104250000) 51 #define ALIAS_DB_MAP "hash:/etc/mail/aliases" /* sendmail 8.10 */ 52 #endif 53 #if (defined(OpenBSD) && OpenBSD >= 200006) 54 #define ALIAS_DB_MAP "hash:/etc/mail/aliases" /* OpenBSD 2.7 */ 55 #endif 56 #ifndef ALIAS_DB_MAP 57 #define ALIAS_DB_MAP "hash:/etc/aliases" 58 #endif 59 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 60 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin" 61 #if (defined(__NetBSD_Version__) && __NetBSD_Version__ > 299000900) 62 # define USE_STATVFS 63 # define STATVFS_IN_SYS_STATVFS_H 64 #else 65 # define USE_STATFS 66 # define STATFS_IN_SYS_MOUNT_H 67 #endif 68 #define HAS_POSIX_REGEXP 69 #define HAS_ST_GEN /* struct stat contains inode 70 * generation number */ 71 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail" 72 #define NATIVE_MAILQ_PATH "/usr/bin/mailq" 73 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" 74 #define NATIVE_COMMAND_DIR "/usr/sbin" 75 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 76 #endif 77 78 #ifdef FREEBSD2 79 #define getsid(p) getpgrp() 80 #ifndef CMSG_SPACE 81 #define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len)) 82 #endif 83 #ifndef CMSG_LEN 84 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) 85 #endif 86 #ifndef CMSG_ALIGN 87 #define CMSG_ALIGN(n) ALIGN(n) 88 #endif 89 #endif /* FREEBSD2 */ 90 91 #ifdef BSDI4 92 /* #define HAS_IPV6 find out interface lookup method */ 93 #endif 94 95 /* __FreeBSD_version version is major+minor */ 96 97 #if __FreeBSD_version >= 220000 98 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom" /* introduced 2.1.5 */ 99 #endif 100 101 #if __FreeBSD_version >= 300000 102 #define HAS_ISSETUGID 103 #define HAS_FUTIMES 104 #endif 105 106 #if __FreeBSD_version >= 400000 107 #define SOCKADDR_SIZE socklen_t 108 #define SOCKOPT_SIZE socklen_t 109 #endif 110 111 #if __FreeBSD_version >= 420000 112 #define HAS_DUPLEX_PIPE /* 4.1 breaks with kqueue(2) */ 113 #endif 114 115 /* OpenBSD version is year+month */ 116 117 #if OpenBSD >= 199805 /* XXX */ 118 #define HAS_FUTIMES /* XXX maybe earlier */ 119 #endif 120 121 #if (defined(OpenBSD) && OpenBSD >= 199608) 122 #define PREFERRED_RAND_SOURCE "dev:/dev/arandom" /* XXX earlier */ 123 #endif 124 125 #if OpenBSD >= 200000 /* XXX */ 126 #define HAS_ISSETUGID 127 #endif 128 129 #if OpenBSD >= 200200 /* XXX */ 130 #define SOCKADDR_SIZE socklen_t 131 #define SOCKOPT_SIZE socklen_t 132 #endif 133 134 #if OpenBSD >= 200405 /* 3.5 */ 135 #define HAS_CLOSEFROM 136 #endif 137 138 /* __NetBSD_Version__ is major+minor */ 139 140 #if __NetBSD_Version__ >= 103000000 /* XXX maybe earlier */ 141 #undef DEF_MAILBOX_LOCK 142 #define DEF_MAILBOX_LOCK "flock, dotlock" 143 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom" /* XXX maybe earlier */ 144 #endif 145 146 #if __NetBSD_Version__ >= 105000000 147 #define HAS_ISSETUGID /* XXX maybe earlier */ 148 #endif 149 150 #if __NetBSD_Version__ >= 106000000 /* XXX maybe earlier */ 151 #define SOCKADDR_SIZE socklen_t 152 #define SOCKOPT_SIZE socklen_t 153 #endif 154 155 #if __NetBSD_Version__ >= 299000900 /* 2.99.9 */ 156 #define HAS_CLOSEFROM 157 #endif 158 159 #if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 102000000) 160 #define HAS_FUTIMES 161 #endif 162 163 #if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 105000000) \ 164 || (defined(__FreeBSD__) && __FreeBSD__ >= 4) \ 165 || (defined(OpenBSD) && OpenBSD >= 200003) \ 166 || defined(USAGI_LIBINET6) 167 #ifndef NO_IPV6 168 # define HAS_IPV6 169 # define HAVE_GETIFADDRS 170 #endif 171 172 #if (defined(__FreeBSD_version) && __FreeBSD_version >= 300000) \ 173 || (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 103000000) \ 174 || (defined(OpenBSD) && OpenBSD >= 199700) /* OpenBSD 2.0?? */ 175 # define USE_SYSV_POLL 176 #endif 177 178 #ifndef NO_KQUEUE 179 # if (defined(__FreeBSD_version) && __FreeBSD_version >= 410000) \ 180 || (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 200000000) \ 181 || (defined(OpenBSD) && OpenBSD >= 200105) /* OpenBSD 2.9 */ 182 # define EVENTS_STYLE EVENTS_STYLE_KQUEUE 183 # endif 184 #endif 185 186 #endif 187 188 /* 189 * UNIX on MAC. 190 */ 191 #if defined(RHAPSODY5) || defined(MACOSX) 192 #define SUPPORTED 193 #include <sys/types.h> 194 #define UINT32_TYPE unsigned int 195 #define UINT16_TYPE unsigned short 196 #define USE_PATHS_H 197 #define HAS_FLOCK_LOCK 198 #define HAS_FCNTL_LOCK 199 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK 200 #define DEF_MAILBOX_LOCK "flock, dotlock" 201 #define HAS_SUN_LEN 202 #define HAS_FSYNC 203 #define HAS_DB 204 #define HAS_SA_LEN 205 #define DEF_DB_TYPE "hash" 206 #define ALIAS_DB_MAP "hash:/etc/aliases" 207 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 208 #define RESOLVE_H_NEEDS_NAMESER8_COMPAT_H 209 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin" 210 #define USE_STATFS 211 #define STATFS_IN_SYS_MOUNT_H 212 #define HAS_POSIX_REGEXP 213 #define NORETURN void 214 #define PRINTFLIKE(x,y) 215 #define SCANFLIKE(x,y) 216 #ifndef NO_NETINFO 217 # define HAS_NETINFO 218 #endif 219 #ifndef NO_IPV6 220 # define HAS_IPV6 221 # define HAVE_GETIFADDRS 222 #endif 223 #define HAS_FUTIMES /* XXX Guessing */ 224 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail" 225 #define NATIVE_MAILQ_PATH "/usr/bin/mailq" 226 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" 227 #define NATIVE_COMMAND_DIR "/usr/sbin" 228 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 229 #define SOCKADDR_SIZE socklen_t 230 #define SOCKOPT_SIZE socklen_t 231 #ifndef NO_KQUEUE 232 # define EVENTS_STYLE EVENTS_STYLE_KQUEUE 233 # define USE_SYSV_POLL 234 #endif 235 236 #endif 237 238 /* 239 * Ultrix 4.x, a sort of 4.[1-2] BSD system with System V.2 compatibility 240 * and POSIX. 241 */ 242 #ifdef ULTRIX4 243 #define SUPPORTED 244 #define UINT32_TYPE unsigned int 245 #define UINT16_TYPE unsigned short 246 /* Ultrix by default has only 64 descriptors per process */ 247 #ifndef FD_SETSIZE 248 #define FD_SETSIZE 96 249 #endif 250 #include <sys/types.h> 251 #define _PATH_MAILDIR "/var/spool/mail" 252 #define _PATH_BSHELL "/bin/sh" 253 #define _PATH_DEFPATH "/bin:/usr/bin:/usr/ucb" 254 #define _PATH_STDPATH "/bin:/usr/bin:/usr/etc:/usr/ucb" 255 #define HAS_FLOCK_LOCK 256 #define HAS_FCNTL_LOCK 257 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK 258 #define DEF_MAILBOX_LOCK "flock, dotlock" 259 #define HAS_FSYNC 260 /* might be set by makedef */ 261 #ifdef HAS_DB 262 #define DEF_DB_TYPE "hash" 263 #define ALIAS_DB_MAP "hash:/etc/aliases" 264 #else 265 #define HAS_DBM 266 #define DEF_DB_TYPE "dbm" 267 #define ALIAS_DB_MAP "dbm:/etc/aliases" 268 #endif 269 extern int optind; 270 extern char *optarg; 271 extern int opterr; 272 extern int h_errno; 273 274 #define MISSING_STRFTIME_E 275 #define HAS_NIS 276 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 277 #define ROOT_PATH "/bin:/usr/bin:/etc:/usr/etc:/usr/ucb" 278 #define USE_STATFS 279 #define USE_STRUCT_FS_DATA 280 #define STATFS_IN_SYS_MOUNT_H 281 /* Ultrix misses just S_ISSOCK, the others are there */ 282 #define S_ISSOCK(mode) (((mode) & (S_IFMT)) == (S_IFSOCK)) 283 #define DUP2_DUPS_CLOSE_ON_EXEC 284 #define MISSING_USLEEP 285 #define NO_HERRNO 286 #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail" 287 #define NATIVE_COMMAND_DIR "/usr/etc" 288 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 289 #endif 290 291 /* 292 * OSF, then Digital UNIX, then Compaq. A BSD-flavored hybrid. 293 */ 294 #ifdef OSF1 295 #define SUPPORTED 296 #include <sys/types.h> 297 #define UINT32_TYPE unsigned int 298 #define UINT16_TYPE unsigned short 299 #define MISSING_SETENV 300 #define USE_PATHS_H 301 #define _PATH_DEFPATH "/usr/bin:/usr/ucb" 302 #define HAS_FLOCK_LOCK 303 #define HAS_FCNTL_LOCK 304 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK 305 #define DEF_MAILBOX_LOCK "flock, dotlock" 306 #define HAS_FSYNC 307 #define HAVE_BASENAME 308 #define HAS_DBM 309 #define DEF_DB_TYPE "dbm" 310 #define ALIAS_DB_MAP "dbm:/var/adm/sendmail/aliases" 311 extern int optind; /* XXX use <getopt.h> */ 312 extern char *optarg; /* XXX use <getopt.h> */ 313 extern int opterr; /* XXX use <getopt.h> */ 314 315 #define HAS_NIS 316 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 317 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb" 318 #define USE_STATFS 319 #define STATFS_IN_SYS_MOUNT_H 320 #define HAS_POSIX_REGEXP 321 #define BROKEN_WRITE_SELECT_ON_NON_BLOCKING_PIPE 322 #define NO_MSGHDR_MSG_CONTROL 323 #ifndef NO_IPV6 324 # define HAS_IPV6 325 #endif 326 327 #endif 328 329 /* 330 * SunOS 4.x, a mostly 4.[2-3] BSD system with System V.2 compatibility and 331 * POSIX support. 332 */ 333 #ifdef SUNOS4 334 #define SUPPORTED 335 #include <sys/types.h> 336 #include <memory.h> 337 #define UINT32_TYPE unsigned int 338 #define UINT16_TYPE unsigned short 339 #define UNSAFE_CTYPE 340 #define fpos_t long 341 #define MISSING_SETENV 342 #define MISSING_STRERROR 343 #define MISSING_STRTOUL 344 #define _PATH_MAILDIR "/var/spool/mail" 345 #define _PATH_BSHELL "/bin/sh" 346 #define _PATH_DEFPATH "/usr/bin:/usr/ucb" 347 #define _PATH_STDPATH "/usr/bin:/usr/etc:/usr/ucb" 348 #define HAS_FLOCK_LOCK 349 #define HAS_FCNTL_LOCK 350 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK 351 #define DEF_MAILBOX_LOCK "flock, dotlock" 352 #define HAS_FSYNC 353 #define HAS_DBM 354 #define DEF_DB_TYPE "dbm" 355 #define ALIAS_DB_MAP "dbm:/etc/aliases" 356 extern int optind; 357 extern char *optarg; 358 extern int opterr; 359 360 #define HAS_NIS 361 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 362 #define ROOT_PATH "/bin:/usr/bin:/etc:/usr/etc:/usr/ucb" 363 #define USE_STATFS 364 #define STATFS_IN_SYS_VFS_H 365 #define memmove(d,s,l) bcopy(s,d,l) 366 #define NO_HERRNO 367 #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail" 368 #define NATIVE_MAILQ_PATH "/usr/ucb/mailq" 369 #define NATIVE_NEWALIAS_PATH "/usr/ucb/newaliases" 370 #define NATIVE_COMMAND_DIR "/usr/etc" 371 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 372 #define STRCASECMP_IN_STRINGS_H 373 #define OCTAL_TO_UNSIGNED(res, str) sscanf((str), "%o", &(res)) 374 #define size_t unsigned 375 #define ssize_t int 376 #define getsid getpgrp 377 #endif 378 379 /* 380 * SunOS 5.x, mostly System V Release 4. 381 */ 382 #ifdef SUNOS5 383 #define SUPPORTED 384 #define _SVID_GETTOD /* Solaris 2.5, XSH4.2 versus SVID */ 385 #include <sys/types.h> 386 #define UINT32_TYPE unsigned int 387 #define UINT16_TYPE unsigned short 388 #define MISSING_SETENV 389 #define _PATH_MAILDIR "/var/mail" 390 #define _PATH_BSHELL "/bin/sh" 391 #define _PATH_DEFPATH "/usr/bin:/usr/ucb" 392 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb" 393 #define HAS_FCNTL_LOCK 394 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 395 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 396 #define HAS_FSYNC 397 #define HAS_DBM 398 #define DEF_DB_TYPE "dbm" 399 #define ALIAS_DB_MAP "dbm:/etc/mail/aliases" 400 #define HAS_NIS 401 #define HAS_NISPLUS 402 #define USE_SYS_SOCKIO_H /* Solaris 2.5, changed sys/ioctl.h */ 403 #define GETTIMEOFDAY(t) gettimeofday(t) 404 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb" 405 #define FIONREAD_IN_SYS_FILIO_H 406 #define USE_STATVFS 407 #define STATVFS_IN_SYS_STATVFS_H 408 #define INT_MAX_IN_LIMITS_H 409 #define STREAM_CONNECTIONS /* avoid UNIX-domain sockets */ 410 #define LOCAL_LISTEN stream_listen 411 #define LOCAL_ACCEPT stream_accept 412 #define LOCAL_CONNECT stream_connect 413 #define LOCAL_TRIGGER stream_trigger 414 #define LOCAL_SEND_FD stream_send_fd 415 #define LOCAL_RECV_FD stream_recv_fd 416 #define HAS_VOLATILE_LOCKS 417 #define BROKEN_READ_SELECT_ON_TCP_SOCKET 418 #define CANT_WRITE_BEFORE_SENDING_FD 419 #ifndef NO_POSIX_REGEXP 420 # define HAS_POSIX_REGEXP 421 #endif 422 #ifndef NO_IPV6 423 # define HAS_IPV6 424 # define HAS_SIOCGLIF 425 #endif 426 #ifndef NO_CLOSEFROM 427 # define HAS_CLOSEFROM 428 #endif 429 #ifndef NO_DEV_URANDOM 430 # define PREFERRED_RAND_SOURCE "dev:/dev/urandom" 431 #endif 432 #ifndef NO_FUTIMESAT 433 # define HAS_FUTIMESAT 434 #endif 435 #define USE_SYSV_POLL 436 #ifndef NO_DEVPOLL 437 # define EVENTS_STYLE EVENTS_STYLE_DEVPOLL 438 #endif 439 440 /* 441 * Allow build environment to override paths. 442 */ 443 #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail" 444 #define NATIVE_MAILQ_PATH "/usr/bin/mailq" 445 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" 446 #define NATIVE_COMMAND_DIR "/usr/sbin" 447 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 448 #endif 449 450 /* 451 * UnixWare, System Release 4. 452 */ 453 #ifdef UW7 /* UnixWare 7 */ 454 #define SUPPORTED 455 #include <sys/types.h> 456 #define UINT32_TYPE unsigned int 457 #define UINT16_TYPE unsigned short 458 #define _PATH_MAILDIR "/var/mail" 459 #define _PATH_BSHELL "/bin/sh" 460 #define _PATH_DEFPATH "/usr/bin:/usr/ucb" 461 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb" 462 #define MISSING_SETENV 463 #define HAS_FCNTL_LOCK 464 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 465 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 466 #define HAS_FSYNC 467 #define HAS_DBM 468 #define DEF_DB_TYPE "dbm" 469 #define ALIAS_DB_MAP "dbm:/etc/mail/aliases" 470 #define HAS_NIS 471 #define USE_SYS_SOCKIO_H 472 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 473 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb" 474 #define FIONREAD_IN_SYS_FILIO_H 475 #define DBM_NO_TRAILING_NULL 476 #define USE_STATVFS 477 #define STATVFS_IN_SYS_STATVFS_H 478 #define STRCASECMP_IN_STRINGS_H 479 #define SET_H_ERRNO(err) (set_h_errno(err)) 480 #endif 481 482 #ifdef UW21 /* UnixWare 2.1.x */ 483 #define SUPPORTED 484 #include <sys/types.h> 485 #define UINT32_TYPE unsigned int 486 #define UINT16_TYPE unsigned short 487 #define _PATH_MAILDIR "/var/mail" 488 #define _PATH_BSHELL "/bin/sh" 489 #define _PATH_DEFPATH "/usr/bin:/usr/ucb" 490 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb" 491 #define MISSING_SETENV 492 #define HAS_FCNTL_LOCK 493 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 494 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 495 #define HAS_FSYNC 496 #define HAS_DBM 497 #define DEF_DB_TYPE "dbm" 498 #define ALIAS_DB_MAP "dbm:/etc/mail/aliases" 499 /* Uncomment the following line if you have NIS package installed 500 #define HAS_NIS */ 501 #define USE_SYS_SOCKIO_H 502 #define GETTIMEOFDAY(t) gettimeofday(t,NULL) 503 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb" 504 #define FIONREAD_IN_SYS_FILIO_H 505 #define DBM_NO_TRAILING_NULL 506 #define USE_STATVFS 507 #define STATVFS_IN_SYS_STATVFS_H 508 #endif 509 510 /* 511 * AIX: a SYSV-flavored hybrid. NB: fcntl() and flock() access the same 512 * underlying locking primitives. 513 */ 514 #ifdef AIX5 515 #define SUPPORTED 516 #include <sys/types.h> 517 #define UINT32_TYPE unsigned int 518 #define UINT16_TYPE unsigned short 519 #define MISSING_SETENV 520 #define USE_PATHS_H 521 #ifndef _PATH_BSHELL 522 #define _PATH_BSHELL "/bin/sh" 523 #endif 524 #ifndef _PATH_MAILDIR 525 #define _PATH_MAILDIR "/var/spool/mail" /* paths.h lies */ 526 #endif 527 #ifndef _PATH_DEFPATH 528 #define _PATH_DEFPATH "/usr/bin:/usr/ucb" 529 #endif 530 #ifndef _PATH_STDPATH 531 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb" 532 #endif 533 #define HAS_FCNTL_LOCK 534 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 535 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 536 #define USE_SYS_SELECT_H 537 #define HAS_FSYNC 538 #define HAS_DBM 539 #define DEF_DB_TYPE "dbm" 540 #define ALIAS_DB_MAP "dbm:/etc/aliases" 541 #define HAS_NIS 542 #define HAS_SA_LEN 543 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 544 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb" 545 #define SOCKADDR_SIZE socklen_t 546 #define SOCKOPT_SIZE socklen_t 547 #define USE_STATVFS 548 #define STATVFS_IN_SYS_STATVFS_H 549 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail" 550 #define NATIVE_MAILQ_PATH "/usr/sbin/mailq" 551 #define NATIVE_NEWALIAS_PATH "/usr/sbin/newaliases" 552 #define NATIVE_COMMAND_DIR "/usr/sbin" 553 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 554 555 /* 556 * XXX Need CMSG_SPACE() and CMSG_LEN() but don't want to drag in everything 557 * that comes with _LINUX_SOURCE_COMPAT. 558 */ 559 #include <sys/socket.h> 560 #ifndef CMSG_SPACE 561 #define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len)) 562 #endif 563 #ifndef CMSG_LEN 564 #define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len)) 565 #endif 566 #ifndef NO_IPV6 567 # define HAS_IPV6 568 #endif 569 #define BROKEN_AI_PASSIVE_NULL_HOST 570 #define BROKEN_AI_NULL_SERVICE 571 #define USE_SYSV_POLL 572 #endif 573 574 #ifdef AIX4 575 #define SUPPORTED 576 #include <sys/types.h> 577 #define UINT32_TYPE unsigned int 578 #define UINT16_TYPE unsigned short 579 #define MISSING_SETENV 580 #define _PATH_BSHELL "/bin/sh" 581 #define _PATH_MAILDIR "/var/spool/mail" /* paths.h lies */ 582 #define _PATH_DEFPATH "/usr/bin:/usr/ucb" 583 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb" 584 #define HAS_FCNTL_LOCK 585 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 586 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 587 #define USE_SYS_SELECT_H 588 #define HAS_FSYNC 589 #define HAS_DBM 590 #define DEF_DB_TYPE "dbm" 591 #define ALIAS_DB_MAP "dbm:/etc/aliases" 592 #define HAS_NIS 593 #define HAS_SA_LEN 594 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 595 #define RESOLVE_H_NEEDS_STDIO_H 596 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb" 597 #define SOCKADDR_SIZE size_t 598 #define SOCKOPT_SIZE size_t 599 #define USE_STATVFS 600 #define STATVFS_IN_SYS_STATVFS_H 601 #define STRCASECMP_IN_STRINGS_H 602 #if 0 603 extern time_t time(time_t *); 604 extern int seteuid(uid_t); 605 extern int setegid(gid_t); 606 extern int initgroups(const char *, int); 607 608 #endif 609 #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail" 610 #define NATIVE_MAILQ_PATH "/usr/sbin/mailq" 611 #define NATIVE_NEWALIAS_PATH "/usr/sbin/newaliases" 612 #define NATIVE_COMMAND_DIR "/usr/sbin" 613 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 614 615 #define CANT_USE_SEND_RECV_MSG 616 #endif 617 618 #ifdef AIX3 619 #define SUPPORTED 620 #include <sys/types.h> 621 #define UINT32_TYPE unsigned int 622 #define UINT16_TYPE unsigned short 623 #define MISSING_SETENV 624 #define _PATH_BSHELL "/bin/sh" 625 #define _PATH_MAILDIR "/var/spool/mail" /* paths.h lies */ 626 #define _PATH_DEFPATH "/usr/bin:/usr/ucb" 627 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb" 628 #define HAS_FCNTL_LOCK 629 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 630 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 631 #define USE_SYS_SELECT_H 632 #define HAS_FSYNC 633 #define HAS_DBM 634 #define DEF_DB_TYPE "dbm" 635 #define ALIAS_DB_MAP "dbm:/etc/aliases" 636 #define HAS_NIS 637 #define HAS_SA_LEN 638 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 639 #define RESOLVE_H_NEEDS_STDIO_H 640 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb" 641 #define SOCKADDR_SIZE size_t 642 #define SOCKOPT_SIZE size_t 643 #define USE_STATFS 644 #define STATFS_IN_SYS_STATFS_H 645 #define STRCASECMP_IN_STRINGS_H 646 extern time_t time(time_t *); 647 extern int seteuid(uid_t); 648 extern int setegid(gid_t); 649 extern int initgroups(const char *, int); 650 651 #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail" 652 653 #define CANT_USE_SEND_RECV_MSG 654 #endif 655 656 /* 657 * IRIX, a mix of System V Releases. 658 */ 659 #if defined(IRIX5) || defined(IRIX6) 660 #define SUPPORTED 661 #include <sys/types.h> 662 #define UINT32_TYPE unsigned int 663 #define UINT16_TYPE unsigned short 664 #define MISSING_SETENV 665 #define _PATH_MAILDIR "/var/mail" 666 #define _PATH_BSHELL "/bin/sh" 667 #define _PATH_DEFPATH "/usr/bin:/usr/bsd" 668 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/bsd" 669 #define HAS_FCNTL_LOCK 670 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 671 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 672 #define HAS_FSYNC 673 #define HAS_DBM 674 #define DEF_DB_TYPE "dbm" 675 #define ALIAS_DB_MAP "dbm:/etc/aliases" 676 #define HAS_NIS 677 #define USE_SYS_SOCKIO_H /* XXX check */ 678 #define GETTIMEOFDAY(t) gettimeofday(t) 679 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/bsd" 680 #define FIONREAD_IN_SYS_FILIO_H /* XXX check */ 681 #define DBM_NO_TRAILING_NULL /* XXX check */ 682 #define USE_STATVFS 683 #define STATVFS_IN_SYS_STATVFS_H 684 #define BROKEN_WRITE_SELECT_ON_NON_BLOCKING_PIPE 685 #define CANT_USE_SEND_RECV_MSG 686 #endif 687 688 #if defined(IRIX5) 689 #define MISSING_USLEEP 690 #endif 691 692 #if defined(IRIX6) 693 #ifndef NO_IPV6 694 # define HAS_IPV6 695 #endif 696 #define HAS_POSIX_REGEXP 697 #define PIPES_CANT_FIONREAD 698 #endif 699 700 /* 701 * LINUX. 702 */ 703 #ifdef LINUX2 704 #define SUPPORTED 705 #include <sys/types.h> 706 #define UINT32_TYPE unsigned int 707 #define UINT16_TYPE unsigned short 708 #include <features.h> 709 #define USE_PATHS_H 710 #define HAS_FLOCK_LOCK 711 #define HAS_FCNTL_LOCK 712 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK 713 #define DEF_MAILBOX_LOCK "fcntl, dotlock" /* RedHat >= 4.x */ 714 #define HAS_FSYNC 715 #define HAS_DB 716 #define DEF_DB_TYPE "hash" 717 #define ALIAS_DB_MAP "hash:/etc/aliases" 718 #define HAS_NIS 719 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 720 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin" 721 #define FIONREAD_IN_TERMIOS_H 722 #define USE_STATFS 723 #define STATFS_IN_SYS_VFS_H 724 #define PREPEND_PLUS_TO_OPTSTRING 725 #define HAS_POSIX_REGEXP 726 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail" 727 #define NATIVE_MAILQ_PATH "/usr/bin/mailq" 728 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" 729 #define NATIVE_COMMAND_DIR "/usr/sbin" 730 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 731 #ifdef __GLIBC_PREREQ 732 # define HAVE_GLIBC_API_VERSION_SUPPORT(maj, min) __GLIBC_PREREQ(maj, min) 733 #else 734 # define HAVE_GLIBC_API_VERSION_SUPPORT(maj, min) \ 735 ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) 736 #endif 737 #if HAVE_GLIBC_API_VERSION_SUPPORT(2, 1) 738 # define SOCKADDR_SIZE socklen_t 739 # define SOCKOPT_SIZE socklen_t 740 #endif 741 #ifndef NO_IPV6 742 # define HAS_IPV6 743 # if HAVE_GLIBC_API_VERSION_SUPPORT(2, 4) 744 /* Really 2.3.3 or later, but there's no __GLIBC_MICRO version macro. */ 745 # define HAVE_GETIFADDRS 746 # else 747 # define HAS_PROCNET_IFINET6 748 # define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6" 749 # endif 750 #endif 751 #include <linux/version.h> 752 #if !defined(KERNEL_VERSION) 753 # define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1) 754 #endif 755 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) \ 756 || (__GLIBC__ < 2) 757 # define CANT_USE_SEND_RECV_MSG 758 # define DEF_SMTP_CACHE_DEMAND 0 759 #else 760 # define CANT_WRITE_BEFORE_SENDING_FD 761 #endif 762 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom" /* introduced in 1.1 */ 763 #ifndef NO_EPOLL 764 # define EVENTS_STYLE EVENTS_STYLE_EPOLL /* introduced in 2.5 */ 765 #endif 766 #define USE_SYSV_POLL 767 #endif 768 769 #ifdef LINUX1 770 #define SUPPORTED 771 #include <sys/types.h> 772 #define UINT32_TYPE unsigned int 773 #define UINT16_TYPE unsigned short 774 #define USE_PATHS_H 775 #define HAS_FLOCK_LOCK 776 #define HAS_FCNTL_LOCK 777 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK 778 #define DEF_MAILBOX_LOCK "dotlock" /* verified RedHat 3.03 */ 779 #define HAS_FSYNC 780 #define HAS_DB 781 #define DEF_DB_TYPE "hash" 782 #define ALIAS_DB_MAP "hash:/etc/aliases" 783 #define HAS_NIS 784 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 785 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin" 786 #define FIONREAD_IN_TERMIOS_H /* maybe unnecessary */ 787 #define USE_STATFS 788 #define STATFS_IN_SYS_VFS_H 789 #define PREPEND_PLUS_TO_OPTSTRING 790 #define HAS_POSIX_REGEXP 791 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail" 792 #define NATIVE_MAILQ_PATH "/usr/bin/mailq" 793 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" 794 #define NATIVE_COMMAND_DIR "/usr/sbin" 795 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 796 #define CANT_USE_SEND_RECV_MSG 797 #define DEF_SMTP_CACHE_DEMAND 0 798 #endif 799 800 /* 801 * GNU. 802 */ 803 #ifdef GNU0 804 #define SUPPORTED 805 #include <sys/types.h> 806 #include <features.h> 807 #define USE_PATHS_H 808 #define HAS_FCNTL_LOCK 809 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 810 #define DEF_MAILBOX_LOCK "fcntl, dotlock" /* RedHat >= 4.x */ 811 #define HAS_FSYNC 812 #define HAS_DB 813 #define DEF_DB_TYPE "hash" 814 #define ALIAS_DB_MAP "hash:/etc/aliases" 815 #define HAS_NIS 816 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 817 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin" 818 #define FIONREAD_IN_TERMIOS_H 819 #define USE_STATFS 820 #define STATFS_IN_SYS_VFS_H 821 #define UNIX_DOMAIN_CONNECT_BLOCKS_FOR_ACCEPT 822 #define PREPEND_PLUS_TO_OPTSTRING 823 #define HAS_POSIX_REGEXP 824 #define HAS_DLOPEN 825 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail" 826 #define NATIVE_MAILQ_PATH "/usr/bin/mailq" 827 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" 828 #define NATIVE_COMMAND_DIR "/usr/sbin" 829 #ifdef DEBIAN 830 #define NATIVE_DAEMON_DIR "/usr/lib/postfix" 831 #ifndef DEF_MANPAGE_DIR 832 #define DEF_MANPAGE_DIR "/usr/share/man" 833 #endif 834 #ifndef DEF_SAMPLE_DIR 835 #define DEF_SAMPLE_DIR "/usr/share/doc/postfix/examples" 836 #endif 837 #ifndef DEF_README_DIR 838 #define DEF_README_DIR "/usr/share/doc/postfix" 839 #endif 840 #else 841 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 842 #endif 843 #define SOCKADDR_SIZE socklen_t 844 #define SOCKOPT_SIZE socklen_t 845 #ifdef __FreeBSD_kernel__ 846 # define HAS_DUPLEX_PIPE 847 # define HAS_ISSETUGID 848 #endif 849 #ifndef NO_IPV6 850 # define HAS_IPV6 851 # ifdef __FreeBSD_kernel__ 852 # define HAVE_GETIFADDRS 853 # else 854 # define HAS_PROCNET_IFINET6 855 # define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6" 856 # endif 857 #endif 858 #define CANT_USE_SEND_RECV_MSG 859 #define DEF_SMTP_CACHE_DEMAND 0 860 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom" 861 #endif 862 863 /* 864 * HPUX11 was copied from HPUX10, but can perhaps be trimmed down a bit. 865 */ 866 #ifdef HPUX11 867 #define SUPPORTED 868 #define USE_SIG_RETURN 869 #include <sys/types.h> 870 #define UINT32_TYPE unsigned int 871 #define UINT16_TYPE unsigned short 872 #define HAS_DBM 873 #define HAS_FCNTL_LOCK 874 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 875 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 876 #define HAS_FSYNC 877 #define DEF_DB_TYPE "dbm" 878 #define ALIAS_DB_MAP "dbm:/etc/mail/aliases" 879 #define ROOT_PATH "/usr/bin:/sbin:/usr/sbin" 880 #define MISSING_SETENV 881 #define HAS_NIS 882 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 883 #define _PATH_BSHELL "/bin/sh" 884 #define _PATH_MAILDIR "/var/mail" 885 #define _PATH_DEFPATH "/usr/bin" 886 #define _PATH_STDPATH "/usr/bin:/sbin:/usr/sbin" 887 #define MISSING_SETEUID 888 #define HAVE_SETRESUID 889 #define MISSING_SETEGID 890 #define HAVE_SETRESGID 891 extern int h_errno; /* <netdb.h> imports too much stuff */ 892 893 #define USE_STATFS 894 #define STATFS_IN_SYS_VFS_H 895 #define HAS_POSIX_REGEXP 896 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail" 897 #define NATIVE_MAILQ_PATH "/usr/bin/mailq" 898 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" 899 #define NATIVE_COMMAND_DIR "/usr/sbin" 900 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 901 #endif 902 903 #ifdef HPUX10 904 #define SUPPORTED 905 #define USE_SIG_RETURN 906 #include <sys/types.h> 907 #define UINT32_TYPE unsigned int 908 #define UINT16_TYPE unsigned short 909 #define HAS_DBM 910 #define HAS_FCNTL_LOCK 911 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 912 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 913 #define HAS_FSYNC 914 #define DEF_DB_TYPE "dbm" 915 #define ALIAS_DB_MAP "dbm:/etc/mail/aliases" 916 #define ROOT_PATH "/usr/bin:/sbin:/usr/sbin" 917 #define MISSING_SETENV 918 #define HAS_NIS 919 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 920 #define _PATH_BSHELL "/bin/sh" 921 #define _PATH_MAILDIR "/var/mail" 922 #define _PATH_DEFPATH "/usr/bin" 923 #define _PATH_STDPATH "/usr/bin:/sbin:/usr/sbin" 924 #define MISSING_SETEUID 925 #define HAVE_SETRESUID 926 #define MISSING_SETEGID 927 #define HAVE_SETRESGID 928 extern int h_errno; /* <netdb.h> imports too much stuff */ 929 930 #define USE_STATFS 931 #define STATFS_IN_SYS_VFS_H 932 #define HAS_POSIX_REGEXP 933 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail" 934 #define NATIVE_MAILQ_PATH "/usr/bin/mailq" 935 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" 936 #define NATIVE_COMMAND_DIR "/usr/sbin" 937 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 938 #endif 939 940 #ifdef HPUX9 941 #define SUPPORTED 942 #define USE_SIG_RETURN 943 #include <sys/types.h> 944 #define UINT32_TYPE unsigned int 945 #define UINT16_TYPE unsigned short 946 #define HAS_DBM 947 #define HAS_FCNTL_LOCK 948 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 949 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 950 #define HAS_FSYNC 951 #define HAS_NIS 952 #define MISSING_SETENV 953 #define MISSING_RLIMIT_FSIZE 954 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 955 #define DEF_DB_TYPE "dbm" 956 #define ALIAS_DB_MAP "dbm:/usr/lib/aliases" 957 #define ROOT_PATH "/bin:/usr/bin:/etc" 958 #define _PATH_BSHELL "/bin/sh" 959 #define _PATH_MAILDIR "/usr/mail" 960 #define _PATH_DEFPATH "/bin:/usr/bin" 961 #define _PATH_STDPATH "/bin:/usr/bin:/etc" 962 #define MISSING_SETEUID 963 #define HAVE_SETRESUID 964 #define MISSING_SETEGID 965 #define HAVE_SETRESGID 966 extern int h_errno; 967 968 #define USE_ULIMIT /* no setrlimit() */ 969 #define USE_STATFS 970 #define STATFS_IN_SYS_VFS_H 971 #define HAS_POSIX_REGEXP 972 #define NATIVE_SENDMAIL_PATH "/usr/bin/sendmail" 973 #define NATIVE_MAILQ_PATH "/usr/bin/mailq" 974 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases" 975 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix" 976 #endif 977 978 /* 979 * NEXTSTEP3, without -lposix, because its naming service is broken. 980 */ 981 #ifdef NEXTSTEP3 982 #define SUPPORTED 983 #include <sys/types.h> 984 #define UINT32_TYPE unsigned int 985 #define UINT16_TYPE unsigned short 986 #define HAS_DBM 987 #define HAS_FLOCK_LOCK 988 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK 989 #define DEF_MAILBOX_LOCK "flock, dotlock" 990 #define USE_STATFS 991 #define HAVE_SYS_DIR_H 992 #define STATFS_IN_SYS_VFS_H 993 #define HAS_FSYNC 994 #define HAS_NIS 995 #define HAS_NETINFO 996 #define MISSING_SETENV_PUTENV 997 #define MISSING_MKFIFO 998 #define MISSING_SIGSET_T 999 #define MISSING_SIGACTION 1000 #define MISSING_STD_FILENOS 1001 #define MISSING_SETSID 1002 #define MISSING_WAITPID 1003 #define MISSING_UTIMBUF 1004 #define HAS_WAIT4 1005 #define WAIT_STATUS_T union wait 1006 #define NORMAL_EXIT_STATUS(x) (WIFEXITED(x) && !WEXITSTATUS (x)) 1007 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 1008 #define _PATH_MAILDIR "/usr/spool/mail" 1009 #define _PATH_BSHELL "/bin/sh" 1010 #define _PATH_DEFPATH "/bin:/usr/bin:/usr/ucb" 1011 #define _PATH_STDPATH "/bin:/usr/bin:/usr/ucb" 1012 #define ROOT_PATH "/bin:/usr/bin:/usr/etc:/usr/ucb" 1013 #define DEF_DB_TYPE "dbm" 1014 #define ALIAS_DB_MAP "netinfo:/aliases" 1015 #include <libc.h> 1016 #define MISSING_POSIX_S_IS 1017 #define MISSING_POSIX_S_MODES 1018 /* It's amazing what is all missing... */ 1019 #define isascii(c) ((unsigned)(c)<=0177) 1020 extern int opterr; 1021 typedef unsigned short mode_t; 1022 1023 #define MISSING_PID_T 1024 #define MISSING_STRFTIME_E 1025 #define FD_CLOEXEC 1 1026 #define O_NONBLOCK O_NDELAY 1027 #define WEXITSTATUS(x) ((x).w_retcode) 1028 #define WTERMSIG(x) ((x).w_termsig) 1029 #endif 1030 1031 /* 1032 * OPENSTEP does not have posix (some fix...) 1033 */ 1034 #ifdef OPENSTEP4 1035 #define SUPPORTED 1036 #include <sys/types.h> 1037 #define UINT32_TYPE unsigned int 1038 #define UINT16_TYPE unsigned short 1039 #define HAS_DBM 1040 #define HAS_FLOCK_LOCK 1041 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK 1042 #define DEF_MAILBOX_LOCK "flock, dotlock" 1043 #define USE_STATFS 1044 #define HAVE_SYS_DIR_H 1045 #define STATFS_IN_SYS_VFS_H 1046 #define HAS_FSYNC 1047 #define HAS_NIS 1048 #define HAS_NETINFO 1049 #define MISSING_SETENV_PUTENV 1050 #define MISSING_MKFIFO 1051 #define MISSING_SIGSET_T 1052 #define MISSING_SIGACTION 1053 #define MISSING_STD_FILENOS 1054 #define MISSING_SETSID 1055 #define MISSING_WAITPID 1056 #define MISSING_UTIMBUF 1057 #define HAS_WAIT4 1058 #define WAIT_STATUS_T union wait 1059 #define NORMAL_EXIT_STATUS(x) (WIFEXITED(x) && !WEXITSTATUS (x)) 1060 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 1061 #define _PATH_MAILDIR "/usr/spool/mail" 1062 #define _PATH_BSHELL "/bin/sh" 1063 #define _PATH_DEFPATH "/bin:/usr/bin:/usr/ucb" 1064 #define _PATH_STDPATH "/bin:/usr/bin:/usr/ucb" 1065 #define ROOT_PATH "/bin:/usr/bin:/usr/etc:/usr/ucb" 1066 #define DEF_DB_TYPE "dbm" 1067 #define ALIAS_DB_MAP "netinfo:/aliases" 1068 #include <libc.h> 1069 #define MISSING_POSIX_S_IS 1070 #define MISSING_POSIX_S_MODES 1071 /* It's amazing what is all missing... */ 1072 #define isascii(c) ((unsigned)(c)<=0177) 1073 extern int opterr; 1074 typedef unsigned short mode_t; 1075 1076 #define MISSING_PID_T 1077 #define MISSING_STRFTIME_E 1078 #define FD_CLOEXEC 1 1079 #define O_NONBLOCK O_NDELAY 1080 #define WEXITSTATUS(x) ((x).w_retcode) 1081 #define WTERMSIG(x) ((x).w_termsig) 1082 #define NORETURN /* the native compiler */ 1083 #define PRINTFLIKE(x,y) 1084 #define SCANFLIKE(x,y) 1085 #endif 1086 1087 #ifdef ReliantUnix543 1088 #define SUPPORTED 1089 #include <sys/types.h> 1090 #define UINT32_TYPE unsigned int 1091 #define UINT16_TYPE unsigned short 1092 #define MISSING_SETENV 1093 #define _PATH_DEFPATH "/usr/bin:/usr/ucb" 1094 #define _PATH_BSHELL "/bin/sh" 1095 #define _PATH_MAILDIR "/var/spool/mail" 1096 #define HAS_FCNTL_LOCK 1097 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 1098 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 1099 #define HAS_FSYNC 1100 #define FIONREAD_IN_SYS_FILIO_H 1101 #define USE_SYS_SOCKIO_H 1102 #define HAS_DBM 1103 #define DEF_DB_TYPE "dbm" 1104 #define ALIAS_DB_MAP "dbm:/var/adm/sendmail/aliases" 1105 extern int optind; /* XXX use <getopt.h> */ 1106 extern char *optarg; /* XXX use <getopt.h> */ 1107 extern int opterr; /* XXX use <getopt.h> */ 1108 1109 #define HAS_NIS 1110 #define GETTIMEOFDAY(t) gettimeofday(t) 1111 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb" 1112 #define USE_STATVFS 1113 #define STATVFS_IN_SYS_STATVFS_H 1114 #define MISSING_USLEEP 1115 #endif 1116 1117 #ifdef DCOSX1 /* Siemens Pyramid */ 1118 #define SUPPORTED 1119 #include <sys/types.h> 1120 #define UINT32_TYPE unsigned int 1121 #define UINT16_TYPE unsigned short 1122 #define _PATH_MAILDIR "/var/mail" 1123 #define _PATH_BSHELL "/bin/sh" 1124 #define _PATH_DEFPATH "/usr/bin:/usr/ucb" 1125 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb" 1126 #define MISSING_SETENV 1127 #define HAS_FCNTL_LOCK 1128 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 1129 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 1130 #define HAS_FSYNC 1131 #define DEF_DB_TYPE "hash" 1132 #define ALIAS_DB_MAP "hash:/etc/aliases" 1133 /* Uncomment the following line if you have NIS package installed */ 1134 /* #define HAS_NIS */ 1135 #define USE_SYS_SOCKIO_H 1136 #define GETTIMEOFDAY(t) gettimeofday(t,NULL) 1137 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb" 1138 #define FIONREAD_IN_SYS_FILIO_H 1139 #define DBM_NO_TRAILING_NULL 1140 #define USE_STATVFS 1141 #define STATVFS_IN_SYS_STATVFS_H 1142 #ifndef S_ISSOCK 1143 #define S_ISSOCK(mode) ((mode&0xF000) == 0xC000) 1144 #endif 1145 #endif 1146 1147 #ifdef SCO5 1148 #define SUPPORTED 1149 #include <sys/types.h> 1150 #include <sys/socket.h> 1151 extern int h_errno; 1152 1153 #define UINT32_TYPE unsigned int 1154 #define UINT16_TYPE unsigned short 1155 #define _PATH_MAILDIR "/usr/spool/mail" 1156 #define _PATH_BSHELL "/bin/sh" 1157 #define _PATH_DEFPATH "/bin:/usr/bin" 1158 #define USE_PATHS_H 1159 #define HAS_FCNTL_LOCK 1160 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL 1161 #define DEF_MAILBOX_LOCK "fcntl, dotlock" 1162 #define HAS_FSYNC 1163 #define HAS_DBM 1164 #define DEF_DB_TYPE "dbm" 1165 #define ALIAS_DB_MAP "dbm:/etc/mail/aliases" 1166 #define DBM_NO_TRAILING_NULL 1167 #define HAS_NIS 1168 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0) 1169 #define ROOT_PATH "/bin:/etc:/usr/bin:/tcb/bin" 1170 #define USE_STATVFS 1171 #define STATVFS_IN_SYS_STATVFS_H 1172 #define MISSING_SETENV 1173 #define STRCASECMP_IN_STRINGS_H 1174 /* SCO5 misses just S_ISSOCK, the others are there 1175 * Use C_ISSOCK definition from cpio.h. 1176 */ 1177 #include <cpio.h> 1178 #define S_ISSOCK(mode) (((mode) & (S_IFMT)) == (C_ISSOCK)) 1179 #define CANT_USE_SEND_RECV_MSG 1180 #define DEF_SMTP_CACHE_DEMAND 0 1181 #endif 1182 1183 /* 1184 * We're not going to try to guess like configure does. 1185 */ 1186 #ifndef SUPPORTED 1187 #error "unsupported platform" 1188 #endif 1189 1190 /* 1191 * Allow command line flags to override native settings 1192 */ 1193 #ifndef DEF_COMMAND_DIR 1194 #ifdef NATIVE_COMMAND_DIR 1195 #define DEF_COMMAND_DIR NATIVE_COMMAND_DIR 1196 #endif 1197 #endif 1198 1199 #ifndef DEF_DAEMON_DIR 1200 #ifdef NATIVE_DAEMON_DIR 1201 #define DEF_DAEMON_DIR NATIVE_DAEMON_DIR 1202 #endif 1203 #endif 1204 1205 #ifndef DEF_SENDMAIL_PATH 1206 #ifdef NATIVE_SENDMAIL_PATH 1207 #define DEF_SENDMAIL_PATH NATIVE_SENDMAIL_PATH 1208 #endif 1209 #endif 1210 1211 #ifndef DEF_MAILQ_PATH 1212 #ifdef NATIVE_MAILQ_PATH 1213 #define DEF_MAILQ_PATH NATIVE_MAILQ_PATH 1214 #endif 1215 #endif 1216 1217 #ifndef DEF_NEWALIAS_PATH 1218 #ifdef NATIVE_NEWALIAS_PATH 1219 #define DEF_NEWALIAS_PATH NATIVE_NEWALIAS_PATH 1220 #endif 1221 #endif 1222 1223 #define CAST_CHAR_PTR_TO_INT(cptr) ((int) (long) (cptr)) 1224 #define CAST_INT_TO_CHAR_PTR(ival) ((char *) (long) (ival)) 1225 1226 #ifdef DUP2_DUPS_CLOSE_ON_EXEC 1227 /* dup2_pass_on_exec() can be found in util/sys_compat.c */ 1228 extern int dup2_pass_on_exec(int oldd, int newd); 1229 1230 #define DUP2 dup2_pass_on_exec 1231 #else 1232 #define DUP2 dup2 1233 #endif 1234 1235 #ifdef PREPEND_PLUS_TO_OPTSTRING 1236 #define GETOPT(argc, argv, str) getopt((argc), (argv), "+" str) 1237 #else 1238 #define GETOPT(argc, argv, str) getopt((argc), (argv), (str)) 1239 #endif 1240 #define OPTIND (optind > 0 ? optind : 1) 1241 1242 /* 1243 * Check for required but missing definitions. 1244 */ 1245 #if !defined(HAS_FCNTL_LOCK) && !defined(HAS_FLOCK_LOCK) 1246 #error "define HAS_FCNTL_LOCK and/or HAS_FLOCK_LOCK" 1247 #endif 1248 1249 #if !defined(DEF_MAILBOX_LOCK) 1250 #error "define DEF_MAILBOX_LOCK" 1251 #endif 1252 1253 #if !defined(INTERNAL_LOCK) 1254 #error "define INTERNAL_LOCK" 1255 #endif 1256 1257 #if defined(USE_STATFS) && defined(USE_STATVFS) 1258 #error "define USE_STATFS or USE_STATVFS, not both" 1259 #endif 1260 1261 #if !defined(USE_STATFS) && !defined(USE_STATVFS) 1262 #error "define USE_STATFS or USE_STATVFS" 1263 #endif 1264 1265 /* 1266 * Defaults for systems that pre-date IPv6 support. 1267 */ 1268 #ifndef HAS_IPV6 1269 #define EMULATE_IPV4_ADDRINFO 1270 #define MISSING_INET_PTON 1271 #define MISSING_INET_NTOP 1272 extern const char *inet_ntop(int, const void *, char *, size_t); 1273 extern int inet_pton(int, const char *, void *); 1274 1275 #endif 1276 1277 /* 1278 * Defaults for systems without kqueue, /dev/poll or epoll support. 1279 * master/multi-server.c and *qmgr/qmgr_transport.c depend on this. 1280 */ 1281 #if !defined(EVENTS_STYLE) 1282 #define EVENTS_STYLE EVENTS_STYLE_SELECT 1283 #endif 1284 1285 #define EVENTS_STYLE_SELECT 1 /* Traditional BSD select */ 1286 #define EVENTS_STYLE_KQUEUE 2 /* FreeBSD kqueue */ 1287 #define EVENTS_STYLE_DEVPOLL 3 /* Solaris /dev/poll */ 1288 #define EVENTS_STYLE_EPOLL 4 /* Linux epoll */ 1289 1290 #if !defined(USE_SYSV_POLL) && (EVENTS_STYLE != EVENTS_STYLE_SELECT) 1291 #error "need USE_SYSV_POLL with EVENTS_STYLE != EVENTS_STYLE_SELECT" 1292 #endif 1293 1294 /* 1295 * Defaults for all systems. 1296 */ 1297 #ifndef DEF_INET_PROTOCOLS 1298 #define DEF_INET_PROTOCOLS "ipv4" 1299 #endif 1300 1301 /* 1302 * Defaults for systems that pre-date POSIX socklen_t. 1303 */ 1304 #ifndef SOCKADDR_SIZE 1305 #define SOCKADDR_SIZE int 1306 #endif 1307 1308 #ifndef SOCKOPT_SIZE 1309 #define SOCKOPT_SIZE int 1310 #endif 1311 1312 /* 1313 * Defaults for normal systems. 1314 */ 1315 #ifndef LOCAL_LISTEN 1316 #define LOCAL_LISTEN unix_listen 1317 #define LOCAL_ACCEPT unix_accept 1318 #define LOCAL_CONNECT unix_connect 1319 #define LOCAL_TRIGGER unix_trigger 1320 #define LOCAL_SEND_FD unix_send_fd 1321 #define LOCAL_RECV_FD unix_recv_fd 1322 #endif 1323 1324 #ifndef PASS_LISTEN 1325 #define PASS_LISTEN upass_listen 1326 #define PASS_ACCEPT upass_accept 1327 #define PASS_TRIGGER upass_trigger 1328 #endif 1329 1330 #if !defined (HAVE_SYS_NDIR_H) && !defined (HAVE_SYS_DIR_H) \ 1331 && !defined (HAVE_NDIR_H) 1332 #define HAVE_DIRENT_H 1333 #endif 1334 1335 #ifndef WAIT_STATUS_T 1336 typedef int WAIT_STATUS_T; 1337 1338 #define NORMAL_EXIT_STATUS(status) ((status) == 0) 1339 #endif 1340 1341 #ifndef OCTAL_TO_UNSIGNED 1342 #define OCTAL_TO_UNSIGNED(res, str) ((res) = strtoul((str), (char **) 0, 8)) 1343 #endif 1344 1345 /* 1346 * Avoid useless type mis-matches when using sizeof in an integer context. 1347 */ 1348 #define INT_SIZEOF(foo) ((int) sizeof(foo)) 1349 1350 /* 1351 * Turn on the compatibility stuff. 1352 */ 1353 #ifdef MISSING_UTIMBUF 1354 struct utimbuf { 1355 time_t actime; 1356 time_t modtime; 1357 }; 1358 1359 #endif 1360 1361 #ifdef MISSING_STRERROR 1362 extern const char *strerror(int); 1363 1364 #endif 1365 1366 #if defined (MISSING_SETENV) || defined (MISSING_SETENV_PUTENV) 1367 extern int setenv(const char *, const char *, int); 1368 1369 #endif 1370 1371 #ifdef MISSING_SETEUID 1372 extern int seteuid(uid_t euid); 1373 1374 #endif 1375 1376 #ifdef MISSING_SETEGID 1377 extern int setegid(gid_t egid); 1378 1379 #endif 1380 1381 #ifdef MISSING_MKFIFO 1382 extern int mkfifo(char *, int); 1383 1384 #endif 1385 1386 #ifdef MISSING_WAITPID 1387 extern int waitpid(int, WAIT_STATUS_T *status, int options); 1388 1389 #endif 1390 1391 #ifdef MISSING_SETSID 1392 extern int setsid(void); 1393 1394 #endif 1395 1396 #ifndef HAS_CLOSEFROM 1397 extern int closefrom(int); 1398 1399 #endif 1400 1401 #ifdef MISSING_STD_FILENOS 1402 #define STDIN_FILENO 0 1403 #define STDOUT_FILENO 1 1404 #define STDERR_FILENO 2 1405 #endif 1406 1407 #ifdef MISSING_PID_T 1408 typedef int pid_t; 1409 1410 #endif 1411 1412 #ifdef MISSING_POSIX_S_IS 1413 #define S_ISBLK(mode) (((mode) & (_S_IFMT)) == (_S_IFBLK)) 1414 #define S_ISCHR(mode) (((mode) & (_S_IFMT)) == (_S_IFCHR)) 1415 #define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR)) 1416 #define S_ISSOCK(mode) (((mode) & (_S_IFMT)) == (_S_IFSOCK)) 1417 #define S_ISFIFO(mode) (((mode) & (_S_IFMT)) == (_S_IFIFO)) 1418 #define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG)) 1419 #define S_ISLNK(mode) (((mode) & (_S_IFMT)) == (_S_IFLNK)) 1420 #endif 1421 1422 #ifdef MISSING_POSIX_S_MODES 1423 #define S_IRUSR _S_IRUSR 1424 #define S_IRGRP 0000040 1425 #define S_IROTH 0000004 1426 #define S_IWUSR _S_IWUSR 1427 #define S_IWGRP 0000020 1428 #define S_IWOTH 0000002 1429 #define S_IXUSR _S_IXUSR 1430 #define S_IXGRP 0000010 1431 #define S_IXOTH 0000001 1432 #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) 1433 #endif 1434 1435 /* 1436 * Memory alignment of memory allocator results. By default we align for 1437 * doubles. 1438 */ 1439 #ifndef ALIGN_TYPE 1440 # if defined(__hpux) && defined(__ia64) 1441 # define ALIGN_TYPE __float80 1442 # elif defined(__ia64__) 1443 # define ALIGN_TYPE long double 1444 # else 1445 # define ALIGN_TYPE double 1446 # endif 1447 #endif 1448 1449 /* 1450 * Need to specify what functions never return, so that the compiler can 1451 * warn for missing initializations and other trouble. However, OPENSTEP4 1452 * gcc 2.7.x cannot handle this so we define this only if NORETURN isn't 1453 * already defined above. 1454 * 1455 * Data point: gcc 2.7.2 has __attribute__ (Wietse Venema) but gcc 2.6.3 does 1456 * not (Clive Jones). So we'll set the threshold at 2.7. 1457 */ 1458 #ifndef NORETURN 1459 #if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ >= 3 1460 #define NORETURN void __attribute__((__noreturn__)) 1461 #endif 1462 #endif 1463 1464 #ifndef NORETURN 1465 #define NORETURN void 1466 #endif 1467 1468 /* 1469 * Turn on format string argument checking. This is more accurate than 1470 * printfck, but it misses #ifdef-ed code. XXX I am just guessing at what 1471 * gcc versions support this. In order to turn this off for some platforms, 1472 * specify #define PRINTFLIKE and #define SCANFLIKE in the system-dependent 1473 * sections above. 1474 */ 1475 #ifndef PRINTFLIKE 1476 #if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ == 3 1477 #define PRINTFLIKE(x,y) __attribute__ ((format (printf, (x), (y)))) 1478 #else 1479 #define PRINTFLIKE(x,y) 1480 #endif 1481 #endif 1482 1483 #ifndef SCANFLIKE 1484 #if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ == 3 1485 #define SCANFLIKE(x,y) __attribute__ ((format (scanf, (x), (y)))) 1486 #else 1487 #define SCANFLIKE(x,y) 1488 #endif 1489 #endif 1490 1491 /* 1492 * ISO C says that the "volatile" qualifier protects against optimizations 1493 * that cause longjmp() to clobber local variables. 1494 */ 1495 #ifndef NOCLOBBER 1496 #define NOCLOBBER volatile 1497 #endif 1498 1499 /* 1500 * Bit banging!! There is no official constant that defines the INT_MAX 1501 * equivalent of the off_t type. Wietse came up with the following macro 1502 * that works as long as off_t is some two's complement number. 1503 */ 1504 #include <limits.h> 1505 #define __MAXINT__(T) ((T) (((((T) 1) << ((sizeof(T) * CHAR_BIT) - 1)) ^ ((T) -1)))) 1506 #ifndef OFF_T_MAX 1507 #define OFF_T_MAX __MAXINT__(off_t) 1508 #endif 1509 1510 /* 1511 * Setting globals like h_errno can be problematic when Postfix is linked 1512 * with multi-threaded libraries. 1513 */ 1514 #ifndef SET_H_ERRNO 1515 #define SET_H_ERRNO(err) (h_errno = (err)) 1516 #endif 1517 1518 /* 1519 * Don't mix socket message send/receive calls with socket stream read/write 1520 * calls. The fact that you can get away with it only on some stacks implies 1521 * that there is no long-term guarantee. 1522 */ 1523 #ifndef CAN_WRITE_BEFORE_SENDING_FD 1524 #define CANT_WRITE_BEFORE_SENDING_FD 1525 #endif 1526 1527 /* 1528 * FreeBSD sendmsg(2) says that after sending a file descriptor, the sender 1529 * must not immediately close the descriptor, otherwise it may close the 1530 * descriptor before it is actually sent. 1531 */ 1532 #ifndef DONT_WAIT_AFTER_SENDING_FD 1533 #define MUST_READ_AFTER_SENDING_FD 1534 #endif 1535 1536 /* 1537 * Hope for the best. 1538 */ 1539 #ifndef UINT32_TYPE 1540 #define UINT32_TYPE uint32_t 1541 #define UINT16_TYPE uint16_t 1542 #endif 1543 #define UINT32_SIZE 4 1544 #define UINT16_SIZE 2 1545 1546 /* 1547 * Safety. On some systems, ctype.h misbehaves with non-ASCII or negative 1548 * characters. More importantly, Postfix uses the ISXXX() macros to ensure 1549 * protocol compliance, so we have to rule out non-ASCII characters. 1550 * 1551 * XXX The (unsigned char) casts in isalnum() etc arguments are unnecessary 1552 * because the ISASCII() guard already ensures that the values are 1553 * non-negative; the casts are done anyway to shut up chatty compilers. 1554 */ 1555 #define ISASCII(c) isascii(_UCHAR_(c)) 1556 #define _UCHAR_(c) ((unsigned char)(c)) 1557 #define ISALNUM(c) (ISASCII(c) && isalnum((unsigned char)(c))) 1558 #define ISALPHA(c) (ISASCII(c) && isalpha((unsigned char)(c))) 1559 #define ISCNTRL(c) (ISASCII(c) && iscntrl((unsigned char)(c))) 1560 #define ISDIGIT(c) (ISASCII(c) && isdigit((unsigned char)(c))) 1561 #define ISGRAPH(c) (ISASCII(c) && isgraph((unsigned char)(c))) 1562 #define ISLOWER(c) (ISASCII(c) && islower((unsigned char)(c))) 1563 #define ISPRINT(c) (ISASCII(c) && isprint((unsigned char)(c))) 1564 #define ISPUNCT(c) (ISASCII(c) && ispunct((unsigned char)(c))) 1565 #define ISSPACE(c) (ISASCII(c) && isspace((unsigned char)(c))) 1566 #define ISUPPER(c) (ISASCII(c) && isupper((unsigned char)(c))) 1567 #define TOLOWER(c) (ISUPPER(c) ? tolower((unsigned char)(c)) : (c)) 1568 #define TOUPPER(c) (ISLOWER(c) ? toupper((unsigned char)(c)) : (c)) 1569 1570 /* 1571 * Scaffolding. I don't want to lose messages while the program is under 1572 * development. 1573 */ 1574 extern int REMOVE(const char *); 1575 1576 /* LICENSE 1577 /* .ad 1578 /* .fi 1579 /* The Secure Mailer license must be distributed with this software. 1580 /* AUTHOR(S) 1581 /* Wietse Venema 1582 /* IBM T.J. Watson Research 1583 /* P.O. Box 704 1584 /* Yorktown Heights, NY 10598, USA 1585 /*--*/ 1586 1587 #endif 1588