17c478bd9Sstevel@tonic-gate /* 24aac33d3Sjbeck * Copyright (c) 1998-2007 Sendmail, Inc. and its suppliers. 37c478bd9Sstevel@tonic-gate * All rights reserved. 47c478bd9Sstevel@tonic-gate * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. 57c478bd9Sstevel@tonic-gate * Copyright (c) 1988, 1993 67c478bd9Sstevel@tonic-gate * The Regents of the University of California. All rights reserved. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * By using this file, you agree to the terms and conditions set 97c478bd9Sstevel@tonic-gate * forth in the LICENSE file which can be found at the top level of 107c478bd9Sstevel@tonic-gate * the sendmail distribution. 117c478bd9Sstevel@tonic-gate * 127c478bd9Sstevel@tonic-gate * 137800901eSjbeck * $Id: conf.h,v 1.134 2007/09/24 23:05:37 ca Exp $ 147c478bd9Sstevel@tonic-gate */ 157c478bd9Sstevel@tonic-gate 167c478bd9Sstevel@tonic-gate /* 17*39c1a28dSJohn Beck * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 187c478bd9Sstevel@tonic-gate * Use is subject to license terms. 197c478bd9Sstevel@tonic-gate */ 207c478bd9Sstevel@tonic-gate 217c478bd9Sstevel@tonic-gate /* 227c478bd9Sstevel@tonic-gate ** CONF.H -- All user-configurable parameters for sendmail 237c478bd9Sstevel@tonic-gate ** 24058561cbSjbeck ** Send updates to Sendmail.ORG so they will be 25058561cbSjbeck ** included in the next release; see 26058561cbSjbeck ** http://www.sendmail.org/email-addresses.html 27058561cbSjbeck ** for current e-mail address. 287c478bd9Sstevel@tonic-gate */ 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate #ifndef SM_CONF_H 317c478bd9Sstevel@tonic-gate # define SM_CONF_H 1 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate # include <sm/config.h> 357c478bd9Sstevel@tonic-gate # include <sm/varargs.h> 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gate /* 387c478bd9Sstevel@tonic-gate ** General "standard C" defines. 397c478bd9Sstevel@tonic-gate ** 407c478bd9Sstevel@tonic-gate ** These may be undone later, to cope with systems that claim to 417c478bd9Sstevel@tonic-gate ** be Standard C but aren't. Gcc is the biggest offender -- it 427c478bd9Sstevel@tonic-gate ** doesn't realize that the library is part of the language. 437c478bd9Sstevel@tonic-gate ** 447c478bd9Sstevel@tonic-gate ** Life would be much easier if we could get rid of this sort 457c478bd9Sstevel@tonic-gate ** of bozo problems. 467c478bd9Sstevel@tonic-gate */ 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate # ifdef __STDC__ 497c478bd9Sstevel@tonic-gate # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 507c478bd9Sstevel@tonic-gate # endif /* __STDC__ */ 517c478bd9Sstevel@tonic-gate 527c478bd9Sstevel@tonic-gate /* 537c478bd9Sstevel@tonic-gate ** Assume you have standard calls; can be #undefed below if necessary. 547c478bd9Sstevel@tonic-gate */ 557c478bd9Sstevel@tonic-gate 567c478bd9Sstevel@tonic-gate # ifndef HASLSTAT 577c478bd9Sstevel@tonic-gate # define HASLSTAT 1 /* has lstat(2) call */ 587c478bd9Sstevel@tonic-gate # endif /* ! HASLSTAT */ 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate # ifndef HASNICE 617c478bd9Sstevel@tonic-gate # define HASNICE 1 /* has nice(2) call */ 627c478bd9Sstevel@tonic-gate # endif /* ! HASNICE */ 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate # ifndef HASRRESVPORT 657c478bd9Sstevel@tonic-gate # define HASRRESVPORT 1 /* has rrsevport(3) call */ 667c478bd9Sstevel@tonic-gate # endif /* ! HASRRESVPORT */ 677c478bd9Sstevel@tonic-gate 687c478bd9Sstevel@tonic-gate /********************************************************************** 697c478bd9Sstevel@tonic-gate ** "Hard" compilation options. 707c478bd9Sstevel@tonic-gate ** #define these if they are available; comment them out otherwise. 717c478bd9Sstevel@tonic-gate ** These cannot be overridden from the Makefile, and should really not 727c478bd9Sstevel@tonic-gate ** be turned off unless absolutely necessary. 737c478bd9Sstevel@tonic-gate **********************************************************************/ 747c478bd9Sstevel@tonic-gate 757c478bd9Sstevel@tonic-gate #define LOG 1 /* enable logging -- don't turn off */ 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gate /********************************************************************** 787c478bd9Sstevel@tonic-gate ** Operating system configuration. 797c478bd9Sstevel@tonic-gate ** 807c478bd9Sstevel@tonic-gate ** Unless you are porting to a new OS, you shouldn't have to 817c478bd9Sstevel@tonic-gate ** change these. 827c478bd9Sstevel@tonic-gate **********************************************************************/ 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate /* 857c478bd9Sstevel@tonic-gate ** HP-UX -- tested for 8.07, 9.00, and 9.01. 867c478bd9Sstevel@tonic-gate ** 877c478bd9Sstevel@tonic-gate ** If V4FS is defined, compile for HP-UX 10.0. 887c478bd9Sstevel@tonic-gate ** 11.x support from Richard Allen <ra@hp.is>. 897c478bd9Sstevel@tonic-gate */ 907c478bd9Sstevel@tonic-gate 917c478bd9Sstevel@tonic-gate # ifdef __hpux 927c478bd9Sstevel@tonic-gate /* common definitions for HP-UX 9.x and 10.x */ 937c478bd9Sstevel@tonic-gate # undef m_flags /* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */ 947c478bd9Sstevel@tonic-gate # define SYSTEM5 1 /* include all the System V defines */ 957c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 967c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 977c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* has usable seteuid(2) call */ 987c478bd9Sstevel@tonic-gate # define HASSETRESGID 1 /* use setresgid(2) to set saved gid */ 997c478bd9Sstevel@tonic-gate # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */ 1007c478bd9Sstevel@tonic-gate # define seteuid(e) setresuid(-1, e, -1) 1017c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 1 /* can check IP source routing */ 1027c478bd9Sstevel@tonic-gate # define LA_TYPE LA_HPUX 1037c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_PSTAT 1047c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 1057c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 1067c478bd9Sstevel@tonic-gate # define LDA_USE_LOCKF 1 1077c478bd9Sstevel@tonic-gate # ifndef HASGETUSERSHELL 1087c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 1097c478bd9Sstevel@tonic-gate # endif /* ! HASGETUSERSHELL */ 1107c478bd9Sstevel@tonic-gate # ifdef HPUX10 1117c478bd9Sstevel@tonic-gate # define _PATH_SENDMAIL "/usr/sbin/sendmail" 1127c478bd9Sstevel@tonic-gate # ifndef SMRSH_CMDDIR 1137c478bd9Sstevel@tonic-gate # define SMRSH_CMDDIR "/var/adm/sm.bin" 1147c478bd9Sstevel@tonic-gate # endif /* ! SMRSH_CMDDIR */ 1157c478bd9Sstevel@tonic-gate # endif /* HPUX10 */ 1167c478bd9Sstevel@tonic-gate # ifdef HPUX11 1177c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* setreuid(2) works on HP-UX 11.x */ 1187c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) */ 1197c478bd9Sstevel@tonic-gate # ifndef BROKEN_RES_SEARCH 1207c478bd9Sstevel@tonic-gate # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 1217c478bd9Sstevel@tonic-gate # endif /* ! BROKEN_RES_SEARCH */ 1227c478bd9Sstevel@tonic-gate # ifndef SMRSH_CMDDIR 1237c478bd9Sstevel@tonic-gate # define SMRSH_CMDDIR "/var/adm/sm.bin" 1247c478bd9Sstevel@tonic-gate # endif /* ! SMRSH_CMDDIR */ 1257c478bd9Sstevel@tonic-gate # define _PATH_SENDMAIL "/usr/sbin/sendmail" 1267c478bd9Sstevel@tonic-gate # else /* HPUX11 */ 1277c478bd9Sstevel@tonic-gate # ifndef NOT_SENDMAIL 1287c478bd9Sstevel@tonic-gate # define syslog hard_syslog 1297c478bd9Sstevel@tonic-gate # endif /* ! NOT_SENDMAIL */ 1307c478bd9Sstevel@tonic-gate # endif /* HPUX11 */ 1317c478bd9Sstevel@tonic-gate # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 1327c478bd9Sstevel@tonic-gate 1337c478bd9Sstevel@tonic-gate # ifdef V4FS 1347c478bd9Sstevel@tonic-gate /* HP-UX 10.x */ 1357c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/stand/vmunix" 1367c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 1377c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 1387c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 1397c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 1407c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 1417c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 1427c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 1437c478bd9Sstevel@tonic-gate # define IDENTPROTO 1 /* TCP/IP implementation fixed in 10.0 */ 1447c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 1457c478bd9Sstevel@tonic-gate # include <sys/mpctl.h> /* for mpctl() in get_num_procs_online() */ 1467c478bd9Sstevel@tonic-gate # else /* V4FS */ 1477c478bd9Sstevel@tonic-gate /* HP-UX 9.x */ 1487c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/hp-ux" 1497c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 1507c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1517c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 1527c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 1537c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 1547c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 1557c478bd9Sstevel@tonic-gate # ifdef __STDC__ 1567c478bd9Sstevel@tonic-gate extern void hard_syslog(int, char *, ...); 1577c478bd9Sstevel@tonic-gate # else /* __STDC__ */ 1587c478bd9Sstevel@tonic-gate extern void hard_syslog(); 1597c478bd9Sstevel@tonic-gate # endif /* __STDC__ */ 1607c478bd9Sstevel@tonic-gate # define FDSET_CAST (int *) /* cast for fd_set parameters to select */ 1617c478bd9Sstevel@tonic-gate # endif /* V4FS */ 1627c478bd9Sstevel@tonic-gate 1637c478bd9Sstevel@tonic-gate # endif /* __hpux */ 1647c478bd9Sstevel@tonic-gate 1657c478bd9Sstevel@tonic-gate /* 1667c478bd9Sstevel@tonic-gate ** IBM AIX 5.x 1677c478bd9Sstevel@tonic-gate */ 1687c478bd9Sstevel@tonic-gate 1697c478bd9Sstevel@tonic-gate # ifdef _AIX5 1704aac33d3Sjbeck # include <sys/signal.h> 1714aac33d3Sjbeck # include <sys/wait.h> 1727c478bd9Sstevel@tonic-gate # define _AIX4 40300 1737c478bd9Sstevel@tonic-gate # define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */ 1747c478bd9Sstevel@tonic-gate # define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */ 1757c478bd9Sstevel@tonic-gate # if _AIX5 >= 50200 1767c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) call */ 1777c478bd9Sstevel@tonic-gate # endif /* _AIX5 >= 50200 */ 1787c478bd9Sstevel@tonic-gate # endif /* _AIX5 */ 1797c478bd9Sstevel@tonic-gate 1807c478bd9Sstevel@tonic-gate /* 1817c478bd9Sstevel@tonic-gate ** IBM AIX 4.x 1827c478bd9Sstevel@tonic-gate */ 1837c478bd9Sstevel@tonic-gate 1847c478bd9Sstevel@tonic-gate # ifdef _AIX4 1857c478bd9Sstevel@tonic-gate # define _AIX3 1 /* pull in AIX3 stuff */ 1867c478bd9Sstevel@tonic-gate # define BSD4_4_SOCKADDR /* has sa_len */ 1877c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* seteuid(2) works */ 1887c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_NAME /* use tzname[] vector */ 1897c478bd9Sstevel@tonic-gate # ifndef SOCKOPT_LEN_T 1907c478bd9Sstevel@tonic-gate # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */ 1917c478bd9Sstevel@tonic-gate # endif /* SOCKOPT_LEN_T */ 1927c478bd9Sstevel@tonic-gate # if _AIX4 >= 40200 1937c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* setreuid(2) works as of AIX 4.2 */ 1947c478bd9Sstevel@tonic-gate # ifndef SOCKADDR_LEN_T 1957c478bd9Sstevel@tonic-gate # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */ 1967c478bd9Sstevel@tonic-gate # endif /* SOCKADDR_LEN_T */ 1977c478bd9Sstevel@tonic-gate # endif /* _AIX4 >= 40200 */ 1987c478bd9Sstevel@tonic-gate # if defined(_ILS_MACROS) /* IBM versions aren't side-effect clean */ 1997c478bd9Sstevel@tonic-gate # undef isascii 2007c478bd9Sstevel@tonic-gate # define isascii(c) !(c & ~0177) 2017c478bd9Sstevel@tonic-gate # undef isdigit 2027c478bd9Sstevel@tonic-gate # define isdigit(__a) (_IS(__a,_ISDIGIT)) 2037c478bd9Sstevel@tonic-gate # undef isspace 2047c478bd9Sstevel@tonic-gate # define isspace(__a) (_IS(__a,_ISSPACE)) 2057c478bd9Sstevel@tonic-gate # endif /* defined(_ILS_MACROS) */ 2067c478bd9Sstevel@tonic-gate # endif /* _AIX4 */ 2077c478bd9Sstevel@tonic-gate 2087c478bd9Sstevel@tonic-gate 2097c478bd9Sstevel@tonic-gate /* 2107c478bd9Sstevel@tonic-gate ** IBM AIX 3.x -- actually tested for 3.2.3 2117c478bd9Sstevel@tonic-gate */ 2127c478bd9Sstevel@tonic-gate 2137c478bd9Sstevel@tonic-gate # ifdef _AIX3 2147c478bd9Sstevel@tonic-gate # include <paths.h> 2157c478bd9Sstevel@tonic-gate # include <sys/machine.h> /* to get byte order */ 2167c478bd9Sstevel@tonic-gate # include <sys/select.h> 2177c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) */ 2187c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 2197c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 2207c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 2217c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 2227c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 2237c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 2247c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 2257c478bd9Sstevel@tonic-gate # define SPT_PADCHAR '\0' /* pad process title with nulls */ 2267c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 2277c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT 2287c478bd9Sstevel@tonic-gate # endif /* LA_TYPE */ 2297c478bd9Sstevel@tonic-gate # define FSHIFT 16 2307c478bd9Sstevel@tonic-gate # define LA_AVENRUN "avenrun" 2317c478bd9Sstevel@tonic-gate # if !defined(_AIX4) || _AIX4 < 40300 2327c478bd9Sstevel@tonic-gate # ifndef __BIT_TYPES_DEFINED__ 2337c478bd9Sstevel@tonic-gate # define SM_INT32 int 2347c478bd9Sstevel@tonic-gate # endif /* __BIT_TYPES_DEFINED__ */ 2357c478bd9Sstevel@tonic-gate # endif /* !defined(_AIX4) || _AIX4 < 40300 */ 2367c478bd9Sstevel@tonic-gate # if !defined(_AIX4) || _AIX4 < 40200 2377c478bd9Sstevel@tonic-gate # define SM_CONF_SYSLOG 0 2387c478bd9Sstevel@tonic-gate # endif /* !defined(_AIX4) || _AIX4 < 40200 */ 2397c478bd9Sstevel@tonic-gate # endif /* _AIX3 */ 2407c478bd9Sstevel@tonic-gate 2417c478bd9Sstevel@tonic-gate 2427c478bd9Sstevel@tonic-gate /* 2437c478bd9Sstevel@tonic-gate ** IBM AIX 2.2.1 -- actually tested for osupdate level 2706+1773 2447c478bd9Sstevel@tonic-gate ** 2457c478bd9Sstevel@tonic-gate ** From Mark Whetzel <markw@wg.waii.com>. 2467c478bd9Sstevel@tonic-gate */ 2477c478bd9Sstevel@tonic-gate 2487c478bd9Sstevel@tonic-gate # ifdef AIX /* AIX/RT compiler pre-defines this */ 2497c478bd9Sstevel@tonic-gate # include <paths.h> 2507c478bd9Sstevel@tonic-gate # include <sys/time.h> /* AIX/RT resource.h does NOT include this */ 2517c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 2527c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 2537c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 2547c478bd9Sstevel@tonic-gate # define HASFCHMOD 0 /* does not have fchmod(2) syscall */ 2557c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* use setreuid(2) -lbsd system call */ 2567c478bd9Sstevel@tonic-gate # define HASSETVBUF 1 /* use setvbuf(2) system call */ 2577c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 0 /* does not have setrlimit call */ 2587c478bd9Sstevel@tonic-gate # define HASFLOCK 0 /* does not have flock call - use fcntl */ 2597c478bd9Sstevel@tonic-gate # define HASULIMIT 1 /* use ulimit instead of setrlimit call */ 2607c478bd9Sstevel@tonic-gate # define SM_CONF_GETOPT 0 /* Do we need theirs or ours */ 2617c478bd9Sstevel@tonic-gate # define SYS5SETPGRP 1 /* don't have setpgid on AIX/RT */ 2627c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 2637c478bd9Sstevel@tonic-gate # define BSD4_3 1 /* NOT bsd 4.4 or posix signals */ 2647c478bd9Sstevel@tonic-gate # define GIDSET_T int 2657c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 2667c478bd9Sstevel@tonic-gate # define SPT_PADCHAR '\0' /* pad process title with nulls */ 2677c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SUBR /* use our ported loadavgd daemon */ 2687c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 2697c478bd9Sstevel@tonic-gate # define ARBPTR_T int * 2707c478bd9Sstevel@tonic-gate # define void int 2717c478bd9Sstevel@tonic-gate typedef int pid_t; 2727c478bd9Sstevel@tonic-gate /* RTisms for BSD compatibility, specified in the Makefile 2737c478bd9Sstevel@tonic-gate define BSD 1 2747c478bd9Sstevel@tonic-gate define BSD_INCLUDES 1 2757c478bd9Sstevel@tonic-gate define BSD_REMAP_SIGNAL_TO_SIGVEC 2767c478bd9Sstevel@tonic-gate RTisms needed above */ 2777c478bd9Sstevel@tonic-gate /* make this sendmail in a completely different place */ 2787c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 2797c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/local/newmail/sendmail.cf" 2807c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 2817c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 2827c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/usr/local/newmail/sendmail.pid" 2837c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 2847c478bd9Sstevel@tonic-gate # endif /* AIX */ 2857c478bd9Sstevel@tonic-gate 2867c478bd9Sstevel@tonic-gate # if defined(_AIX) 2877c478bd9Sstevel@tonic-gate # define LDA_USE_LOCKF 1 2887c478bd9Sstevel@tonic-gate # define LDA_USE_SETEUID 1 2897c478bd9Sstevel@tonic-gate # endif /* defined(_AIX) */ 2907c478bd9Sstevel@tonic-gate 2917c478bd9Sstevel@tonic-gate /* 2927c478bd9Sstevel@tonic-gate ** Silicon Graphics IRIX 2937c478bd9Sstevel@tonic-gate ** 2947c478bd9Sstevel@tonic-gate ** Compiles on 4.0.1. 2957c478bd9Sstevel@tonic-gate ** 2967c478bd9Sstevel@tonic-gate ** Use IRIX64 instead of IRIX for 64-bit IRIX (6.0). 2977c478bd9Sstevel@tonic-gate ** Use IRIX5 instead of IRIX for IRIX 5.x. 2987c478bd9Sstevel@tonic-gate ** 2997c478bd9Sstevel@tonic-gate ** IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>. 3007c478bd9Sstevel@tonic-gate ** IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>. 3017c478bd9Sstevel@tonic-gate */ 3027c478bd9Sstevel@tonic-gate 3037c478bd9Sstevel@tonic-gate # ifdef IRIX 3047c478bd9Sstevel@tonic-gate # define SYSTEM5 1 /* this is a System-V derived system */ 3057c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) call */ 3067c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 3077c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 3087c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 3097c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 1 /* can check IP source routing */ 3107c478bd9Sstevel@tonic-gate # define setpgid BSDsetpgrp 3117c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 3127c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 3137c478bd9Sstevel@tonic-gate # define SFS_BAVAIL f_bfree /* alternate field name */ 3147c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 512 3157c478bd9Sstevel@tonic-gate # if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) 3167c478bd9Sstevel@tonic-gate /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */ 3177c478bd9Sstevel@tonic-gate # define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN 3187c478bd9Sstevel@tonic-gate # endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */ 3197c478bd9Sstevel@tonic-gate # ifdef IRIX6 3207c478bd9Sstevel@tonic-gate # define STAT64 1 3217c478bd9Sstevel@tonic-gate # define QUAD_T unsigned long long 3227c478bd9Sstevel@tonic-gate # define LA_TYPE LA_IRIX6 /* figure out at run time */ 3237c478bd9Sstevel@tonic-gate # define SAFENFSPATHCONF 0 /* pathconf(2) lies on NFS filesystems */ 3247c478bd9Sstevel@tonic-gate # else /* IRIX6 */ 3257c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT 3267c478bd9Sstevel@tonic-gate 3277c478bd9Sstevel@tonic-gate # ifdef IRIX64 3287c478bd9Sstevel@tonic-gate # define STAT64 1 3297c478bd9Sstevel@tonic-gate # define QUAD_T unsigned long long 3307c478bd9Sstevel@tonic-gate # define NAMELISTMASK 0x7fffffffffffffff /* mask for nlist() values */ 3317c478bd9Sstevel@tonic-gate # else /* IRIX64 */ 3327c478bd9Sstevel@tonic-gate # define STAT64 0 3337c478bd9Sstevel@tonic-gate # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ 3347c478bd9Sstevel@tonic-gate # endif /* IRIX64 */ 3357c478bd9Sstevel@tonic-gate # endif /* IRIX6 */ 3367c478bd9Sstevel@tonic-gate # if defined(IRIX64) || defined(IRIX5) || defined(IRIX6) 3377c478bd9Sstevel@tonic-gate # include <sys/cdefs.h> 3387c478bd9Sstevel@tonic-gate # include <paths.h> 3397c478bd9Sstevel@tonic-gate # define ARGV_T char *const * 3407c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) */ 3417c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 1 /* has setrlimit(2) syscall */ 3427c478bd9Sstevel@tonic-gate # define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */ 3437c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 /* has strerror(3) */ 3447c478bd9Sstevel@tonic-gate # else /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */ 3457c478bd9Sstevel@tonic-gate # define ARGV_T const char ** 3467c478bd9Sstevel@tonic-gate # define WAITUNION 1 /* use "union wait" as wait argument type */ 3477c478bd9Sstevel@tonic-gate # endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */ 3487c478bd9Sstevel@tonic-gate # endif /* IRIX */ 3497c478bd9Sstevel@tonic-gate 3507c478bd9Sstevel@tonic-gate 3517c478bd9Sstevel@tonic-gate /* 3527c478bd9Sstevel@tonic-gate ** SunOS and Solaris 3537c478bd9Sstevel@tonic-gate ** 3547c478bd9Sstevel@tonic-gate ** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and 3557c478bd9Sstevel@tonic-gate ** Solaris 2.4 (a.k.a. SunOS 5.4). 3567c478bd9Sstevel@tonic-gate */ 3577c478bd9Sstevel@tonic-gate 3587c478bd9Sstevel@tonic-gate # if defined(sun) && !defined(BSD) 3597c478bd9Sstevel@tonic-gate 3607c478bd9Sstevel@tonic-gate # include <sys/time.h> 3617c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 3627c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 3637c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 3647c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 1 /* can check IP source routing */ 3657c478bd9Sstevel@tonic-gate # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 3667c478bd9Sstevel@tonic-gate # ifndef HASFCHOWN 3677c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* fchown(2) */ 3687c478bd9Sstevel@tonic-gate # endif /* ! HASFCHOWN */ 3697c478bd9Sstevel@tonic-gate 3707c478bd9Sstevel@tonic-gate # ifdef __svr4__ 3717c478bd9Sstevel@tonic-gate # define LDA_USE_LOCKF 1 3727c478bd9Sstevel@tonic-gate # define LDA_USE_SETEUID 1 3737c478bd9Sstevel@tonic-gate # define _PATH_MAILDIR "/var/mail" 3747c478bd9Sstevel@tonic-gate # endif /* __svr4__ */ 3757c478bd9Sstevel@tonic-gate 3767c478bd9Sstevel@tonic-gate # ifdef SOLARIS_2_3 3777c478bd9Sstevel@tonic-gate # define SOLARIS 20300 /* for back compat only -- use -DSOLARIS=20300 */ 3787c478bd9Sstevel@tonic-gate # endif /* SOLARIS_2_3 */ 3797c478bd9Sstevel@tonic-gate 3807c478bd9Sstevel@tonic-gate # if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) 3817c478bd9Sstevel@tonic-gate # define SOLARIS 1 /* unknown Solaris version */ 3827c478bd9Sstevel@tonic-gate # endif /* defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) */ 3837c478bd9Sstevel@tonic-gate 3847c478bd9Sstevel@tonic-gate # ifdef SOLARIS 3857c478bd9Sstevel@tonic-gate /* Solaris 2.x (a.k.a. SunOS 5.x) */ 3867c478bd9Sstevel@tonic-gate # ifndef __svr4__ 3877c478bd9Sstevel@tonic-gate # define __svr4__ /* use all System V Release 4 defines below */ 3887c478bd9Sstevel@tonic-gate # endif /* ! __svr4__ */ 3897c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 3907c478bd9Sstevel@tonic-gate # define USE_SA_SIGACTION 1 /* use sa_sigaction field */ 3917c478bd9Sstevel@tonic-gate # define BROKEN_PTHREAD_SLEEP 1 /* sleep after pthread_create() fails */ 3927c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 /* has strerror(3) */ 3937c478bd9Sstevel@tonic-gate # ifndef _PATH_UNIX 3947c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/dev/ksyms" 3957c478bd9Sstevel@tonic-gate # endif /* ! _PATH_UNIX */ 3967c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 3977c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 3987c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 3997c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 4007c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 4017c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 4027c478bd9Sstevel@tonic-gate # ifndef _PATH_HOSTS 4037c478bd9Sstevel@tonic-gate # define _PATH_HOSTS "/etc/inet/hosts" 4047c478bd9Sstevel@tonic-gate # endif /* ! _PATH_HOSTS */ 4057c478bd9Sstevel@tonic-gate # ifndef SYSLOG_BUFSIZE 4067c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 4077c478bd9Sstevel@tonic-gate # endif /* ! SYSLOG_BUFSIZE */ 4087c478bd9Sstevel@tonic-gate # ifndef TZ_TYPE 4097c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TZNAME 4107c478bd9Sstevel@tonic-gate # endif /* ! TZ_TYPE */ 4117c478bd9Sstevel@tonic-gate # if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) 4127c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* seteuid works as of 2.3 */ 4137c478bd9Sstevel@tonic-gate # define LDA_CONTENTLENGTH 1 /* Needs the Content-Length header */ 4147c478bd9Sstevel@tonic-gate # endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */ 4157c478bd9Sstevel@tonic-gate # if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) 4167c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* setreuid works as of 2.5 */ 4177c478bd9Sstevel@tonic-gate # define HASSETREGID 1 /* use setregid(2) to set saved gid */ 41849218d4fSjbeck # if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) 41949218d4fSjbeck # define HASSNPRINTF 1 /* has snprintf(3c) starting in 2.6 */ 42049218d4fSjbeck # endif /* SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) */ 4217c478bd9Sstevel@tonic-gate # if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) 4227c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 4237c478bd9Sstevel@tonic-gate # define LA_TYPE LA_KSTAT /* use kstat(3k) -- may work in < 2.5 */ 4247c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 4257c478bd9Sstevel@tonic-gate # ifndef RANDOMSHIFT /* random() doesn't work well (sometimes) */ 4267c478bd9Sstevel@tonic-gate # define RANDOMSHIFT 8 4277c478bd9Sstevel@tonic-gate # endif /* ! RANDOMSHIFT */ 4287c478bd9Sstevel@tonic-gate # endif /* SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) */ 4297c478bd9Sstevel@tonic-gate # else /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */ 4307c478bd9Sstevel@tonic-gate # ifndef HASRANDOM 4317c478bd9Sstevel@tonic-gate # define HASRANDOM 0 /* doesn't have random(3) */ 4327c478bd9Sstevel@tonic-gate # endif /* ! HASRANDOM */ 4337c478bd9Sstevel@tonic-gate # endif /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */ 4347c478bd9Sstevel@tonic-gate # if (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206 4357c478bd9Sstevel@tonic-gate # define SM_INT32 int /* 32bit integer */ 4367c478bd9Sstevel@tonic-gate # endif /* (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206 */ 4377c478bd9Sstevel@tonic-gate # if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) 4387c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 4397c478bd9Sstevel@tonic-gate # include <sys/loadavg.h> 4407c478bd9Sstevel@tonic-gate # if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) 4417c478bd9Sstevel@tonic-gate # include <sys/pset.h> 4427c478bd9Sstevel@tonic-gate # define LA_TYPE LA_PSET /* pset_getloadavg(3c) appears in 2.9 */ 4437c478bd9Sstevel@tonic-gate # else /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */ 4447c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SUBR /* getloadavg(3c) appears in 2.7 */ 4457c478bd9Sstevel@tonic-gate # endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */ 4467c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 4477c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 1 /* getusershell(3c) bug fixed in 2.7 */ 4487c478bd9Sstevel@tonic-gate # endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */ 4497c478bd9Sstevel@tonic-gate # if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) 4507c478bd9Sstevel@tonic-gate # undef _PATH_SENDMAILPID /* tmpfs /var/run added in 2.8 */ 4517c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 4527c478bd9Sstevel@tonic-gate # ifndef SMRSH_CMDDIR 4537c478bd9Sstevel@tonic-gate # define SMRSH_CMDDIR "/var/adm/sm.bin" 4547c478bd9Sstevel@tonic-gate # endif /* ! SMRSH_CMDDIR */ 4557c478bd9Sstevel@tonic-gate # define SL_FUDGE 34 /* fudge offset for SyslogPrefixLen */ 4567c478bd9Sstevel@tonic-gate # define HASLDAPGETALIASBYNAME 1 /* added in S8 */ 4577c478bd9Sstevel@tonic-gate # endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */ 4587c478bd9Sstevel@tonic-gate # if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) 4597c478bd9Sstevel@tonic-gate # define HASURANDOMDEV 1 /* /dev/[u]random added in S9 */ 4607c478bd9Sstevel@tonic-gate # define HASCLOSEFROM 1 /* closefrom(3c) added in S9 */ 4617c478bd9Sstevel@tonic-gate # define HASFDWALK 1 /* fdwalk(3c) added in S9 */ 4627c478bd9Sstevel@tonic-gate # endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */ 4637c478bd9Sstevel@tonic-gate # if SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) 4647c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* unsetenv() added in S10 */ 4657c478bd9Sstevel@tonic-gate # endif /* SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) */ 4667800901eSjbeck # if SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) 4677800901eSjbeck # define GETLDAPALIASBYNAME_VERSION 2 /* changed in S11 */ 468*39c1a28dSJohn Beck # define HAVE_NANOSLEEP 1 /* moved from librt to libc in S11 */ 4697800901eSjbeck # endif /* SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) */ 4707c478bd9Sstevel@tonic-gate # ifndef HASGETUSERSHELL 4717c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */ 4727c478bd9Sstevel@tonic-gate # endif /* ! HASGETUSERSHELL */ 4737c478bd9Sstevel@tonic-gate 4747c478bd9Sstevel@tonic-gate # else /* SOLARIS */ 4757c478bd9Sstevel@tonic-gate /* SunOS 4.0.3 or 4.1.x */ 4767c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 4777c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) call */ 4787c478bd9Sstevel@tonic-gate # ifndef HASFLOCK 4797c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* has flock(2) call */ 4807c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */ 4817c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 4827c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 4837c478bd9Sstevel@tonic-gate # include <memory.h> 4847c478bd9Sstevel@tonic-gate # include <vfork.h> 4857c478bd9Sstevel@tonic-gate # ifdef __GNUC__ 4867c478bd9Sstevel@tonic-gate # define strtoul strtol /* gcc library bogosity */ 4877c478bd9Sstevel@tonic-gate # endif /* __GNUC__ */ 4887c478bd9Sstevel@tonic-gate # define memmove(d, s, l) (bcopy((s), (d), (l))) 4897c478bd9Sstevel@tonic-gate # define atexit(f) on_exit((f), 0) /* ugly hack for SunOS */ 4907c478bd9Sstevel@tonic-gate # define SM_INT32 int /* 32bit integer */ 4917c478bd9Sstevel@tonic-gate # define SM_ALIGN_SIZE (sizeof(long)) 4927c478bd9Sstevel@tonic-gate # define GIDSET_T int 4937c478bd9Sstevel@tonic-gate # define SM_CONF_SYSLOG 0 4947c478bd9Sstevel@tonic-gate 4957c478bd9Sstevel@tonic-gate # ifdef SUNOS403 4967c478bd9Sstevel@tonic-gate /* special tweaking for SunOS 4.0.3 */ 4977c478bd9Sstevel@tonic-gate # include <malloc.h> 4987c478bd9Sstevel@tonic-gate # define BSD4_3 1 /* 4.3 BSD-based */ 4997c478bd9Sstevel@tonic-gate # define NEEDSTRSTR 1 /* need emulation of strstr(3) routine */ 5007c478bd9Sstevel@tonic-gate # define WAITUNION 1 /* use "union wait" as wait argument type */ 5017c478bd9Sstevel@tonic-gate # undef WIFEXITED 5027c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 5037c478bd9Sstevel@tonic-gate # undef HASUNAME 5047c478bd9Sstevel@tonic-gate # define setpgid setpgrp 5057c478bd9Sstevel@tonic-gate # define MODE_T int 5067c478bd9Sstevel@tonic-gate typedef int pid_t; 5077c478bd9Sstevel@tonic-gate extern char *getenv(); 5087c478bd9Sstevel@tonic-gate 5097c478bd9Sstevel@tonic-gate # else /* SUNOS403 */ 5107c478bd9Sstevel@tonic-gate /* 4.1.x specifics */ 5117c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 5127c478bd9Sstevel@tonic-gate # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 5137c478bd9Sstevel@tonic-gate 5147c478bd9Sstevel@tonic-gate # endif /* SUNOS403 */ 5157c478bd9Sstevel@tonic-gate # endif /* SOLARIS */ 5167c478bd9Sstevel@tonic-gate 5177c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 5187c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT 5197c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 5207c478bd9Sstevel@tonic-gate 5217c478bd9Sstevel@tonic-gate # endif /* defined(sun) && !defined(BSD) */ 5227c478bd9Sstevel@tonic-gate 5237c478bd9Sstevel@tonic-gate /* 5247c478bd9Sstevel@tonic-gate ** DG/UX 5257c478bd9Sstevel@tonic-gate ** 5267c478bd9Sstevel@tonic-gate ** Tested on 5.4.2 and 5.4.3. Use DGUX_5_4_2 to get the 5277c478bd9Sstevel@tonic-gate ** older support. 5287c478bd9Sstevel@tonic-gate ** 5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>. 5297c478bd9Sstevel@tonic-gate */ 5307c478bd9Sstevel@tonic-gate 5317c478bd9Sstevel@tonic-gate # ifdef DGUX_5_4_2 5327c478bd9Sstevel@tonic-gate # define DGUX 1 5337c478bd9Sstevel@tonic-gate # endif /* DGUX_5_4_2 */ 5347c478bd9Sstevel@tonic-gate 5357c478bd9Sstevel@tonic-gate # ifdef DGUX 5367c478bd9Sstevel@tonic-gate # define SYSTEM5 1 5377c478bd9Sstevel@tonic-gate # define LA_TYPE LA_DGUX 5387c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) call */ 5397c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 5407c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 5417c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 5427c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */ 5437c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) */ 5447c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 5457c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 5467c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 5477c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 5487c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 5497c478bd9Sstevel@tonic-gate # define LDA_USE_LOCKF 1 5507c478bd9Sstevel@tonic-gate 5517c478bd9Sstevel@tonic-gate /* these include files must be included early on DG/UX */ 5527c478bd9Sstevel@tonic-gate # include <netinet/in.h> 5537c478bd9Sstevel@tonic-gate # include <arpa/inet.h> 5547c478bd9Sstevel@tonic-gate 5557c478bd9Sstevel@tonic-gate /* compiler doesn't understand const? */ 5567c478bd9Sstevel@tonic-gate # define const 5577c478bd9Sstevel@tonic-gate 5587c478bd9Sstevel@tonic-gate # ifdef DGUX_5_4_2 5597c478bd9Sstevel@tonic-gate # define inet_addr dgux_inet_addr 5607c478bd9Sstevel@tonic-gate extern long dgux_inet_addr(); 5617c478bd9Sstevel@tonic-gate # endif /* DGUX_5_4_2 */ 5627c478bd9Sstevel@tonic-gate # endif /* DGUX */ 5637c478bd9Sstevel@tonic-gate 5647c478bd9Sstevel@tonic-gate 5657c478bd9Sstevel@tonic-gate /* 5667c478bd9Sstevel@tonic-gate ** Digital Ultrix 4.2 - 4.5 5677c478bd9Sstevel@tonic-gate ** 5687c478bd9Sstevel@tonic-gate ** Apparently, fcntl locking is broken on 4.2A, in that locks are 5697c478bd9Sstevel@tonic-gate ** not dropped when the process exits. This causes major problems, 5707c478bd9Sstevel@tonic-gate ** so flock is the only alternative. 5717c478bd9Sstevel@tonic-gate */ 5727c478bd9Sstevel@tonic-gate 5737c478bd9Sstevel@tonic-gate # ifdef ultrix 5747c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) call */ 5757c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) call */ 5767c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 5777c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 5787c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 5797c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) syscall */ 5807c478bd9Sstevel@tonic-gate # ifndef HASFLOCK 5817c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* has flock(2) call */ 5827c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */ 5837c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 5847c478bd9Sstevel@tonic-gate # ifndef BROKEN_RES_SEARCH 5857c478bd9Sstevel@tonic-gate # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 5867c478bd9Sstevel@tonic-gate # endif /* ! BROKEN_RES_SEARCH */ 5877c478bd9Sstevel@tonic-gate # if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 5887c478bd9Sstevel@tonic-gate # define NEEDLOCAL_HOSTNAME_LENGTH 1 /* see sendmail/README */ 5897c478bd9Sstevel@tonic-gate # endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */ 5907c478bd9Sstevel@tonic-gate # ifdef vax 5917c478bd9Sstevel@tonic-gate # define LA_TYPE LA_FLOAT 5927c478bd9Sstevel@tonic-gate # else /* vax */ 5937c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT 5947c478bd9Sstevel@tonic-gate # define LA_AVENRUN "avenrun" 5957c478bd9Sstevel@tonic-gate # endif /* vax */ 5967c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 5977c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 5987c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* pre-4.4 TCP/IP implementation is broken */ 5997c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 6007c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 256 6017c478bd9Sstevel@tonic-gate # define SM_CONF_SYSLOG 0 6027c478bd9Sstevel@tonic-gate # endif /* ultrix */ 6037c478bd9Sstevel@tonic-gate 6047c478bd9Sstevel@tonic-gate 6057c478bd9Sstevel@tonic-gate /* 6067c478bd9Sstevel@tonic-gate ** OSF/1 for KSR. 6077c478bd9Sstevel@tonic-gate ** 6087c478bd9Sstevel@tonic-gate ** Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu> 6097c478bd9Sstevel@tonic-gate */ 6107c478bd9Sstevel@tonic-gate 6117c478bd9Sstevel@tonic-gate # ifdef __ksr__ 6127c478bd9Sstevel@tonic-gate # define __osf__ 1 /* get OSF/1 defines below */ 6137c478bd9Sstevel@tonic-gate # ifndef TZ_TYPE 6147c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 6157c478bd9Sstevel@tonic-gate # endif /* ! TZ_TYPE */ 6167c478bd9Sstevel@tonic-gate # endif /* __ksr__ */ 6177c478bd9Sstevel@tonic-gate 6187c478bd9Sstevel@tonic-gate 6197c478bd9Sstevel@tonic-gate /* 6207c478bd9Sstevel@tonic-gate ** OSF/1 for Intel Paragon. 6217c478bd9Sstevel@tonic-gate ** 6227c478bd9Sstevel@tonic-gate ** Contributed by Jeff A. Earickson <jeff@ssd.intel.com> 6237c478bd9Sstevel@tonic-gate ** of Intel Scalable Systems Divison. 6247c478bd9Sstevel@tonic-gate */ 6257c478bd9Sstevel@tonic-gate 6267c478bd9Sstevel@tonic-gate # ifdef __PARAGON__ 6277c478bd9Sstevel@tonic-gate # define __osf__ 1 /* get OSF/1 defines below */ 6287c478bd9Sstevel@tonic-gate # ifndef TZ_TYPE 6297c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 6307c478bd9Sstevel@tonic-gate # endif /* ! TZ_TYPE */ 6317c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 6327c478bd9Sstevel@tonic-gate # define MAXNAMLEN NAME_MAX 6337c478bd9Sstevel@tonic-gate # endif /* __PARAGON__ */ 6347c478bd9Sstevel@tonic-gate 6357c478bd9Sstevel@tonic-gate 6367c478bd9Sstevel@tonic-gate /* 6377c478bd9Sstevel@tonic-gate ** Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1 6387c478bd9Sstevel@tonic-gate ** 6397c478bd9Sstevel@tonic-gate ** Tested for 3.2 and 4.0. 6407c478bd9Sstevel@tonic-gate */ 6417c478bd9Sstevel@tonic-gate 6427c478bd9Sstevel@tonic-gate # ifdef __osf__ 6437c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* has uname(2) call */ 6447c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) call */ 6457c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* has usable seteuid(2) call */ 6467c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 6477c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 6487c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) syscall */ 6497c478bd9Sstevel@tonic-gate # define HASSETLOGIN 1 /* has setlogin(2) */ 6507c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 1 /* can check IP source routing */ 6517c478bd9Sstevel@tonic-gate # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 6527c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 6537c478bd9Sstevel@tonic-gate # define SM_INT32 int /* 32bit integer */ 6547c478bd9Sstevel@tonic-gate # ifndef HASFLOCK 6557c478bd9Sstevel@tonic-gate # include <standards.h> 6567c478bd9Sstevel@tonic-gate # if _XOPEN_SOURCE+0 >= 400 6577c478bd9Sstevel@tonic-gate # define HASFLOCK 0 /* 5.0 and later has bad flock(2) call */ 6587c478bd9Sstevel@tonic-gate # else /* _XOPEN_SOURCE+0 >= 400 */ 6597c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* has flock(2) call */ 6607c478bd9Sstevel@tonic-gate # endif /* _XOPEN_SOURCE+0 >= 400 */ 6617c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */ 6627c478bd9Sstevel@tonic-gate # define LA_TYPE LA_ALPHAOSF 6637c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATVFS /* use <sys/statvfs.h> statfs() impl */ 6647c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 6657c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/var/adm/sendmail/sendmail.cf" 6667c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 6677c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 6687c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 6697c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 6707c478bd9Sstevel@tonic-gate # if _FFR_DIGUNIX_SAFECHOWN 6717c478bd9Sstevel@tonic-gate /* 6727c478bd9Sstevel@tonic-gate ** Testing on a Digital UNIX 4.0a system showed this to be the correct 6737c478bd9Sstevel@tonic-gate ** setting but given the security consequences, more testing and 6747c478bd9Sstevel@tonic-gate ** verification is needed. Unfortunately, the man page offers no 6757c478bd9Sstevel@tonic-gate ** assistance. 6767c478bd9Sstevel@tonic-gate */ 6777c478bd9Sstevel@tonic-gate # define IS_SAFE_CHOWN >= 0 6787c478bd9Sstevel@tonic-gate # endif /* _FFR_DIGUNIX_SAFECHOWN */ 6797c478bd9Sstevel@tonic-gate # endif /* __osf__ */ 6807c478bd9Sstevel@tonic-gate 6817c478bd9Sstevel@tonic-gate 6827c478bd9Sstevel@tonic-gate /* 6837c478bd9Sstevel@tonic-gate ** NeXTstep 6847c478bd9Sstevel@tonic-gate */ 6857c478bd9Sstevel@tonic-gate 6867c478bd9Sstevel@tonic-gate # ifdef NeXT 6877c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 6887c478bd9Sstevel@tonic-gate # define NEEDPUTENV 2 /* need putenv(3) call; no setenv(3) call */ 6897c478bd9Sstevel@tonic-gate # ifndef HASFLOCK 6907c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* has flock(2) call */ 6917c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */ 6927c478bd9Sstevel@tonic-gate # define UID_T int /* compiler gripes on uid_t */ 6937c478bd9Sstevel@tonic-gate # define GID_T int /* ditto for gid_t */ 6947c478bd9Sstevel@tonic-gate # define MODE_T int /* and mode_t */ 6957c478bd9Sstevel@tonic-gate # define setpgid setpgrp 6967c478bd9Sstevel@tonic-gate # ifndef NOT_SENDMAIL 6977c478bd9Sstevel@tonic-gate # define sleep sleepX 6987c478bd9Sstevel@tonic-gate # endif /* ! NOT_SENDMAIL */ 6997c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 7007c478bd9Sstevel@tonic-gate # define LA_TYPE LA_MACH 7017c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 7027c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 7037c478bd9Sstevel@tonic-gate # ifdef _POSIX_SOURCE 7047c478bd9Sstevel@tonic-gate extern struct passwd *getpwent(); 7057c478bd9Sstevel@tonic-gate # else /* _POSIX_SOURCE */ 7067c478bd9Sstevel@tonic-gate # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 7077c478bd9Sstevel@tonic-gate # define WAITUNION 1 /* use "union wait" as wait argument type */ 7087c478bd9Sstevel@tonic-gate typedef int pid_t; 7097c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 7107c478bd9Sstevel@tonic-gate # undef WIFEXITED 7117c478bd9Sstevel@tonic-gate # undef WIFSTOPPED 7127c478bd9Sstevel@tonic-gate # undef WTERMSIG 7137c478bd9Sstevel@tonic-gate # endif /* _POSIX_SOURCE */ 7147c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 7157c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/etc/sendmail/sendmail.cf" 7167c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 7177c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 7187c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" 7197c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 7207c478bd9Sstevel@tonic-gate # define SM_INT32 int /* 32bit integer */ 7217c478bd9Sstevel@tonic-gate 7227c478bd9Sstevel@tonic-gate # ifdef TCPWRAPPERS 7237c478bd9Sstevel@tonic-gate # ifndef HASUNSETENV 7247c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 7257c478bd9Sstevel@tonic-gate # endif /* ! HASUNSETENV */ 7267c478bd9Sstevel@tonic-gate # undef NEEDPUTENV 7277c478bd9Sstevel@tonic-gate # endif /* TCPWRAPPERS */ 7287c478bd9Sstevel@tonic-gate # ifndef __APPLE__ 7297c478bd9Sstevel@tonic-gate # include <libc.h> 7307c478bd9Sstevel@tonic-gate # ifndef S_IRUSR 7317c478bd9Sstevel@tonic-gate # define S_IRUSR S_IREAD 7327c478bd9Sstevel@tonic-gate # endif /* ! S_IRUSR */ 7337c478bd9Sstevel@tonic-gate # ifndef S_IWUSR 7347c478bd9Sstevel@tonic-gate # define S_IWUSR S_IWRITE 7357c478bd9Sstevel@tonic-gate # endif /* ! S_IWUSR */ 7367c478bd9Sstevel@tonic-gate # define _PATH_MAILDIR "/usr/spool/mail" 7377c478bd9Sstevel@tonic-gate # endif /* ! __APPLE__ */ 7387c478bd9Sstevel@tonic-gate # ifndef isascii 7397c478bd9Sstevel@tonic-gate # define isascii(c) ((unsigned)(c) <= 0177) 7407c478bd9Sstevel@tonic-gate # endif /* ! isascii */ 7417c478bd9Sstevel@tonic-gate # endif /* NeXT */ 7427c478bd9Sstevel@tonic-gate 7437c478bd9Sstevel@tonic-gate /* 7447c478bd9Sstevel@tonic-gate ** Apple Darwin 7457c478bd9Sstevel@tonic-gate ** Contributed by Wilfredo Sanchez <wsanchez@mit.edu> 7467c478bd9Sstevel@tonic-gate */ 7477c478bd9Sstevel@tonic-gate 7487c478bd9Sstevel@tonic-gate # if defined(DARWIN) 7497c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) */ 7507c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) */ 7517c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* has flock(2) */ 7527c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* has uname(2) */ 7537c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) */ 75449218d4fSjbeck # define HASSETSID 1 /* has POSIX setsid(2) call */ 75549218d4fSjbeck # define HASINITGROUPS 1 /* has initgroups(3) */ 7567c478bd9Sstevel@tonic-gate # define HASSETVBUF 1 /* has setvbuf (3) */ 7577c478bd9Sstevel@tonic-gate # define HASSETREUID 0 /* setreuid(2) unusable */ 7587c478bd9Sstevel@tonic-gate # define HASSETEUID 1 /* has seteuid(2) */ 7597c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* has seteuid(2) */ 7607c478bd9Sstevel@tonic-gate # define HASSETEGID 1 /* has setegid(2) */ 7617c478bd9Sstevel@tonic-gate # define HASSETREGID 1 /* has setregid(2) */ 7627c478bd9Sstevel@tonic-gate # define HASSETRESGID 0 /* no setresgid(2) */ 7637c478bd9Sstevel@tonic-gate # define HASLSTAT 1 /* has lstat(2) */ 7647c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 1 /* has setrlimit(2) */ 7657c478bd9Sstevel@tonic-gate # define HASWAITPID 1 /* has waitpid(2) */ 7667c478bd9Sstevel@tonic-gate # define HASGETDTABLESIZE 1 /* has getdtablesize(2) */ 7677c478bd9Sstevel@tonic-gate # define HAS_ST_GEN 1 /* has st_gen field in struct stat */ 76849218d4fSjbeck # define HASURANDOMDEV 1 /* has urandom(4) */ 7697c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 /* has strerror(3) */ 7707c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 1 /* had getusershell(3) */ 7717c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t /* getgroups(2) takes gid_t */ 7727c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SUBR /* use getloadavg(3) */ 7737c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 774445f2479Sjbeck # if DARWIN >= 70000 775445f2479Sjbeck # define SOCKADDR_LEN_T socklen_t 776445f2479Sjbeck # endif 77749218d4fSjbeck # if DARWIN >= 80000 77849218d4fSjbeck # define SPT_TYPE SPT_REUSEARGV 77949218d4fSjbeck # define SPT_PADCHAR '\0' 78049218d4fSjbeck # define SOCKOPT_LEN_T socklen_t 78149218d4fSjbeck # else 78249218d4fSjbeck # define SPT_TYPE SPT_PSSTRINGS /* use magic PS_STRINGS pointer for setproctitle */ 78349218d4fSjbeck # endif 7847c478bd9Sstevel@tonic-gate # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 7857c478bd9Sstevel@tonic-gate # define BSD4_4_SOCKADDR /* struct sockaddr has sa_len */ 7867c478bd9Sstevel@tonic-gate # define SAFENFSPATHCONF 0 /* unverified: pathconf(2) doesn't work on NFS */ 7877c478bd9Sstevel@tonic-gate # define HAS_IN_H 1 7887c478bd9Sstevel@tonic-gate # define NETLINK 1 /* supports AF_LINK */ 7897c478bd9Sstevel@tonic-gate # ifndef NOT_SENDMAIL 7907c478bd9Sstevel@tonic-gate # define sleep sleepX 7917c478bd9Sstevel@tonic-gate extern unsigned int sleepX __P((unsigned int seconds)); 7927c478bd9Sstevel@tonic-gate # endif /* ! NOT_SENDMAIL */ 7937c478bd9Sstevel@tonic-gate # endif /* defined(DARWIN) */ 7947c478bd9Sstevel@tonic-gate 7957c478bd9Sstevel@tonic-gate 7967c478bd9Sstevel@tonic-gate /* 7977c478bd9Sstevel@tonic-gate ** 4.4 BSD 7987c478bd9Sstevel@tonic-gate ** 7997c478bd9Sstevel@tonic-gate ** See also BSD defines. 8007c478bd9Sstevel@tonic-gate */ 8017c478bd9Sstevel@tonic-gate 80249218d4fSjbeck # if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN) 8037c478bd9Sstevel@tonic-gate # include <paths.h> 8047c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) call */ 8057c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* has usable seteuid(2) call */ 8067c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 8077c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) syscall */ 8087c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 /* has strerror(3) */ 8097c478bd9Sstevel@tonic-gate # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 8107c478bd9Sstevel@tonic-gate # include <sys/cdefs.h> 8117c478bd9Sstevel@tonic-gate # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 8127c478bd9Sstevel@tonic-gate # define BSD4_4_SOCKADDR /* has sa_len */ 8137c478bd9Sstevel@tonic-gate # define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */ 8147c478bd9Sstevel@tonic-gate # define NETLINK 1 /* supports AF_LINK */ 8157c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 8167c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SUBR 8177c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 8187c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 8197c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */ 82049218d4fSjbeck # endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN)*/ 8217c478bd9Sstevel@tonic-gate 8227c478bd9Sstevel@tonic-gate 8237c478bd9Sstevel@tonic-gate /* 8247c478bd9Sstevel@tonic-gate ** BSD/OS (was BSD/386) (all versions) 8257c478bd9Sstevel@tonic-gate ** From Tony Sanders, BSDI 8267c478bd9Sstevel@tonic-gate */ 8277c478bd9Sstevel@tonic-gate 8287c478bd9Sstevel@tonic-gate # ifdef __bsdi__ 8297c478bd9Sstevel@tonic-gate # include <paths.h> 8307c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has the unsetenv(3) call */ 8317c478bd9Sstevel@tonic-gate # define HASSETREUID 0 /* BSD-OS has broken setreuid(2) emulation */ 8327c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 8337c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* has usable seteuid(2) call */ 8347c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 8357c478bd9Sstevel@tonic-gate # define HASSETLOGIN 1 /* has setlogin(2) */ 8367c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* has uname(2) syscall */ 8377c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 /* has strerror(3) */ 8387c478bd9Sstevel@tonic-gate # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 8397c478bd9Sstevel@tonic-gate # include <sys/cdefs.h> 8407c478bd9Sstevel@tonic-gate # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 8417c478bd9Sstevel@tonic-gate # define BSD4_4_SOCKADDR /* has sa_len */ 8427c478bd9Sstevel@tonic-gate # define NETLINK 1 /* supports AF_LINK */ 8437c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 8447c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 8457c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SUBR 8467c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 8477c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 8487c478bd9Sstevel@tonic-gate # define QUAD_T quad_t 8497c478bd9Sstevel@tonic-gate # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 8507c478bd9Sstevel@tonic-gate /* version 1.1 or later */ 8517c478bd9Sstevel@tonic-gate # undef SPT_TYPE 8527c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 8537c478bd9Sstevel@tonic-gate # else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */ 8547c478bd9Sstevel@tonic-gate /* version 1.0 or earlier */ 8557c478bd9Sstevel@tonic-gate # define SPT_PADCHAR '\0' /* pad process title with nulls */ 8567c478bd9Sstevel@tonic-gate # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */ 8577c478bd9Sstevel@tonic-gate # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 /* on 3.x */ 8587c478bd9Sstevel@tonic-gate # define HASSETUSERCONTEXT 1 /* has setusercontext */ 8597c478bd9Sstevel@tonic-gate # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */ 8607c478bd9Sstevel@tonic-gate # if defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 /* 3.1 and earlier */ 8617c478bd9Sstevel@tonic-gate # define MODE_T int /* va_arg() can't handle less than int */ 8627c478bd9Sstevel@tonic-gate # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 */ 8637c478bd9Sstevel@tonic-gate # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 /* on 4.x */ 8647c478bd9Sstevel@tonic-gate # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 8657c478bd9Sstevel@tonic-gate # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 */ 8667c478bd9Sstevel@tonic-gate # endif /* __bsdi__ */ 8677c478bd9Sstevel@tonic-gate 8687c478bd9Sstevel@tonic-gate 8694aac33d3Sjbeck # if defined(__QNX__) 8704aac33d3Sjbeck # if defined(__QNXNTO__) 8714aac33d3Sjbeck /* QNX 6 */ 8724aac33d3Sjbeck # include <unix.h> 8734aac33d3Sjbeck # define HASUNSETENV 1 /* has unsetenv(3) call */ 8744aac33d3Sjbeck # define HASINITGROUPS 1 /* has initgroups(3) call */ 8754aac33d3Sjbeck # define HASSETSID 1 /* has POSIX setsid(2) call */ 8764aac33d3Sjbeck # define USESETEUID 1 /* has usable seteuid(2) call */ 8774aac33d3Sjbeck # define HASFCHMOD 1 /* has fchmod(2) syscall */ 8784aac33d3Sjbeck # define HASFCHOWN 1 /* has fchown(2) syscall */ 8794aac33d3Sjbeck # define HASUNAME 1 /* has uname(2) syscall */ 8804aac33d3Sjbeck # define HASSTRERROR 1 /* has strerror(3) */ 8814aac33d3Sjbeck # define BSD4_4_SOCKADDR /* has sa_len */ 8824aac33d3Sjbeck # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 8834aac33d3Sjbeck # define NETLINK 1 /* supports AF_LINK */ 8844aac33d3Sjbeck # define GIDSET_T gid_t 8854aac33d3Sjbeck # define QUAD_T uint64_t 8864aac33d3Sjbeck # define HASSNPRINTF 1 /* has snprintf(3) (all versions?) */ 8874aac33d3Sjbeck # define HASGETUSERSHELL 0 8884aac33d3Sjbeck 8894aac33d3Sjbeck /* 8904aac33d3Sjbeck ** We have a strrev() that doesn't allocate anything. 8914aac33d3Sjbeck ** Make sure the one here is used. 8924aac33d3Sjbeck */ 8934aac33d3Sjbeck 8944aac33d3Sjbeck # define strrev strrev_sendmail 8954aac33d3Sjbeck 8964aac33d3Sjbeck # else /* defined(__QNXNTO__) */ 8974aac33d3Sjbeck 8987c478bd9Sstevel@tonic-gate /* 8997c478bd9Sstevel@tonic-gate ** QNX 4.2x 9007c478bd9Sstevel@tonic-gate ** Contributed by Glen McCready <glen@qnx.com>. 9017c478bd9Sstevel@tonic-gate ** 9024aac33d3Sjbeck ** Should work with all versions of QNX 4. 9037c478bd9Sstevel@tonic-gate */ 9047c478bd9Sstevel@tonic-gate 9054aac33d3Sjbeck # include <unix.h> 9064aac33d3Sjbeck # include <sys/select.h> 9074aac33d3Sjbeck # undef NGROUPS_MAX 9084aac33d3Sjbeck # define HASSETSID 1 /* has POSIX setsid(2) call */ 9094aac33d3Sjbeck # define USESETEUID 1 /* has usable seteuid(2) call */ 9104aac33d3Sjbeck # define HASFCHMOD 1 /* has fchmod(2) syscall */ 9114aac33d3Sjbeck # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 9124aac33d3Sjbeck # define HASSETREUID 1 /* has setreuid(2) call */ 9134aac33d3Sjbeck # define HASSTRERROR 1 /* has strerror(3) */ 9144aac33d3Sjbeck # define HASFLOCK 0 9154aac33d3Sjbeck # undef HASINITGROUPS /* has initgroups(3) call */ 9164aac33d3Sjbeck # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 9174aac33d3Sjbeck # define IP_SRCROUTE 1 /* can check IP source routing */ 9184aac33d3Sjbeck # define TZ_TYPE TZ_TMNAME /* use tmname variable */ 9194aac33d3Sjbeck # define GIDSET_T gid_t 9204aac33d3Sjbeck # define LA_TYPE LA_ZERO 9214aac33d3Sjbeck # define SFS_TYPE SFS_NONE 9224aac33d3Sjbeck # define SPT_TYPE SPT_REUSEARGV 9234aac33d3Sjbeck # define SPT_PADCHAR '\0' /* pad process title with nulls */ 9244aac33d3Sjbeck # define HASGETUSERSHELL 0 9254aac33d3Sjbeck # define _FILE_H_INCLUDED 9264aac33d3Sjbeck # endif /* defined(__QNXNTO__) */ 9277c478bd9Sstevel@tonic-gate # endif /* defined(__QNX__) */ 9287c478bd9Sstevel@tonic-gate 9297c478bd9Sstevel@tonic-gate 9307c478bd9Sstevel@tonic-gate /* 9317c478bd9Sstevel@tonic-gate ** DragonFly BSD/ FreeBSD / NetBSD / OpenBSD (all architectures, all versions) 9327c478bd9Sstevel@tonic-gate ** 9337c478bd9Sstevel@tonic-gate ** 4.3BSD clone, closer to 4.4BSD for FreeBSD 1.x and NetBSD 0.9x 9347c478bd9Sstevel@tonic-gate ** 4.4BSD-Lite based for FreeBSD 2.x and NetBSD 1.x 9357c478bd9Sstevel@tonic-gate ** 9367c478bd9Sstevel@tonic-gate ** See also BSD defines. 9377c478bd9Sstevel@tonic-gate */ 9387c478bd9Sstevel@tonic-gate 9397c478bd9Sstevel@tonic-gate # if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 9407c478bd9Sstevel@tonic-gate # include <paths.h> 9417c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) call */ 9427c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 9437c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* has usable seteuid(2) call */ 9447c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 9457c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) syscall */ 9467c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* has uname(2) syscall */ 9477c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 /* has strerror(3) */ 9487c478bd9Sstevel@tonic-gate # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 9497c478bd9Sstevel@tonic-gate # define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */ 9507c478bd9Sstevel@tonic-gate # include <sys/cdefs.h> 9517c478bd9Sstevel@tonic-gate # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 9527c478bd9Sstevel@tonic-gate # define BSD4_4_SOCKADDR /* has sa_len */ 9537c478bd9Sstevel@tonic-gate # define NETLINK 1 /* supports AF_LINK */ 9547c478bd9Sstevel@tonic-gate # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 9557c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 95649218d4fSjbeck # define QUAD_T unsigned long long 95749218d4fSjbeck # define HASSNPRINTF 1 /* has snprintf(3) (all versions?) */ 9587c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 9597c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SUBR 9607c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 961445f2479Sjbeck # if defined(__NetBSD__) && defined(__NetBSD_Version__) && \ 962445f2479Sjbeck ((__NetBSD_Version__ >= 200040000 && __NetBSD_Version__ < 200090000) || \ 963445f2479Sjbeck (__NetBSD_Version__ >= 299000900)) 9647c478bd9Sstevel@tonic-gate # undef SFS_TYPE 9657c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATVFS 9667c478bd9Sstevel@tonic-gate # else 9677c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 9687c478bd9Sstevel@tonic-gate # endif 9697c478bd9Sstevel@tonic-gate # if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) 9707c478bd9Sstevel@tonic-gate # undef SPT_TYPE 9717c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 9727c478bd9Sstevel@tonic-gate # endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */ 9737c478bd9Sstevel@tonic-gate # if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) 9747c478bd9Sstevel@tonic-gate # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 9757c478bd9Sstevel@tonic-gate # endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */ 9767c478bd9Sstevel@tonic-gate # if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104170000 9777c478bd9Sstevel@tonic-gate # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ 9787c478bd9Sstevel@tonic-gate # endif 979445f2479Sjbeck # if defined(__NetBSD__) && defined(__NetBSD_Version__) && \ 980445f2479Sjbeck ((__NetBSD_Version__ >= 200060000 && __NetBSD_Version__ < 200090000) || \ 981445f2479Sjbeck (__NetBSD_Version__ >= 299000900)) 9827c478bd9Sstevel@tonic-gate # define HASCLOSEFROM 1 /* closefrom(3) added in 2.0F */ 9837c478bd9Sstevel@tonic-gate # endif 9847c478bd9Sstevel@tonic-gate # if defined(__NetBSD__) 9857c478bd9Sstevel@tonic-gate # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */ 9867c478bd9Sstevel@tonic-gate # include <sys/param.h> 9877c478bd9Sstevel@tonic-gate # include <sys/sysctl.h> 9887c478bd9Sstevel@tonic-gate # endif 9897c478bd9Sstevel@tonic-gate # if defined(__DragonFly__) 9907c478bd9Sstevel@tonic-gate # define HASSETLOGIN 1 /* has setlogin(2) */ 9917c478bd9Sstevel@tonic-gate # define HASSRANDOMDEV 1 /* has srandomdev(3) */ 9927c478bd9Sstevel@tonic-gate # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 9937c478bd9Sstevel@tonic-gate # undef SPT_TYPE 9947c478bd9Sstevel@tonic-gate # include <libutil.h> 9957c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_BUILTIN 9967c478bd9Sstevel@tonic-gate # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ 9977c478bd9Sstevel@tonic-gate # ifndef SMRSH_CMDDIR 9987c478bd9Sstevel@tonic-gate # define SMRSH_CMDDIR "/usr/libexec/sm.bin" 9997c478bd9Sstevel@tonic-gate # endif /* ! SMRSH_CMDDIR */ 10007c478bd9Sstevel@tonic-gate # ifndef SMRSH_PATH 10017c478bd9Sstevel@tonic-gate # define SMRSH_PATH "/bin:/usr/bin" 10027c478bd9Sstevel@tonic-gate # endif /* ! SMRSH_PATH */ 10037c478bd9Sstevel@tonic-gate # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */ 10047c478bd9Sstevel@tonic-gate # include <sys/sysctl.h> 10057c478bd9Sstevel@tonic-gate # endif /* defined(__DragonFly__) */ 10067c478bd9Sstevel@tonic-gate # if defined(__FreeBSD__) 10077c478bd9Sstevel@tonic-gate # define HASSETLOGIN 1 /* has setlogin(2) */ 10087c478bd9Sstevel@tonic-gate # if __FreeBSD_version >= 227001 10097c478bd9Sstevel@tonic-gate # define HASSRANDOMDEV 1 /* has srandomdev(3) */ 10107c478bd9Sstevel@tonic-gate # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 10117c478bd9Sstevel@tonic-gate # endif /* __FreeBSD_version >= 227001 */ 10127c478bd9Sstevel@tonic-gate # undef SPT_TYPE 10137c478bd9Sstevel@tonic-gate # if __FreeBSD__ >= 2 10147c478bd9Sstevel@tonic-gate # include <osreldate.h> 10157c478bd9Sstevel@tonic-gate # if __FreeBSD_version >= 199512 /* 2.2-current when it appeared */ 10167c478bd9Sstevel@tonic-gate # include <libutil.h> 10177c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_BUILTIN 10187c478bd9Sstevel@tonic-gate # endif /* __FreeBSD_version >= 199512 */ 10197c478bd9Sstevel@tonic-gate # if __FreeBSD_version >= 222000 /* 2.2.2-release and later */ 10207c478bd9Sstevel@tonic-gate # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ 10217c478bd9Sstevel@tonic-gate # endif /* __FreeBSD_version >= 222000 */ 10227c478bd9Sstevel@tonic-gate # if __FreeBSD_version >= 330000 /* 3.3.0-release and later */ 10237c478bd9Sstevel@tonic-gate # ifndef SMRSH_CMDDIR 10247c478bd9Sstevel@tonic-gate # define SMRSH_CMDDIR "/usr/libexec/sm.bin" 10257c478bd9Sstevel@tonic-gate # endif /* ! SMRSH_CMDDIR */ 10267c478bd9Sstevel@tonic-gate # ifndef SMRSH_PATH 10277c478bd9Sstevel@tonic-gate # define SMRSH_PATH "/bin:/usr/bin" 10287c478bd9Sstevel@tonic-gate # endif /* ! SMRSH_PATH */ 10297c478bd9Sstevel@tonic-gate # endif /* __FreeBSD_version >= 330000 */ 10307c478bd9Sstevel@tonic-gate # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */ 10317c478bd9Sstevel@tonic-gate # include <sys/sysctl.h> 10327c478bd9Sstevel@tonic-gate # endif /* __FreeBSD__ >= 2 */ 10337c478bd9Sstevel@tonic-gate # ifndef SPT_TYPE 10347c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_REUSEARGV 10357c478bd9Sstevel@tonic-gate # define SPT_PADCHAR '\0' /* pad process title with nulls */ 10367c478bd9Sstevel@tonic-gate # endif /* ! SPT_TYPE */ 10377c478bd9Sstevel@tonic-gate # endif /* defined(__FreeBSD__) */ 10387c478bd9Sstevel@tonic-gate # if defined(__OpenBSD__) 10397c478bd9Sstevel@tonic-gate # undef SPT_TYPE 10407c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 10417c478bd9Sstevel@tonic-gate # define HASSETLOGIN 1 /* has setlogin(2) */ 10427c478bd9Sstevel@tonic-gate # if OpenBSD < 200305 10437c478bd9Sstevel@tonic-gate # define HASSETREUID 0 /* setreuid(2) broken in OpenBSD < 3.3 */ 10447c478bd9Sstevel@tonic-gate # endif /* OpenBSD < 200305 */ 10457c478bd9Sstevel@tonic-gate # define HASSETEGID 1 /* use setegid(2) to set saved gid */ 10467c478bd9Sstevel@tonic-gate # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 10477c478bd9Sstevel@tonic-gate # if OpenBSD >= 200006 10487c478bd9Sstevel@tonic-gate # define HASSRANDOMDEV 1 /* has srandomdev(3) */ 10497c478bd9Sstevel@tonic-gate # endif /* OpenBSD >= 200006 */ 10507c478bd9Sstevel@tonic-gate # if OpenBSD >= 200012 10517c478bd9Sstevel@tonic-gate # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ 10527c478bd9Sstevel@tonic-gate # endif /* OpenBSD >= 200012 */ 10537c478bd9Sstevel@tonic-gate # if OpenBSD >= 200405 10547c478bd9Sstevel@tonic-gate # define HASCLOSEFROM 1 /* closefrom(3) added in 3.5 */ 10557c478bd9Sstevel@tonic-gate # endif /* OpenBSD >= 200405 */ 105649218d4fSjbeck # if OpenBSD >= 200505 105749218d4fSjbeck # undef NETISO /* iso.h removed in 3.7 */ 105849218d4fSjbeck # endif /* OpenBSD >= 200505 */ 10597c478bd9Sstevel@tonic-gate # endif /* defined(__OpenBSD__) */ 10607c478bd9Sstevel@tonic-gate # endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ 10617c478bd9Sstevel@tonic-gate 10627c478bd9Sstevel@tonic-gate 10637c478bd9Sstevel@tonic-gate /* 10647c478bd9Sstevel@tonic-gate ** Mach386 10657c478bd9Sstevel@tonic-gate ** 10667c478bd9Sstevel@tonic-gate ** For mt Xinu's Mach386 system. 10677c478bd9Sstevel@tonic-gate */ 10687c478bd9Sstevel@tonic-gate 10697c478bd9Sstevel@tonic-gate # if defined(MACH) && defined(i386) && !defined(__GNU__) 10707c478bd9Sstevel@tonic-gate # define MACH386 1 10717c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) call */ 10727c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 10737c478bd9Sstevel@tonic-gate # ifndef HASFLOCK 10747c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* has flock(2) call */ 10757c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */ 10767c478bd9Sstevel@tonic-gate # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 10777c478bd9Sstevel@tonic-gate # define NEEDSTRTOL 1 /* need the strtol() function */ 10787c478bd9Sstevel@tonic-gate # define setpgid setpgrp 10797c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 10807c478bd9Sstevel@tonic-gate # define LA_TYPE LA_FLOAT 10817c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 10827c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 10837c478bd9Sstevel@tonic-gate # undef HASSETVBUF /* don't actually have setvbuf(3) */ 10847c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 10857c478bd9Sstevel@tonic-gate # undef WIFEXITED 10867c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 10877c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 10887c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 10897c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 10907c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/sendmail.pid" 10917c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 10927c478bd9Sstevel@tonic-gate # endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */ 10937c478bd9Sstevel@tonic-gate 10947c478bd9Sstevel@tonic-gate 10957c478bd9Sstevel@tonic-gate 10967c478bd9Sstevel@tonic-gate /* 10977c478bd9Sstevel@tonic-gate ** GNU OS (hurd) 10987c478bd9Sstevel@tonic-gate ** Largely BSD & posix compatible. 10997c478bd9Sstevel@tonic-gate ** Port contributed by Miles Bader <miles@gnu.ai.mit.edu>. 11007c478bd9Sstevel@tonic-gate ** Updated by Mark Kettenis <kettenis@wins.uva.nl>. 11017c478bd9Sstevel@tonic-gate */ 11027c478bd9Sstevel@tonic-gate 11037c478bd9Sstevel@tonic-gate # if defined(__GNU__) && !defined(NeXT) 11047c478bd9Sstevel@tonic-gate # include <paths.h> 11057c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) call */ 11067c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) call */ 11077c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* has uname(2) call */ 11087c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) call */ 11097c478bd9Sstevel@tonic-gate # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 11107c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 /* has strerror(3) */ 11117c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 11127c478bd9Sstevel@tonic-gate # define SOCKADDR_LEN_T socklen_t 11137c478bd9Sstevel@tonic-gate # define SOCKOPT_LEN_T socklen_t 11147c478bd9Sstevel@tonic-gate # if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 11157c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SUBR 11167c478bd9Sstevel@tonic-gate # else /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */ 11177c478bd9Sstevel@tonic-gate # define LA_TYPE LA_MACH 11187c478bd9Sstevel@tonic-gate /* GNU uses mach[34], which renames some rpcs from mach2.x. */ 11197c478bd9Sstevel@tonic-gate # define host_self mach_host_self 11207c478bd9Sstevel@tonic-gate # endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */ 11217c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATFS 11227c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_CHANGEARGV 11237c478bd9Sstevel@tonic-gate # define ERRLIST_PREDEFINED 1 /* don't declare sys_errlist */ 11247c478bd9Sstevel@tonic-gate # define BSD4_4_SOCKADDR 1 /* has sa_len */ 11257c478bd9Sstevel@tonic-gate # define SIOCGIFCONF_IS_BROKEN 1 /* SIOCGFCONF doesn't work */ 11267c478bd9Sstevel@tonic-gate # define HAS_IN_H 1 /* GNU has netinet/in.h. */ 11277c478bd9Sstevel@tonic-gate /* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */ 11287c478bd9Sstevel@tonic-gate # define MAXPATHLEN 2048 11297c478bd9Sstevel@tonic-gate # endif /* defined(__GNU__) && !defined(NeXT) */ 11307c478bd9Sstevel@tonic-gate 11317c478bd9Sstevel@tonic-gate /* 11327c478bd9Sstevel@tonic-gate ** 4.3 BSD -- this is for very old systems 11337c478bd9Sstevel@tonic-gate ** 11347c478bd9Sstevel@tonic-gate ** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1. 11357c478bd9Sstevel@tonic-gate ** 11367c478bd9Sstevel@tonic-gate ** You'll also have to install a new resolver library. 11377c478bd9Sstevel@tonic-gate ** I don't guarantee that support for this environment is complete. 11387c478bd9Sstevel@tonic-gate */ 11397c478bd9Sstevel@tonic-gate 11407c478bd9Sstevel@tonic-gate # if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) 11417c478bd9Sstevel@tonic-gate # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 11427c478bd9Sstevel@tonic-gate # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 11437c478bd9Sstevel@tonic-gate # define ARBPTR_T char * 11447c478bd9Sstevel@tonic-gate # define setpgid setpgrp 11457c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 11467c478bd9Sstevel@tonic-gate # define LA_TYPE LA_FLOAT 11477c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 11487c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 11497c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 11507c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 11517c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 11527c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 11537c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 11547c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 11557c478bd9Sstevel@tonic-gate # undef WIFEXITED 11567c478bd9Sstevel@tonic-gate typedef short pid_t; 11577c478bd9Sstevel@tonic-gate # endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */ 11587c478bd9Sstevel@tonic-gate 11597c478bd9Sstevel@tonic-gate 11607c478bd9Sstevel@tonic-gate /* 11617c478bd9Sstevel@tonic-gate ** SCO Unix 11627c478bd9Sstevel@tonic-gate ** 11637c478bd9Sstevel@tonic-gate ** This includes three parts: 11647c478bd9Sstevel@tonic-gate ** 11657c478bd9Sstevel@tonic-gate ** The first is for SCO OpenServer 5. 11667c478bd9Sstevel@tonic-gate ** (Contributed by Keith Reynolds <keithr@sco.COM>). 11677c478bd9Sstevel@tonic-gate ** 11687c478bd9Sstevel@tonic-gate ** SCO OpenServer 5 has a compiler version number macro, 11697c478bd9Sstevel@tonic-gate ** which we can use to figure out what version we're on. 11707c478bd9Sstevel@tonic-gate ** This may have to change in future releases. 11717c478bd9Sstevel@tonic-gate ** 11727c478bd9Sstevel@tonic-gate ** The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0. 11737c478bd9Sstevel@tonic-gate ** (Contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). 11747c478bd9Sstevel@tonic-gate ** 11757c478bd9Sstevel@tonic-gate ** The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier. 11767c478bd9Sstevel@tonic-gate */ 11777c478bd9Sstevel@tonic-gate 11787c478bd9Sstevel@tonic-gate /* SCO OpenServer 5 */ 11797c478bd9Sstevel@tonic-gate # if _SCO_DS >= 1 11807c478bd9Sstevel@tonic-gate # include <paths.h> 11817c478bd9Sstevel@tonic-gate # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM returns bogus value */ 11827c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) call */ 11837c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) call */ 11847c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 11857c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* has seteuid(2) call */ 11867c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 11877c478bd9Sstevel@tonic-gate # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 11887c478bd9Sstevel@tonic-gate # define RLIMIT_NEEDS_SYS_TIME_H 1 11897c478bd9Sstevel@tonic-gate # define LDA_USE_LOCKF 1 11907c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 11917c478bd9Sstevel@tonic-gate # define LA_TYPE LA_DEVSHORT 11927c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 11937c478bd9Sstevel@tonic-gate # define _PATH_AVENRUN "/dev/table/avenrun" 11947c478bd9Sstevel@tonic-gate # ifndef _SCO_unix_4_2 11957c478bd9Sstevel@tonic-gate # define _SCO_unix_4_2 11967c478bd9Sstevel@tonic-gate # else /* ! _SCO_unix_4_2 */ 11977c478bd9Sstevel@tonic-gate # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */ 11987c478bd9Sstevel@tonic-gate # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */ 11997c478bd9Sstevel@tonic-gate # endif /* ! _SCO_unix_4_2 */ 12007c478bd9Sstevel@tonic-gate # endif /* _SCO_DS >= 1 */ 12017c478bd9Sstevel@tonic-gate 12027c478bd9Sstevel@tonic-gate /* SCO UNIX 3.2v4.2/Open Desktop 3.0 */ 12037c478bd9Sstevel@tonic-gate # ifdef _SCO_unix_4_2 12047c478bd9Sstevel@tonic-gate # define _SCO_unix_ 12057c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) call */ 12067c478bd9Sstevel@tonic-gate # endif /* _SCO_unix_4_2 */ 12077c478bd9Sstevel@tonic-gate 12087c478bd9Sstevel@tonic-gate /* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */ 12097c478bd9Sstevel@tonic-gate # ifdef _SCO_unix_ 12107c478bd9Sstevel@tonic-gate # include <sys/stream.h> /* needed for IP_SRCROUTE */ 12117c478bd9Sstevel@tonic-gate # define SYSTEM5 1 /* include all the System V defines */ 12127c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 12137c478bd9Sstevel@tonic-gate # define NOFTRUNCATE 0 /* has (simulated) ftruncate call */ 12147c478bd9Sstevel@tonic-gate # ifndef USE_SIGLONGJMP 12157c478bd9Sstevel@tonic-gate # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ 12167c478bd9Sstevel@tonic-gate # endif /* ! USE_SIGLONGJMP */ 12177c478bd9Sstevel@tonic-gate # define MAXPATHLEN PATHSIZE 12187c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_4ARGS /* use <sys/statfs.h> 4-arg impl */ 12197c478bd9Sstevel@tonic-gate # define SFS_BAVAIL f_bfree /* alternate field name */ 12207c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_SCO /* write kernel u. area */ 12217c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */ 12227c478bd9Sstevel@tonic-gate # define UID_T uid_t 12237c478bd9Sstevel@tonic-gate # define GID_T gid_t 12247c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 12257c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/unix" 12267c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 12277c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 12287c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 12297c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 12307c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/sendmail.pid" 12317c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 12327c478bd9Sstevel@tonic-gate 12337c478bd9Sstevel@tonic-gate /* stuff fixed in later releases */ 12347c478bd9Sstevel@tonic-gate # ifndef _SCO_unix_4_2 12357c478bd9Sstevel@tonic-gate # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 12367c478bd9Sstevel@tonic-gate # endif /* ! _SCO_unix_4_2 */ 12377c478bd9Sstevel@tonic-gate 12387c478bd9Sstevel@tonic-gate # ifndef _SCO_DS 12397c478bd9Sstevel@tonic-gate # define ftruncate chsize /* use chsize(2) to emulate ftruncate */ 12407c478bd9Sstevel@tonic-gate # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 12417c478bd9Sstevel@tonic-gate # define NETUNIX 0 /* no unix domain socket support */ 12427c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SHORT 12437c478bd9Sstevel@tonic-gate # endif /* ! _SCO_DS */ 12447c478bd9Sstevel@tonic-gate 12457c478bd9Sstevel@tonic-gate # endif /* _SCO_unix_ */ 12467c478bd9Sstevel@tonic-gate 12477c478bd9Sstevel@tonic-gate /* 12487c478bd9Sstevel@tonic-gate ** ISC (SunSoft) Unix. 12497c478bd9Sstevel@tonic-gate ** 12507c478bd9Sstevel@tonic-gate ** Contributed by J.J. Bailey <jjb@jagware.bcc.com> 12517c478bd9Sstevel@tonic-gate */ 12527c478bd9Sstevel@tonic-gate 12537c478bd9Sstevel@tonic-gate # ifdef ISC_UNIX 12547c478bd9Sstevel@tonic-gate # include <net/errno.h> 12557c478bd9Sstevel@tonic-gate # include <sys/stream.h> /* needed for IP_SRCROUTE */ 12567c478bd9Sstevel@tonic-gate # include <sys/bsdtypes.h> 12577c478bd9Sstevel@tonic-gate # define SYSTEM5 1 /* include all the System V defines */ 12587c478bd9Sstevel@tonic-gate # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 12597c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 12607c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) call */ 12617c478bd9Sstevel@tonic-gate # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 12627c478bd9Sstevel@tonic-gate # define NETUNIX 0 /* no unix domain socket support */ 12637c478bd9Sstevel@tonic-gate # define MAXPATHLEN 1024 12647c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SHORT 12657c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 12667c478bd9Sstevel@tonic-gate # define SFS_BAVAIL f_bfree /* alternate field name */ 12677c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/unix" 12687c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 12697c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 12707c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 12717c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 12727c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/sendmail.pid" 12737c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 12747c478bd9Sstevel@tonic-gate # endif /* ISC_UNIX */ 12757c478bd9Sstevel@tonic-gate 12767c478bd9Sstevel@tonic-gate 12777c478bd9Sstevel@tonic-gate /* 12787c478bd9Sstevel@tonic-gate ** Altos System V (5.3.1) 12797c478bd9Sstevel@tonic-gate ** Contributed by Tim Rice <tim@trr.metro.net>. 12807c478bd9Sstevel@tonic-gate */ 12817c478bd9Sstevel@tonic-gate 12827c478bd9Sstevel@tonic-gate # ifdef ALTOS_SYSTEM_V 12837c478bd9Sstevel@tonic-gate # include <sys/stream.h> 12847c478bd9Sstevel@tonic-gate # include <limits.h> 12857c478bd9Sstevel@tonic-gate # define SYSTEM5 1 /* include all the System V defines */ 12867c478bd9Sstevel@tonic-gate # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 12877c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 12887c478bd9Sstevel@tonic-gate # define WAITUNION 1 /* use "union wait" as wait argument type */ 12897c478bd9Sstevel@tonic-gate # define NEEDFSYNC 1 /* no fsync(2) in system library */ 12907c478bd9Sstevel@tonic-gate # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 12917c478bd9Sstevel@tonic-gate # define NOFTRUNCATE 1 /* do not have ftruncate(2) */ 12927c478bd9Sstevel@tonic-gate # define MAXPATHLEN PATH_MAX 12937c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SHORT 12947c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 12957c478bd9Sstevel@tonic-gate # define SFS_BAVAIL f_bfree /* alternate field name */ 12967c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 12977c478bd9Sstevel@tonic-gate # define NETUNIX 0 /* no unix domain socket support */ 12987c478bd9Sstevel@tonic-gate # undef WIFEXITED 12997c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 13007c478bd9Sstevel@tonic-gate # define strtoul strtol /* gcc library bogosity */ 13017c478bd9Sstevel@tonic-gate 13027c478bd9Sstevel@tonic-gate typedef unsigned short uid_t; 13037c478bd9Sstevel@tonic-gate typedef unsigned short gid_t; 13047c478bd9Sstevel@tonic-gate typedef short pid_t; 13057c478bd9Sstevel@tonic-gate typedef unsigned long mode_t; 13067c478bd9Sstevel@tonic-gate 13077c478bd9Sstevel@tonic-gate /* some stuff that should have been in the include files */ 13087c478bd9Sstevel@tonic-gate extern char *malloc(); 13097c478bd9Sstevel@tonic-gate extern struct passwd *getpwent(); 13107c478bd9Sstevel@tonic-gate extern struct passwd *getpwnam(); 13117c478bd9Sstevel@tonic-gate extern struct passwd *getpwuid(); 13127c478bd9Sstevel@tonic-gate extern char *getenv(); 13137c478bd9Sstevel@tonic-gate extern struct group *getgrgid(); 13147c478bd9Sstevel@tonic-gate extern struct group *getgrnam(); 13157c478bd9Sstevel@tonic-gate 13167c478bd9Sstevel@tonic-gate # endif /* ALTOS_SYSTEM_V */ 13177c478bd9Sstevel@tonic-gate 13187c478bd9Sstevel@tonic-gate 13197c478bd9Sstevel@tonic-gate /* 13207c478bd9Sstevel@tonic-gate ** ConvexOS 11.0 and later 13217c478bd9Sstevel@tonic-gate ** 13227c478bd9Sstevel@tonic-gate ** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this 13237c478bd9Sstevel@tonic-gate ** works on 9.1 as well. 13247c478bd9Sstevel@tonic-gate ** 13257c478bd9Sstevel@tonic-gate ** ConvexOS 11.5 and later, should work on 11.0 as defined. 13267c478bd9Sstevel@tonic-gate ** For pre-ConvexOOS 11.0, define SM_CONF_GETOPT=0, undef IDENTPROTO 13277c478bd9Sstevel@tonic-gate ** 13287c478bd9Sstevel@tonic-gate ** Eric Schnoebelen (eric@cirr.com) For CONVEX Computer Corp. 13297c478bd9Sstevel@tonic-gate ** (now the CONVEX Technologies Center of Hewlett Packard) 13307c478bd9Sstevel@tonic-gate */ 13317c478bd9Sstevel@tonic-gate 13327c478bd9Sstevel@tonic-gate # ifdef _CONVEX_SOURCE 13337c478bd9Sstevel@tonic-gate # define HASGETDTABLESIZE 1 /* has getdtablesize(2) */ 13347c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) */ 13357c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 13367c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 13377c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) */ 13387c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* has flock(2) */ 13397c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 1 /* has setrlimit(2) */ 13407c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) */ 13417c478bd9Sstevel@tonic-gate # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_error=0 */ 13427c478bd9Sstevel@tonic-gate # define NEEDPUTENV 1 /* needs putenv (written in terms of setenv) */ 13437c478bd9Sstevel@tonic-gate # define SM_CONF_GETOPT 1 /* need a replacement for getopt(3) */ 13447c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 13457c478bd9Sstevel@tonic-gate # define LA_TYPE LA_FLOAT 13467c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 13477c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 13487c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 13497c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 13507c478bd9Sstevel@tonic-gate # ifndef S_IREAD 13517c478bd9Sstevel@tonic-gate # define S_IREAD _S_IREAD 13527c478bd9Sstevel@tonic-gate # define S_IWRITE _S_IWRITE 13537c478bd9Sstevel@tonic-gate # define S_IEXEC _S_IEXEC 13547c478bd9Sstevel@tonic-gate # define S_IFMT _S_IFMT 13557c478bd9Sstevel@tonic-gate # define S_IFCHR _S_IFCHR 13567c478bd9Sstevel@tonic-gate # define S_IFBLK _S_IFBLK 13577c478bd9Sstevel@tonic-gate # endif /* ! S_IREAD */ 13587c478bd9Sstevel@tonic-gate # ifndef TZ_TYPE 13597c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TIMEZONE 13607c478bd9Sstevel@tonic-gate # endif /* ! TZ_TYPE */ 13617c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 13627c478bd9Sstevel@tonic-gate # define IDENTPROTO 1 13637c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 13647c478bd9Sstevel@tonic-gate # ifndef SHARE_V1 13657c478bd9Sstevel@tonic-gate # define SHARE_V1 1 /* version 1 of the fair share scheduler */ 13667c478bd9Sstevel@tonic-gate # endif /* ! SHARE_V1 */ 13677c478bd9Sstevel@tonic-gate # if !defined(__GNUC__ ) 13687c478bd9Sstevel@tonic-gate # define UID_T int /* GNUC gets it right, ConvexC botches */ 13697c478bd9Sstevel@tonic-gate # define GID_T int /* GNUC gets it right, ConvexC botches */ 13707c478bd9Sstevel@tonic-gate # endif /* !defined(__GNUC__ ) */ 13717c478bd9Sstevel@tonic-gate # if SECUREWARE 13727c478bd9Sstevel@tonic-gate # define FORK fork /* SecureWare wants the real fork! */ 13737c478bd9Sstevel@tonic-gate # else /* SECUREWARE */ 13747c478bd9Sstevel@tonic-gate # define FORK vfork /* the rest of the OS versions don't care */ 13757c478bd9Sstevel@tonic-gate # endif /* SECUREWARE */ 13767c478bd9Sstevel@tonic-gate # endif /* _CONVEX_SOURCE */ 13777c478bd9Sstevel@tonic-gate 13787c478bd9Sstevel@tonic-gate 13797c478bd9Sstevel@tonic-gate /* 13807c478bd9Sstevel@tonic-gate ** RISC/os 4.52 13817c478bd9Sstevel@tonic-gate ** 13827c478bd9Sstevel@tonic-gate ** Gives a ton of warning messages, but otherwise compiles. 13837c478bd9Sstevel@tonic-gate */ 13847c478bd9Sstevel@tonic-gate 13857c478bd9Sstevel@tonic-gate # ifdef RISCOS 13867c478bd9Sstevel@tonic-gate 13877c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) call */ 13887c478bd9Sstevel@tonic-gate # ifndef HASFLOCK 13897c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* has flock(2) call */ 13907c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */ 13917c478bd9Sstevel@tonic-gate # define WAITUNION 1 /* use "union wait" as wait argument type */ 13927c478bd9Sstevel@tonic-gate # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 13937c478bd9Sstevel@tonic-gate # define NEEDPUTENV 1 /* need putenv(3) call */ 13947c478bd9Sstevel@tonic-gate # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 13957c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 13967c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT 13977c478bd9Sstevel@tonic-gate # define LA_AVENRUN "avenrun" 13987c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/unix" 13997c478bd9Sstevel@tonic-gate # undef WIFEXITED 14007c478bd9Sstevel@tonic-gate 14017c478bd9Sstevel@tonic-gate # define setpgid setpgrp 14027c478bd9Sstevel@tonic-gate 14037c478bd9Sstevel@tonic-gate typedef int pid_t; 14047c478bd9Sstevel@tonic-gate # define SIGFUNC_DEFINED 14057c478bd9Sstevel@tonic-gate # define SIGFUNC_RETURN (0) 14067c478bd9Sstevel@tonic-gate # define SIGFUNC_DECL int 14077c478bd9Sstevel@tonic-gate typedef int (*sigfunc_t)(); 14087c478bd9Sstevel@tonic-gate extern char *getenv(); 14097c478bd9Sstevel@tonic-gate extern void *malloc(); 14107c478bd9Sstevel@tonic-gate 14117c478bd9Sstevel@tonic-gate /* added for RISC/os 4.01...which is dumber than 4.50 */ 14127c478bd9Sstevel@tonic-gate # ifdef RISCOS_4_0 14137c478bd9Sstevel@tonic-gate # ifndef ARBPTR_T 14147c478bd9Sstevel@tonic-gate # define ARBPTR_T char * 14157c478bd9Sstevel@tonic-gate # endif /* ! ARBPTR_T */ 14167c478bd9Sstevel@tonic-gate # undef HASFLOCK 14177c478bd9Sstevel@tonic-gate # define HASFLOCK 0 14187c478bd9Sstevel@tonic-gate # endif /* RISCOS_4_0 */ 14197c478bd9Sstevel@tonic-gate 14207c478bd9Sstevel@tonic-gate # include <sys/time.h> 14217c478bd9Sstevel@tonic-gate 14227c478bd9Sstevel@tonic-gate # endif /* RISCOS */ 14237c478bd9Sstevel@tonic-gate 14247c478bd9Sstevel@tonic-gate 14257c478bd9Sstevel@tonic-gate /* 14267c478bd9Sstevel@tonic-gate ** Linux 0.99pl10 and above... 14277c478bd9Sstevel@tonic-gate ** 14287c478bd9Sstevel@tonic-gate ** Thanks to, in reverse order of contact: 14297c478bd9Sstevel@tonic-gate ** 14307c478bd9Sstevel@tonic-gate ** John Kennedy <warlock@csuchico.edu> 14317c478bd9Sstevel@tonic-gate ** Andrew Pam <avatar@aus.xanadu.com> 14327c478bd9Sstevel@tonic-gate ** Florian La Roche <rzsfl@rz.uni-sb.de> 14337c478bd9Sstevel@tonic-gate ** Karl London <karl@borg.demon.co.uk> 14347c478bd9Sstevel@tonic-gate ** 14357c478bd9Sstevel@tonic-gate ** NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style 14367c478bd9Sstevel@tonic-gate ** file locking is no longer allowed. In particular, make sure 14377c478bd9Sstevel@tonic-gate ** your DBM library and sendmail are both using either flock(2) 14387c478bd9Sstevel@tonic-gate ** *or* fcntl(2) file locking, but not both. 14397c478bd9Sstevel@tonic-gate */ 14407c478bd9Sstevel@tonic-gate 14417c478bd9Sstevel@tonic-gate # ifdef __linux__ 14427c478bd9Sstevel@tonic-gate # include <linux/version.h> 14437c478bd9Sstevel@tonic-gate # if !defined(KERNEL_VERSION) /* not defined in 2.0.x kernel series */ 14447c478bd9Sstevel@tonic-gate # define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 14457c478bd9Sstevel@tonic-gate # endif /* !defined(KERNEL_VERSION) */ 14467c478bd9Sstevel@tonic-gate # define BSD 1 /* include BSD defines */ 14477c478bd9Sstevel@tonic-gate # define HASSETREGID 1 /* use setregid(2) to set saved gid */ 14487c478bd9Sstevel@tonic-gate # ifndef REQUIRES_DIR_FSYNC 14497c478bd9Sstevel@tonic-gate # define REQUIRES_DIR_FSYNC 1 /* requires fsync() on directory */ 14507c478bd9Sstevel@tonic-gate # endif /* REQUIRES_DIR_FSYNC */ 14517c478bd9Sstevel@tonic-gate # ifndef USESETEUID 14527c478bd9Sstevel@tonic-gate # define USESETEUID 0 /* has it due to POSIX, but doesn't work */ 14537c478bd9Sstevel@tonic-gate # endif /* USESETEUID */ 14547c478bd9Sstevel@tonic-gate # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 14557c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 14567c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) call */ 14577c478bd9Sstevel@tonic-gate # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 14587c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t /* from <linux/types.h> */ 14597c478bd9Sstevel@tonic-gate # ifndef HASGETUSERSHELL 14607c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */ 14617c478bd9Sstevel@tonic-gate # endif /* HASGETUSERSHELL */ 14627c478bd9Sstevel@tonic-gate # ifndef IP_SRCROUTE 14637c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */ 14647c478bd9Sstevel@tonic-gate # endif /* ! IP_SRCROUTE */ 14657c478bd9Sstevel@tonic-gate # ifndef HAS_IN_H 14667c478bd9Sstevel@tonic-gate # define HAS_IN_H 1 /* use netinet/in.h */ 14677c478bd9Sstevel@tonic-gate # endif /* ! HAS_IN_H */ 14687c478bd9Sstevel@tonic-gate # ifndef USE_SIGLONGJMP 14697c478bd9Sstevel@tonic-gate # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ 14707c478bd9Sstevel@tonic-gate # endif /* ! USE_SIGLONGJMP */ 14717c478bd9Sstevel@tonic-gate # ifndef HASFLOCK 14727c478bd9Sstevel@tonic-gate # if LINUX_VERSION_CODE < 66399 14737c478bd9Sstevel@tonic-gate # define HASFLOCK 0 /* flock(2) is broken after 0.99.13 */ 14747c478bd9Sstevel@tonic-gate # else /* LINUX_VERSION_CODE < 66399 */ 14757c478bd9Sstevel@tonic-gate # if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) 14767c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* flock(2) fixed after 1.3.95 */ 14777c478bd9Sstevel@tonic-gate # else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */ 14787c478bd9Sstevel@tonic-gate # define HASFLOCK 0 /* flock(2) is broken (again) after 2.4.0 */ 14797c478bd9Sstevel@tonic-gate # endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */ 14807c478bd9Sstevel@tonic-gate # endif /* LINUX_VERSION_CODE < 66399 */ 14817c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */ 14827c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 14837c478bd9Sstevel@tonic-gate # define LA_TYPE LA_PROCSTR 14847c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 14857c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */ 14867c478bd9Sstevel@tonic-gate # define SPT_PADCHAR '\0' /* pad process title with nulls */ 14877c478bd9Sstevel@tonic-gate # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) 14887c478bd9Sstevel@tonic-gate # ifndef HASURANDOMDEV 14897c478bd9Sstevel@tonic-gate # define HASURANDOMDEV 1 /* 2.0 (at least) has linux/drivers/char/random.c */ 14907c478bd9Sstevel@tonic-gate # endif /* ! HASURANDOMDEV */ 14917c478bd9Sstevel@tonic-gate # endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) */ 14927c478bd9Sstevel@tonic-gate # if defined(__GLIBC__) && defined(__GLIBC_MINOR__) 14937c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 /* has strerror(3) */ 14947c478bd9Sstevel@tonic-gate # endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */ 14957c478bd9Sstevel@tonic-gate # ifndef TZ_TYPE 14967c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_NONE /* no standard for Linux */ 14977c478bd9Sstevel@tonic-gate # endif /* ! TZ_TYPE */ 14987c478bd9Sstevel@tonic-gate # if (__GLIBC__ >= 2) 14997c478bd9Sstevel@tonic-gate # include <paths.h> 15007c478bd9Sstevel@tonic-gate # endif /* (__GLIBC__ >= 2) */ 15017c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 15027c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 15037c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 15047c478bd9Sstevel@tonic-gate # include <sys/sysmacros.h> 15057c478bd9Sstevel@tonic-gate # undef atol /* wounded in <stdlib.h> */ 15067c478bd9Sstevel@tonic-gate # if NETINET6 15077c478bd9Sstevel@tonic-gate /* 15087c478bd9Sstevel@tonic-gate ** Linux doesn't have a good way to tell userland what interfaces are 15097c478bd9Sstevel@tonic-gate ** IPv6-capable. Therefore, the BIND resolver can not determine if there 15107c478bd9Sstevel@tonic-gate ** are IPv6 interfaces to honor AI_ADDRCONFIG. Unfortunately, it assumes 15117c478bd9Sstevel@tonic-gate ** that none are present. (Excuse the macro name ADDRCONFIG_IS_BROKEN.) 15127c478bd9Sstevel@tonic-gate */ 15137c478bd9Sstevel@tonic-gate # define ADDRCONFIG_IS_BROKEN 1 15147c478bd9Sstevel@tonic-gate 15157c478bd9Sstevel@tonic-gate /* 15167c478bd9Sstevel@tonic-gate ** Indirectly included from glibc's <feature.h>. IPv6 support is native 15177c478bd9Sstevel@tonic-gate ** in 2.1 and later, but the APIs appear before the functions. 15187c478bd9Sstevel@tonic-gate */ 15197c478bd9Sstevel@tonic-gate # if defined(__GLIBC__) && defined(__GLIBC_MINOR__) 15207c478bd9Sstevel@tonic-gate # define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__) 15217c478bd9Sstevel@tonic-gate # if (GLIBC_VERSION >= 0x201) 15227c478bd9Sstevel@tonic-gate # undef IPPROTO_ICMPV6 /* linux #defines, glibc enums */ 15237c478bd9Sstevel@tonic-gate # else /* (GLIBC_VERSION >= 0x201) */ 15247c478bd9Sstevel@tonic-gate # include <linux/in6.h> /* IPv6 support */ 15257c478bd9Sstevel@tonic-gate # endif /* (GLIBC_VERSION >= 0x201) */ 15267c478bd9Sstevel@tonic-gate # if (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) 15277c478bd9Sstevel@tonic-gate /* Have APIs in <netdb.h>, but no support in glibc */ 15287c478bd9Sstevel@tonic-gate # define NEEDSGETIPNODE 1 15297c478bd9Sstevel@tonic-gate # endif /* (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) */ 15307c478bd9Sstevel@tonic-gate # undef GLIBC_VERSION 15317c478bd9Sstevel@tonic-gate # endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */ 15327c478bd9Sstevel@tonic-gate # endif /* NETINET6 */ 15337c478bd9Sstevel@tonic-gate # ifndef HASFCHOWN 15347c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* fchown(2) */ 15357c478bd9Sstevel@tonic-gate # endif /* ! HASFCHOWN */ 15367c478bd9Sstevel@tonic-gate # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) 15377c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* fchmod(2) */ 15387c478bd9Sstevel@tonic-gate # endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) */ 15397c478bd9Sstevel@tonic-gate # endif /* __linux__ */ 15407c478bd9Sstevel@tonic-gate 15417c478bd9Sstevel@tonic-gate 15427c478bd9Sstevel@tonic-gate /* 15437c478bd9Sstevel@tonic-gate ** DELL SVR4 Issue 2.2, and others 15447c478bd9Sstevel@tonic-gate ** From Kimmo Suominen <kim@grendel.lut.fi> 15457c478bd9Sstevel@tonic-gate ** 15467c478bd9Sstevel@tonic-gate ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 15477c478bd9Sstevel@tonic-gate ** defined, and the definitions conflict. 15487c478bd9Sstevel@tonic-gate ** 15497c478bd9Sstevel@tonic-gate ** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 15507c478bd9Sstevel@tonic-gate ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 15517c478bd9Sstevel@tonic-gate ** (SVR4.0/386 version 3.0). 15527c478bd9Sstevel@tonic-gate */ 15537c478bd9Sstevel@tonic-gate 15547c478bd9Sstevel@tonic-gate # ifdef DELL_SVR4 15557c478bd9Sstevel@tonic-gate /* no changes necessary */ 15567c478bd9Sstevel@tonic-gate /* see general __svr4__ defines below */ 15577c478bd9Sstevel@tonic-gate # endif /* DELL_SVR4 */ 15587c478bd9Sstevel@tonic-gate 15597c478bd9Sstevel@tonic-gate 15607c478bd9Sstevel@tonic-gate /* 15617c478bd9Sstevel@tonic-gate ** Apple A/UX 3.0 15627c478bd9Sstevel@tonic-gate */ 15637c478bd9Sstevel@tonic-gate 15647c478bd9Sstevel@tonic-gate # ifdef _AUX_SOURCE 15657c478bd9Sstevel@tonic-gate # include <sys/sysmacros.h> 15667c478bd9Sstevel@tonic-gate # define BSD /* has BSD routines */ 15677c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 0 /* ... but not setrlimit(2) */ 15687c478bd9Sstevel@tonic-gate # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 15697c478bd9Sstevel@tonic-gate # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */ 15707c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 15717c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 15727c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 15737c478bd9Sstevel@tonic-gate # define HASSETVBUF 1 /* has setvbuf(3) in libc */ 15747c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 /* has strerror(3) */ 15757c478bd9Sstevel@tonic-gate # define SIGFUNC_DEFINED /* sigfunc_t already defined */ 15767c478bd9Sstevel@tonic-gate # define SIGFUNC_RETURN /* POSIX-mode */ 15777c478bd9Sstevel@tonic-gate # define SIGFUNC_DECL void /* POSIX-mode */ 15787c478bd9Sstevel@tonic-gate # define ERRLIST_PREDEFINED 1 15797c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 15807c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 15817c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 15827c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 15837c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT 15847c478bd9Sstevel@tonic-gate # define FSHIFT 16 15857c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 15867c478bd9Sstevel@tonic-gate # define LA_AVENRUN "avenrun" 15877c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 15887c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TZNAME 15897c478bd9Sstevel@tonic-gate # ifndef _PATH_UNIX 15907c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/unix" /* should be in <paths.h> */ 15917c478bd9Sstevel@tonic-gate # endif /* ! _PATH_UNIX */ 15927c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 15937c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 15947c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 15957c478bd9Sstevel@tonic-gate # undef WIFEXITED 15967c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 15977c478bd9Sstevel@tonic-gate # endif /* _AUX_SOURCE */ 15987c478bd9Sstevel@tonic-gate 15997c478bd9Sstevel@tonic-gate 16007c478bd9Sstevel@tonic-gate /* 16017c478bd9Sstevel@tonic-gate ** Encore UMAX V 16027c478bd9Sstevel@tonic-gate ** 16037c478bd9Sstevel@tonic-gate ** Not extensively tested. 16047c478bd9Sstevel@tonic-gate */ 16057c478bd9Sstevel@tonic-gate 16067c478bd9Sstevel@tonic-gate # ifdef UMAXV 16077c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 16087c478bd9Sstevel@tonic-gate # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 16097c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 16107c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 16117c478bd9Sstevel@tonic-gate # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 16127c478bd9Sstevel@tonic-gate # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 16137c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 16147c478bd9Sstevel@tonic-gate # define MAXPATHLEN PATH_MAX 16157c478bd9Sstevel@tonic-gate extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 16167c478bd9Sstevel@tonic-gate extern struct group *getgrent(), *getgrnam(), *getgrgid(); 16177c478bd9Sstevel@tonic-gate # undef WIFEXITED 16187c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 16197c478bd9Sstevel@tonic-gate # endif /* UMAXV */ 16207c478bd9Sstevel@tonic-gate 16217c478bd9Sstevel@tonic-gate 16227c478bd9Sstevel@tonic-gate /* 16237c478bd9Sstevel@tonic-gate ** Stardent Titan 3000 running TitanOS 4.2. 16247c478bd9Sstevel@tonic-gate ** 16257c478bd9Sstevel@tonic-gate ** Must be compiled in "cc -43" mode. 16267c478bd9Sstevel@tonic-gate ** 16277c478bd9Sstevel@tonic-gate ** From Kate Hedstrom <kate@ahab.rutgers.edu>. 16287c478bd9Sstevel@tonic-gate ** 16297c478bd9Sstevel@tonic-gate ** Note the tweaking below after the BSD defines are set. 16307c478bd9Sstevel@tonic-gate */ 16317c478bd9Sstevel@tonic-gate 16327c478bd9Sstevel@tonic-gate # ifdef titan 16337c478bd9Sstevel@tonic-gate # define setpgid setpgrp 16347c478bd9Sstevel@tonic-gate typedef int pid_t; 16357c478bd9Sstevel@tonic-gate # undef WIFEXITED 16367c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 16377c478bd9Sstevel@tonic-gate # endif /* titan */ 16387c478bd9Sstevel@tonic-gate 16397c478bd9Sstevel@tonic-gate 16407c478bd9Sstevel@tonic-gate /* 16417c478bd9Sstevel@tonic-gate ** Sequent DYNIX 3.2.0 16427c478bd9Sstevel@tonic-gate ** 16437c478bd9Sstevel@tonic-gate ** From Jim Davis <jdavis@cs.arizona.edu>. 16447c478bd9Sstevel@tonic-gate */ 16457c478bd9Sstevel@tonic-gate 16467c478bd9Sstevel@tonic-gate # ifdef sequent 16477c478bd9Sstevel@tonic-gate 16487c478bd9Sstevel@tonic-gate # define BSD 1 16497c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 16507c478bd9Sstevel@tonic-gate # define BSD4_3 1 /* to get signal() in conf.c */ 16517c478bd9Sstevel@tonic-gate # define WAITUNION 1 16527c478bd9Sstevel@tonic-gate # define LA_TYPE LA_FLOAT 16537c478bd9Sstevel@tonic-gate # ifdef _POSIX_VERSION 16547c478bd9Sstevel@tonic-gate # undef _POSIX_VERSION /* set in <unistd.h> */ 16557c478bd9Sstevel@tonic-gate # endif /* _POSIX_VERSION */ 16567c478bd9Sstevel@tonic-gate # undef HASSETVBUF /* don't actually have setvbuf(3) */ 16577c478bd9Sstevel@tonic-gate # define setpgid setpgrp 16587c478bd9Sstevel@tonic-gate 16597c478bd9Sstevel@tonic-gate /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 16607c478bd9Sstevel@tonic-gate # undef WIFEXITED 16617c478bd9Sstevel@tonic-gate # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 16627c478bd9Sstevel@tonic-gate ((union wait*)&(s))->w_termsig == 0) 16637c478bd9Sstevel@tonic-gate # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 16647c478bd9Sstevel@tonic-gate typedef int pid_t; 16657c478bd9Sstevel@tonic-gate # define isgraph(c) (isprint(c) && (c != ' ')) 16667c478bd9Sstevel@tonic-gate 16677c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 16687c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 16697c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 16707c478bd9Sstevel@tonic-gate 16717c478bd9Sstevel@tonic-gate # ifndef _PATH_UNIX 16727c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/dynix" 16737c478bd9Sstevel@tonic-gate # endif /* ! _PATH_UNIX */ 16747c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 16757c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 16767c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 16777c478bd9Sstevel@tonic-gate # endif /* sequent */ 16787c478bd9Sstevel@tonic-gate 16797c478bd9Sstevel@tonic-gate 16807c478bd9Sstevel@tonic-gate /* 16817c478bd9Sstevel@tonic-gate ** Sequent DYNIX/ptx v2.0 (and higher) 16827c478bd9Sstevel@tonic-gate ** 16837c478bd9Sstevel@tonic-gate ** For DYNIX/ptx v1.x, undefine HASSETREUID. 16847c478bd9Sstevel@tonic-gate ** 16857c478bd9Sstevel@tonic-gate ** From Tim Wright <timw@sequent.com>. 16867c478bd9Sstevel@tonic-gate ** Update from Jack Woolley <jwoolley@sctcorp.com>, 26 Dec 1995, 16877c478bd9Sstevel@tonic-gate ** for DYNIX/ptx 4.0.2. 16887c478bd9Sstevel@tonic-gate */ 16897c478bd9Sstevel@tonic-gate 16907c478bd9Sstevel@tonic-gate # ifdef _SEQUENT_ 16917c478bd9Sstevel@tonic-gate # include <sys/stream.h> 16927c478bd9Sstevel@tonic-gate # define SYSTEM5 1 /* include all the System V defines */ 16937c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 16947c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 16957c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) call */ 16967c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 16977c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 16987c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT 16997c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 17007c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 17017c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 17027c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 17037c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 17047c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 17057c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 17067c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 17077c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 17087c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/sendmail.pid" 17097c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 17107c478bd9Sstevel@tonic-gate # endif /* _SEQUENT_ */ 17117c478bd9Sstevel@tonic-gate 17127c478bd9Sstevel@tonic-gate /* 17137c478bd9Sstevel@tonic-gate ** Cray UNICOS, UNICOS/mk, and UNICOS/mp 17147c478bd9Sstevel@tonic-gate ** 17157c478bd9Sstevel@tonic-gate ** UNICOS: 17167c478bd9Sstevel@tonic-gate ** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 17177c478bd9Sstevel@tonic-gate ** Update Brian Ginsbach <ginsbach@cray.com> 17187c478bd9Sstevel@tonic-gate ** UNICOS/mk (Cray T3E): 17197c478bd9Sstevel@tonic-gate ** Contributed by Manu Mahonen <mailadm@csc.fi> 17207c478bd9Sstevel@tonic-gate ** of Center for Scientific Computing. 17217c478bd9Sstevel@tonic-gate ** Update Brian Ginsbach <ginsbach@cray.com> 17227c478bd9Sstevel@tonic-gate ** UNICOS/mp: 17237c478bd9Sstevel@tonic-gate ** From Aaron Davis <awd@cray.com> & Brian Ginsbach <ginsbach@cray.com> 17247c478bd9Sstevel@tonic-gate */ 17257c478bd9Sstevel@tonic-gate 17267c478bd9Sstevel@tonic-gate # if defined(_CRAY) || defined(UNICOS) || defined(_UNICOSMP) 17277c478bd9Sstevel@tonic-gate # define SYSTEM5 1 /* include all the System V defines */ 17287c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 17297c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) */ 17307c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(3) call */ 17317c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 17327c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) call */ 17337c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* has usable seteuid(2) call */ 17347c478bd9Sstevel@tonic-gate # define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */ 17357c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 /* has strerror(3) */ 17367c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 17377c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 17387c478bd9Sstevel@tonic-gate # define SFS_BAVAIL f_bfree /* alternate field name */ 17397c478bd9Sstevel@tonic-gate # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 17407c478bd9Sstevel@tonic-gate # ifdef UNICOS 17417c478bd9Sstevel@tonic-gate # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 17427c478bd9Sstevel@tonic-gate # define LA_TYPE LA_ZERO 17437c478bd9Sstevel@tonic-gate # define _PATH_MAILDIR "/usr/spool/mail" 17447c478bd9Sstevel@tonic-gate # define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst) 17457c478bd9Sstevel@tonic-gate # ifndef MAXPATHLEN 17467c478bd9Sstevel@tonic-gate # define MAXPATHLEN PATHSIZE 17477c478bd9Sstevel@tonic-gate # endif /* ! MAXPATHLEN */ 17487c478bd9Sstevel@tonic-gate # ifndef _PATH_UNIX 17497c478bd9Sstevel@tonic-gate # ifdef UNICOSMK 17507c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/unicosmk.ar" 17517c478bd9Sstevel@tonic-gate # else 17527c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/unicos" 17537c478bd9Sstevel@tonic-gate # endif /* UNICOSMK */ 17547c478bd9Sstevel@tonic-gate # endif /* ! _PATH_UNIX */ 17557c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 17567c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 17577c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 17587c478bd9Sstevel@tonic-gate # endif /* UNICOS */ 17597c478bd9Sstevel@tonic-gate # ifdef _UNICOSMP 17607c478bd9Sstevel@tonic-gate # if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) 17617c478bd9Sstevel@tonic-gate /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */ 17627c478bd9Sstevel@tonic-gate # define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN 17637c478bd9Sstevel@tonic-gate # endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */ 17647c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 17657c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 1 /* has setrlimit(2) syscall */ 17667c478bd9Sstevel@tonic-gate # define LA_TYPE LA_IRIX6 /* figure out at run time */ 17677c478bd9Sstevel@tonic-gate # include <sys/cdefs.h> 17687c478bd9Sstevel@tonic-gate # include <paths.h> 17697c478bd9Sstevel@tonic-gate # define ARGV_T char *const * 17707c478bd9Sstevel@tonic-gate # endif /* _UNICOSMP */ 17717c478bd9Sstevel@tonic-gate # endif /* _CRAY */ 17727c478bd9Sstevel@tonic-gate 17737c478bd9Sstevel@tonic-gate /* 17747c478bd9Sstevel@tonic-gate ** Apollo DomainOS 17757c478bd9Sstevel@tonic-gate ** 17767c478bd9Sstevel@tonic-gate ** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com> 17777c478bd9Sstevel@tonic-gate ** 17787c478bd9Sstevel@tonic-gate ** 15 Jan 1994; updated 2 Aug 1995 17797c478bd9Sstevel@tonic-gate ** 17807c478bd9Sstevel@tonic-gate */ 17817c478bd9Sstevel@tonic-gate 17827c478bd9Sstevel@tonic-gate # ifdef apollo 17837c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) call */ 17847c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(2) call */ 17857c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */ 17867c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_NONE /* don't use setproctitle */ 17877c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SUBR /* use getloadavg.c */ 17887c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 17897c478bd9Sstevel@tonic-gate # define SFS_BAVAIL f_bfree /* alternate field name */ 17907c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TZNAME 17917c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 17927c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 17937c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 17947c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 17957c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/sendmail.pid" 17967c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 17977c478bd9Sstevel@tonic-gate # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ 17987c478bd9Sstevel@tonic-gate # undef S_IFIFO 17997c478bd9Sstevel@tonic-gate # define S_IFIFO 0010000 18007c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 18017c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 18027c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 18037c478bd9Sstevel@tonic-gate # define RLIMIT_NEEDS_SYS_TIME_H 1 18047c478bd9Sstevel@tonic-gate # if defined(NGROUPS_MAX) && !NGROUPS_MAX 18057c478bd9Sstevel@tonic-gate # undef NGROUPS_MAX 18067c478bd9Sstevel@tonic-gate # endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */ 18077c478bd9Sstevel@tonic-gate # endif /* apollo */ 18087c478bd9Sstevel@tonic-gate 18097c478bd9Sstevel@tonic-gate /* 18107c478bd9Sstevel@tonic-gate ** MPE-iX 18117c478bd9Sstevel@tonic-gate ** 18127c478bd9Sstevel@tonic-gate ** Requires MPE 6.0 or greater. See sendmail/README for more info. 18137c478bd9Sstevel@tonic-gate ** 18147c478bd9Sstevel@tonic-gate ** From Mark Bixby <mark_bixby@hp.com> or <mark@bixby.org>. 18157c478bd9Sstevel@tonic-gate */ 18167c478bd9Sstevel@tonic-gate 18177c478bd9Sstevel@tonic-gate # ifdef MPE 18187c478bd9Sstevel@tonic-gate 18197c478bd9Sstevel@tonic-gate # include <sys/sysmacros.h> 18207c478bd9Sstevel@tonic-gate # include <fcntl.h> 18217c478bd9Sstevel@tonic-gate 18227c478bd9Sstevel@tonic-gate /* Sendmail stuff */ 18237c478bd9Sstevel@tonic-gate # define HASFCHOWN 0 /* lacks fchown() */ 18247c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* lacks getusershell() */ 18257c478bd9Sstevel@tonic-gate # ifdef HASNICE 18267c478bd9Sstevel@tonic-gate # undef HASNICE 18277c478bd9Sstevel@tonic-gate # endif /* HASNICE */ 18287c478bd9Sstevel@tonic-gate # define HASNICE 0 /* lacks nice() */ 18297c478bd9Sstevel@tonic-gate # define HASRANDOM 0 /* lacks random() */ 18307c478bd9Sstevel@tonic-gate # ifdef HASRRESVPORT 18317c478bd9Sstevel@tonic-gate # undef HASRRESVPORT 18327c478bd9Sstevel@tonic-gate # endif /* HASRRESVPORT */ 18337c478bd9Sstevel@tonic-gate # define HASRRESVPORT 0 /* lacks rresvport() */ 18347c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 0 /* lacks IP source routing fields */ 18357c478bd9Sstevel@tonic-gate # ifdef MATCHGECOS 18367c478bd9Sstevel@tonic-gate # undef MATCHGECOS 18377c478bd9Sstevel@tonic-gate # endif /* MATCHGECOS */ 18387c478bd9Sstevel@tonic-gate # define MATCHGECOS 0 /* lacks an initialized GECOS field */ 18397c478bd9Sstevel@tonic-gate # define NEEDFSYNC 1 /* use sendmail's fsync() */ 18407c478bd9Sstevel@tonic-gate # define NEEDLINK 1 /* use sendmail's link() */ 18417c478bd9Sstevel@tonic-gate # define NOFTRUNCATE 1 /* lacks ftruncate() */ 18427c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_NONE /* can't determine disk space */ 18437c478bd9Sstevel@tonic-gate # define SM_CONF_SYSLOG 0 /* use sendmail decl of syslog() */ 18447c478bd9Sstevel@tonic-gate # define USE_DOUBLE_FORK 0 /* don't fork an intermediate zombie */ 18457c478bd9Sstevel@tonic-gate # define USE_ENVIRON 1 /* use environ instead of envp */ 18467c478bd9Sstevel@tonic-gate 18477c478bd9Sstevel@tonic-gate /* Missing header stuff */ 18487c478bd9Sstevel@tonic-gate # define AF_UNSPEC 0 18497c478bd9Sstevel@tonic-gate # define AF_MAX AF_INET 18507c478bd9Sstevel@tonic-gate # define IFF_LOOPBACK 0x8 18517c478bd9Sstevel@tonic-gate # define IN_LOOPBACKNET 127 18527c478bd9Sstevel@tonic-gate # define MAXNAMLEN NAME_MAX 18537c478bd9Sstevel@tonic-gate # define S_IEXEC S_IXUSR 18547c478bd9Sstevel@tonic-gate # define S_IREAD S_IRUSR 18557c478bd9Sstevel@tonic-gate # define S_IWRITE S_IWUSR 18567c478bd9Sstevel@tonic-gate 18577c478bd9Sstevel@tonic-gate /* Present header stuff that needs to be missing */ 18587c478bd9Sstevel@tonic-gate # undef NGROUPS_MAX 18597c478bd9Sstevel@tonic-gate 18607c478bd9Sstevel@tonic-gate /* Shadow functions */ 18617c478bd9Sstevel@tonic-gate # define bind sendmail_mpe_bind 18627c478bd9Sstevel@tonic-gate # define _exit sendmail_mpe__exit 18637c478bd9Sstevel@tonic-gate # define exit sendmail_mpe_exit 18647c478bd9Sstevel@tonic-gate # define fcntl sendmail_mpe_fcntl 18657c478bd9Sstevel@tonic-gate # define getegid sendmail_mpe_getegid 18667c478bd9Sstevel@tonic-gate # define geteuid sendmail_mpe_geteuid 18677c478bd9Sstevel@tonic-gate # define getpwnam sendmail_mpe_getpwnam 18687c478bd9Sstevel@tonic-gate # define getpwuid sendmail_mpe_getpwuid 18697c478bd9Sstevel@tonic-gate # define setgid sendmail_mpe_setgid 18707c478bd9Sstevel@tonic-gate # define setuid sendmail_mpe_setuid 18717c478bd9Sstevel@tonic-gate extern int sendmail_mpe_fcntl __P((int, int, ...)); 18727c478bd9Sstevel@tonic-gate extern struct passwd * sendmail_mpe_getpwnam __P((const char *)); 18737c478bd9Sstevel@tonic-gate extern struct passwd * sendmail_mpe_getpwuid __P((uid_t)); 18747c478bd9Sstevel@tonic-gate # endif /* MPE */ 18757c478bd9Sstevel@tonic-gate 18767c478bd9Sstevel@tonic-gate /* 18777c478bd9Sstevel@tonic-gate ** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native) 18787c478bd9Sstevel@tonic-gate ** 18797c478bd9Sstevel@tonic-gate ** Contributed by Paul Gampe <paulg@apnic.net> 18807c478bd9Sstevel@tonic-gate */ 18817c478bd9Sstevel@tonic-gate 18827c478bd9Sstevel@tonic-gate # ifdef __svr5__ 18837c478bd9Sstevel@tonic-gate # include <sys/mkdev.h> 18847c478bd9Sstevel@tonic-gate # define __svr4__ 18857c478bd9Sstevel@tonic-gate # define SYS5SIGNALS 1 18867c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) call */ 18877c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 18887c478bd9Sstevel@tonic-gate # define HASSETREUID 1 18897c478bd9Sstevel@tonic-gate # define HASWAITPID 1 18907c478bd9Sstevel@tonic-gate # define HASGETDTABLESIZE 1 18917c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 18927c478bd9Sstevel@tonic-gate # define SOCKADDR_LEN_T size_t 18937c478bd9Sstevel@tonic-gate # define SOCKOPT_LEN_T size_t 18947c478bd9Sstevel@tonic-gate # ifndef _PATH_UNIX 18957c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/stand/unix" 18967c478bd9Sstevel@tonic-gate # endif /* ! _PATH_UNIX */ 18977c478bd9Sstevel@tonic-gate # define SPT_PADCHAR '\0' /* pad process title with nulls */ 18987c478bd9Sstevel@tonic-gate # ifndef SYSLOG_BUFSIZE 18997c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 1024 /* unsure */ 19007c478bd9Sstevel@tonic-gate # endif /* ! SYSLOG_BUFSIZE */ 19017c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 19027c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/etc/sendmail.cf" 19037c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 19047c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 19057c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/sendmail.pid" 19067c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 19077c478bd9Sstevel@tonic-gate # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */ 19087c478bd9Sstevel@tonic-gate #if !defined(SM_SET_H_ERRNO) && defined(_REENTRANT) 19097c478bd9Sstevel@tonic-gate # define SM_SET_H_ERRNO(err) set_h_errno((err)) 19107c478bd9Sstevel@tonic-gate #endif /* ! SM_SET_H_ERRNO && _REENTRANT */ 19117c478bd9Sstevel@tonic-gate # endif /* __svr5__ */ 19127c478bd9Sstevel@tonic-gate 19137c478bd9Sstevel@tonic-gate /* ###################################################################### */ 19147c478bd9Sstevel@tonic-gate 19157c478bd9Sstevel@tonic-gate /* 19167c478bd9Sstevel@tonic-gate ** UnixWare 2.x 19177c478bd9Sstevel@tonic-gate */ 19187c478bd9Sstevel@tonic-gate 19197c478bd9Sstevel@tonic-gate # ifdef UNIXWARE2 19207c478bd9Sstevel@tonic-gate # define UNIXWARE 1 19217c478bd9Sstevel@tonic-gate # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */ 19227c478bd9Sstevel@tonic-gate # endif /* UNIXWARE2 */ 19237c478bd9Sstevel@tonic-gate 19247c478bd9Sstevel@tonic-gate 19257c478bd9Sstevel@tonic-gate /* 19267c478bd9Sstevel@tonic-gate ** UnixWare 1.1.2. 19277c478bd9Sstevel@tonic-gate ** 19287c478bd9Sstevel@tonic-gate ** Updated by Petr Lampa <lampa@fee.vutbr.cz>. 19297c478bd9Sstevel@tonic-gate ** From Evan Champion <evanc@spatial.synapse.org>. 19307c478bd9Sstevel@tonic-gate */ 19317c478bd9Sstevel@tonic-gate 19327c478bd9Sstevel@tonic-gate # ifdef UNIXWARE 19337c478bd9Sstevel@tonic-gate # include <sys/mkdev.h> 19347c478bd9Sstevel@tonic-gate # define SYSTEM5 1 19357c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 19367c478bd9Sstevel@tonic-gate # define HASSETREUID 1 19377c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 19387c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 19397c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 19407c478bd9Sstevel@tonic-gate # define SLEEP_T unsigned 19417c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATVFS 19427c478bd9Sstevel@tonic-gate # define LA_TYPE LA_ZERO 19437c478bd9Sstevel@tonic-gate # undef WIFEXITED 19447c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 19457c478bd9Sstevel@tonic-gate # ifndef _PATH_UNIX 19467c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/unix" 19477c478bd9Sstevel@tonic-gate # endif /* ! _PATH_UNIX */ 19487c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 19497c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 19507c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 19517c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 19527c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 19537c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 19547c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 128 19557c478bd9Sstevel@tonic-gate # endif /* UNIXWARE */ 19567c478bd9Sstevel@tonic-gate 19577c478bd9Sstevel@tonic-gate 19587c478bd9Sstevel@tonic-gate /* 19597c478bd9Sstevel@tonic-gate ** Intergraph CLIX 3.1 19607c478bd9Sstevel@tonic-gate ** 19617c478bd9Sstevel@tonic-gate ** From Paul Southworth <pauls@locust.cic.net> 19627c478bd9Sstevel@tonic-gate */ 19637c478bd9Sstevel@tonic-gate 19647c478bd9Sstevel@tonic-gate # ifdef CLIX 19657c478bd9Sstevel@tonic-gate # define SYSTEM5 1 /* looks like System V */ 19667c478bd9Sstevel@tonic-gate # ifndef HASGETUSERSHELL 19677c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 19687c478bd9Sstevel@tonic-gate # endif /* ! HASGETUSERSHELL */ 19697c478bd9Sstevel@tonic-gate # define DEV_BSIZE 512 /* device block size not defined */ 19707c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 19717c478bd9Sstevel@tonic-gate # undef LOG /* syslog not available */ 19727c478bd9Sstevel@tonic-gate # define NEEDFSYNC 1 /* no fsync in system library */ 19737c478bd9Sstevel@tonic-gate # define GETSHORT _getshort 19747c478bd9Sstevel@tonic-gate # endif /* CLIX */ 19757c478bd9Sstevel@tonic-gate 19767c478bd9Sstevel@tonic-gate 19777c478bd9Sstevel@tonic-gate /* 19787c478bd9Sstevel@tonic-gate ** NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP 19797c478bd9Sstevel@tonic-gate ** 19807c478bd9Sstevel@tonic-gate ** From Kevin Darcy <kevin@tech.mis.cfc.com>. 19817c478bd9Sstevel@tonic-gate */ 19827c478bd9Sstevel@tonic-gate 19837c478bd9Sstevel@tonic-gate # ifdef NCR_MP_RAS2 19847c478bd9Sstevel@tonic-gate # include <sys/sockio.h> 19857c478bd9Sstevel@tonic-gate # define __svr4__ 19867c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 19877c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 1024 19887c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_NONE 19897c478bd9Sstevel@tonic-gate # endif /* NCR_MP_RAS2 */ 19907c478bd9Sstevel@tonic-gate 19917c478bd9Sstevel@tonic-gate 19927c478bd9Sstevel@tonic-gate /* 19937c478bd9Sstevel@tonic-gate ** NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP 19947c478bd9Sstevel@tonic-gate ** 19957c478bd9Sstevel@tonic-gate ** From Tom Moore <Tom.Moore@DaytonOH.NCR.COM> 19967c478bd9Sstevel@tonic-gate */ 19977c478bd9Sstevel@tonic-gate 19987c478bd9Sstevel@tonic-gate # ifdef NCR_MP_RAS3 19997c478bd9Sstevel@tonic-gate # define __svr4__ 20007c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 /* has fchown(2) call */ 20017c478bd9Sstevel@tonic-gate # define LDA_USE_LOCKF 1 20027c478bd9Sstevel@tonic-gate # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM has non-std interface */ 20037c478bd9Sstevel@tonic-gate # define SO_REUSEADDR_IS_BROKEN 1 /* doesn't work if accept() fails */ 20047c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 1024 20057c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_NONE 20067c478bd9Sstevel@tonic-gate # define _PATH_MAILDIR "/var/mail" 20077c478bd9Sstevel@tonic-gate # ifndef _XOPEN_SOURCE 20087c478bd9Sstevel@tonic-gate # define _XOPEN_SOURCE 20097c478bd9Sstevel@tonic-gate # define _XOPEN_SOURCE_EXTENDED 1 20107c478bd9Sstevel@tonic-gate # include <sys/resource.h> 20117c478bd9Sstevel@tonic-gate # undef _XOPEN_SOURCE 20127c478bd9Sstevel@tonic-gate # undef _XOPEN_SOURCE_EXTENDED 20137c478bd9Sstevel@tonic-gate # endif /* ! _XOPEN_SOURCE */ 20147c478bd9Sstevel@tonic-gate # endif /* NCR_MP_RAS3 */ 20157c478bd9Sstevel@tonic-gate 20167c478bd9Sstevel@tonic-gate 20177c478bd9Sstevel@tonic-gate /* 20187c478bd9Sstevel@tonic-gate ** Tandem NonStop-UX SVR4 20197c478bd9Sstevel@tonic-gate ** 20207c478bd9Sstevel@tonic-gate ** From Rick McCarty <mccarty@mpd.tandem.com>. 20217c478bd9Sstevel@tonic-gate */ 20227c478bd9Sstevel@tonic-gate 20237c478bd9Sstevel@tonic-gate # ifdef NonStop_UX_BXX 20247c478bd9Sstevel@tonic-gate # define __svr4__ 20257c478bd9Sstevel@tonic-gate # endif /* NonStop_UX_BXX */ 20267c478bd9Sstevel@tonic-gate 20277c478bd9Sstevel@tonic-gate 20287c478bd9Sstevel@tonic-gate /* 20297c478bd9Sstevel@tonic-gate ** Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2. 20307c478bd9Sstevel@tonic-gate ** 20317c478bd9Sstevel@tonic-gate ** Tested for 1.04, 1.03 20327c478bd9Sstevel@tonic-gate ** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>. 20337c478bd9Sstevel@tonic-gate ** 20347c478bd9Sstevel@tonic-gate ** Tested for 4.02, 6.10 and 7.10 20357c478bd9Sstevel@tonic-gate ** From Motonori NAKAMURA <motonori@media.kyoto-u.ac.jp>. 20367c478bd9Sstevel@tonic-gate */ 20377c478bd9Sstevel@tonic-gate 20387c478bd9Sstevel@tonic-gate # if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) 20397c478bd9Sstevel@tonic-gate # define SYSTEM5 1 /* include all the System V defines */ 20407c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 20417c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* has fchmod(2) syscall */ 20427c478bd9Sstevel@tonic-gate # define setreuid(r, e) setresuid(r, e, -1) 20437c478bd9Sstevel@tonic-gate # define LA_TYPE LA_FLOAT 20447c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_PSTAT 20457c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 20467c478bd9Sstevel@tonic-gate # ifndef HASSETVBUF 20477c478bd9Sstevel@tonic-gate # define HASSETVBUF /* HI-UX has no setlinebuf */ 20487c478bd9Sstevel@tonic-gate # endif /* ! HASSETVBUF */ 20497c478bd9Sstevel@tonic-gate # ifndef GIDSET_T 20507c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 20517c478bd9Sstevel@tonic-gate # endif /* ! GIDSET_T */ 20527c478bd9Sstevel@tonic-gate # ifndef _PATH_UNIX 20537c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/HI-UX" 20547c478bd9Sstevel@tonic-gate # endif /* ! _PATH_UNIX */ 20557c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 20567c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 20577c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 20587c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 20597c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 20607c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 20617c478bd9Sstevel@tonic-gate # ifndef HASGETUSERSHELL 20627c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 20637c478bd9Sstevel@tonic-gate # endif /* ! HASGETUSERSHELL */ 20647c478bd9Sstevel@tonic-gate # define FDSET_CAST (int *) /* cast for fd_set parameters to select */ 20657c478bd9Sstevel@tonic-gate 20667c478bd9Sstevel@tonic-gate /* 20677c478bd9Sstevel@tonic-gate ** avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h 20687c478bd9Sstevel@tonic-gate ** on HIUX 3050 20697c478bd9Sstevel@tonic-gate */ 20707c478bd9Sstevel@tonic-gate # undef m_flags 20717c478bd9Sstevel@tonic-gate 20727c478bd9Sstevel@tonic-gate # define SM_CONF_SYSLOG 0 20737c478bd9Sstevel@tonic-gate 20747c478bd9Sstevel@tonic-gate # endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */ 20757c478bd9Sstevel@tonic-gate 20767c478bd9Sstevel@tonic-gate 20777c478bd9Sstevel@tonic-gate /* 20787c478bd9Sstevel@tonic-gate ** Amdahl UTS System V 2.1.5 (SVr3-based) 20797c478bd9Sstevel@tonic-gate ** 20807c478bd9Sstevel@tonic-gate ** From: Janet Jackson <janet@dialix.oz.au>. 20817c478bd9Sstevel@tonic-gate */ 20827c478bd9Sstevel@tonic-gate 20837c478bd9Sstevel@tonic-gate # ifdef _UTS 20847c478bd9Sstevel@tonic-gate # include <sys/sysmacros.h> 20857c478bd9Sstevel@tonic-gate # undef HASLSTAT /* has symlinks, but they cause problems */ 20867c478bd9Sstevel@tonic-gate # define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */ 20877c478bd9Sstevel@tonic-gate # define SYS5SIGNALS 1 /* System V signal semantics */ 20887c478bd9Sstevel@tonic-gate # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 20897c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 20907c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) function */ 20917c478bd9Sstevel@tonic-gate # define HASSETVBUF 1 /* has setvbuf(3) function */ 20927c478bd9Sstevel@tonic-gate # ifndef HASGETUSERSHELL 20937c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) function */ 20947c478bd9Sstevel@tonic-gate # endif /* ! HASGETUSERSHELL */ 20957c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */ 20967c478bd9Sstevel@tonic-gate # define LA_TYPE LA_ZERO /* doesn't have load average */ 20977c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */ 20987c478bd9Sstevel@tonic-gate # define SFS_BAVAIL f_bfree /* alternate field name */ 20997c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/unix" 21007c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 21017c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 21027c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 21037c478bd9Sstevel@tonic-gate # endif /* _UTS */ 21047c478bd9Sstevel@tonic-gate 21057c478bd9Sstevel@tonic-gate /* 21067c478bd9Sstevel@tonic-gate ** Cray Computer Corporation's CSOS 21077c478bd9Sstevel@tonic-gate ** 21087c478bd9Sstevel@tonic-gate ** From Scott Bolte <scott@craycos.com>. 21097c478bd9Sstevel@tonic-gate */ 21107c478bd9Sstevel@tonic-gate 21117c478bd9Sstevel@tonic-gate # ifdef _CRAYCOM 21127c478bd9Sstevel@tonic-gate # define SYSTEM5 1 /* include all the System V defines */ 21137c478bd9Sstevel@tonic-gate # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 21147c478bd9Sstevel@tonic-gate # define NEEDFSYNC 1 /* no fsync in system library */ 21157c478bd9Sstevel@tonic-gate # define MAXPATHLEN PATHSIZE 21167c478bd9Sstevel@tonic-gate # define LA_TYPE LA_ZERO 21177c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 21187c478bd9Sstevel@tonic-gate # define SFS_BAVAIL f_bfree /* alternate field name */ 21197c478bd9Sstevel@tonic-gate # define _POSIX_CHOWN_RESTRICTED -1 21207c478bd9Sstevel@tonic-gate extern struct group *getgrent(), *getgrnam(), *getgrgid(); 21217c478bd9Sstevel@tonic-gate # endif /* _CRAYCOM */ 21227c478bd9Sstevel@tonic-gate 21237c478bd9Sstevel@tonic-gate 21247c478bd9Sstevel@tonic-gate /* 21257c478bd9Sstevel@tonic-gate ** Sony NEWS-OS 4.2.1R and 6.0.3 21267c478bd9Sstevel@tonic-gate ** 21277c478bd9Sstevel@tonic-gate ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 21287c478bd9Sstevel@tonic-gate */ 21297c478bd9Sstevel@tonic-gate 21307c478bd9Sstevel@tonic-gate # ifdef sony_news 21317c478bd9Sstevel@tonic-gate # ifndef __svr4 21327c478bd9Sstevel@tonic-gate /* NEWS-OS 4.2.1R */ 21337c478bd9Sstevel@tonic-gate # ifndef BSD 21347c478bd9Sstevel@tonic-gate # define BSD /* has BSD routines */ 21357c478bd9Sstevel@tonic-gate # endif /* ! BSD */ 21367c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(2) call */ 21377c478bd9Sstevel@tonic-gate # undef HASSETVBUF /* don't actually have setvbuf(3) */ 21387c478bd9Sstevel@tonic-gate # define WAITUNION 1 /* use "union wait" as wait argument type */ 21397c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT 21407c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 21417c478bd9Sstevel@tonic-gate # ifndef HASFLOCK 21427c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* has flock(2) call */ 21437c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */ 21447c478bd9Sstevel@tonic-gate # define setpgid setpgrp 21457c478bd9Sstevel@tonic-gate # undef WIFEXITED 21467c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 21477c478bd9Sstevel@tonic-gate # define MODE_T int /* system include files have no mode_t */ 21487c478bd9Sstevel@tonic-gate typedef int pid_t; 21497c478bd9Sstevel@tonic-gate typedef int (*sigfunc_t)(); 21507c478bd9Sstevel@tonic-gate # define SIGFUNC_DEFINED 21517c478bd9Sstevel@tonic-gate # define SIGFUNC_RETURN (0) 21527c478bd9Sstevel@tonic-gate # define SIGFUNC_DECL int 21537c478bd9Sstevel@tonic-gate 21547c478bd9Sstevel@tonic-gate # else /* ! __svr4 */ 21557c478bd9Sstevel@tonic-gate /* NEWS-OS 6.0.3 with /bin/cc */ 21567c478bd9Sstevel@tonic-gate # ifndef __svr4__ 21577c478bd9Sstevel@tonic-gate # define __svr4__ /* use all System V Release 4 defines below */ 21587c478bd9Sstevel@tonic-gate # endif /* ! __svr4__ */ 21597c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 21607c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 21617c478bd9Sstevel@tonic-gate # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ 21627c478bd9Sstevel@tonic-gate # ifndef SPT_TYPE 21637c478bd9Sstevel@tonic-gate # define SPT_TYPE SPT_SYSMIPS /* use sysmips() (OS 6.0.2 or later) */ 21647c478bd9Sstevel@tonic-gate # endif /* ! SPT_TYPE */ 21657c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 21667c478bd9Sstevel@tonic-gate # undef WIFEXITED 21677c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 21687c478bd9Sstevel@tonic-gate # ifndef SYSLOG_BUFSIZE 21697c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 256 21707c478bd9Sstevel@tonic-gate # endif /* ! SYSLOG_BUFSIZE */ 21717c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/stand/unix" 21727c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 21737c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 21747c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 21757c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 21767c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 21777c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 21787c478bd9Sstevel@tonic-gate 21797c478bd9Sstevel@tonic-gate # endif /* ! __svr4 */ 21807c478bd9Sstevel@tonic-gate # endif /* sony_news */ 21817c478bd9Sstevel@tonic-gate 21827c478bd9Sstevel@tonic-gate 21837c478bd9Sstevel@tonic-gate /* 21847c478bd9Sstevel@tonic-gate ** Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach 21857c478bd9Sstevel@tonic-gate ** 21867c478bd9Sstevel@tonic-gate ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 21877c478bd9Sstevel@tonic-gate */ 21887c478bd9Sstevel@tonic-gate 21897c478bd9Sstevel@tonic-gate # ifdef luna 21907c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 21917c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 21927c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 21937c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 /* has unsetenv(2) call */ 21947c478bd9Sstevel@tonic-gate # define NEEDPUTENV 1 /* need putenv(3) call */ 21957c478bd9Sstevel@tonic-gate # define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 21967c478bd9Sstevel@tonic-gate # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 21977c478bd9Sstevel@tonic-gate # define WAITUNION 1 /* use "union wait" as wait argument type */ 21987c478bd9Sstevel@tonic-gate # ifdef uniosb 21997c478bd9Sstevel@tonic-gate # include <sys/time.h> 22007c478bd9Sstevel@tonic-gate # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 22017c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT 22027c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 22037c478bd9Sstevel@tonic-gate # endif /* uniosb */ 22047c478bd9Sstevel@tonic-gate # ifdef luna2 22057c478bd9Sstevel@tonic-gate # define LA_TYPE LA_SUBR 22067c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 22077c478bd9Sstevel@tonic-gate # endif /* luna2 */ 22087c478bd9Sstevel@tonic-gate # ifdef luna88k 22097c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT 22107c478bd9Sstevel@tonic-gate # endif /* luna88k */ 22117c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 22127c478bd9Sstevel@tonic-gate # define setpgid setpgrp 22137c478bd9Sstevel@tonic-gate # undef WIFEXITED 22147c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 22157c478bd9Sstevel@tonic-gate typedef int pid_t; 22167c478bd9Sstevel@tonic-gate typedef int (*sigfunc_t)(); 22177c478bd9Sstevel@tonic-gate # define SIGFUNC_DEFINED 22187c478bd9Sstevel@tonic-gate # define SIGFUNC_RETURN (0) 22197c478bd9Sstevel@tonic-gate # define SIGFUNC_DECL int 22207c478bd9Sstevel@tonic-gate extern char *getenv(); 22217c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 22227c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 22237c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 22247c478bd9Sstevel@tonic-gate # endif /* luna */ 22257c478bd9Sstevel@tonic-gate 22267c478bd9Sstevel@tonic-gate 22277c478bd9Sstevel@tonic-gate /* 22287c478bd9Sstevel@tonic-gate ** NEC EWS-UX/V 4.2 (with /usr/ucb/cc) 22297c478bd9Sstevel@tonic-gate ** 22307c478bd9Sstevel@tonic-gate ** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 22317c478bd9Sstevel@tonic-gate */ 22327c478bd9Sstevel@tonic-gate 22337c478bd9Sstevel@tonic-gate # if defined(nec_ews_svr4) || defined(_nec_ews_svr4) 22347c478bd9Sstevel@tonic-gate # ifndef __svr4__ 22357c478bd9Sstevel@tonic-gate # define __svr4__ /* use all System V Release 4 defines below */ 22367c478bd9Sstevel@tonic-gate # endif /* ! __svr4__ */ 22377c478bd9Sstevel@tonic-gate # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 22387c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 22397c478bd9Sstevel@tonic-gate # define LA_TYPE LA_READKSYM /* use MIOC_READSYM ioctl */ 22407c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 22417c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 22427c478bd9Sstevel@tonic-gate # undef WIFEXITED 22437c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 22447c478bd9Sstevel@tonic-gate # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ 22457c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 22467c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 22477c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 22487c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 22497c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 22507c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 22517c478bd9Sstevel@tonic-gate # ifndef SYSLOG_BUFSIZE 22527c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 22537c478bd9Sstevel@tonic-gate # endif /* ! SYSLOG_BUFSIZE */ 22547c478bd9Sstevel@tonic-gate # endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */ 22557c478bd9Sstevel@tonic-gate 22567c478bd9Sstevel@tonic-gate 22577c478bd9Sstevel@tonic-gate /* 22587c478bd9Sstevel@tonic-gate ** Fujitsu/ICL UXP/DS (For the DS/90 Series) 22597c478bd9Sstevel@tonic-gate ** 22607c478bd9Sstevel@tonic-gate ** From Diego R. Lopez <drlopez@cica.es>. 22617c478bd9Sstevel@tonic-gate ** Additional changes from Fumio Moriya and Toshiaki Nomura of the 22627c478bd9Sstevel@tonic-gate ** Fujitsu Fresoftware group <dsfrsoft@oai6.yk.fujitsu.co.jp>. 22637c478bd9Sstevel@tonic-gate */ 22647c478bd9Sstevel@tonic-gate 22657c478bd9Sstevel@tonic-gate # ifdef __uxp__ 22667c478bd9Sstevel@tonic-gate # include <arpa/nameser.h> 22677c478bd9Sstevel@tonic-gate # include <sys/sysmacros.h> 22687c478bd9Sstevel@tonic-gate # include <sys/mkdev.h> 22697c478bd9Sstevel@tonic-gate # define __svr4__ 22707c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 22717c478bd9Sstevel@tonic-gate # define HASFLOCK 0 22727c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/stand/unix" 22737c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 22747c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 22757c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 22767c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 22777c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 22787c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 22797c478bd9Sstevel@tonic-gate # endif /* __uxp__ */ 22807c478bd9Sstevel@tonic-gate 22817c478bd9Sstevel@tonic-gate /* 22827c478bd9Sstevel@tonic-gate ** Pyramid DC/OSx 22837c478bd9Sstevel@tonic-gate ** 22847c478bd9Sstevel@tonic-gate ** From Earle Ake <akee@wpdiss1.wpafb.af.mil>. 22857c478bd9Sstevel@tonic-gate */ 22867c478bd9Sstevel@tonic-gate 22877c478bd9Sstevel@tonic-gate # ifdef DCOSx 22887c478bd9Sstevel@tonic-gate # define GIDSET_T gid_t 22897c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 22907c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 /* TCP/IP implementation is broken */ 22917c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 22927c478bd9Sstevel@tonic-gate # endif /* DCOSx */ 22937c478bd9Sstevel@tonic-gate 22947c478bd9Sstevel@tonic-gate /* 22957c478bd9Sstevel@tonic-gate ** Concurrent Computer Corporation Maxion 22967c478bd9Sstevel@tonic-gate ** 22977c478bd9Sstevel@tonic-gate ** From Donald R. Laster Jr. <laster@access.digex.net>. 22987c478bd9Sstevel@tonic-gate */ 22997c478bd9Sstevel@tonic-gate 23007c478bd9Sstevel@tonic-gate # ifdef __MAXION__ 23017c478bd9Sstevel@tonic-gate 23027c478bd9Sstevel@tonic-gate # include <sys/stream.h> 23037c478bd9Sstevel@tonic-gate # define __svr4__ 1 /* SVR4.2MP */ 23047c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* have setreuid(2) */ 23057c478bd9Sstevel@tonic-gate # define HASLSTAT 1 /* have lstat(2) */ 23067c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 1 /* have setrlimit(2) */ 23077c478bd9Sstevel@tonic-gate # define HASGETDTABLESIZE 1 /* have getdtablesize(2) */ 23087c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 1 /* have getusershell(3) */ 23097c478bd9Sstevel@tonic-gate # define NOFTRUNCATE 1 /* do not have ftruncate(2) */ 23107c478bd9Sstevel@tonic-gate # define SLEEP_T unsigned 23117c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATVFS 23127c478bd9Sstevel@tonic-gate # define SFS_BAVAIL f_bavail 23137c478bd9Sstevel@tonic-gate # ifndef SYSLOG_BUFSIZE 23147c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 256 /* Use 256 bytes */ 23157c478bd9Sstevel@tonic-gate # endif /* ! SYSLOG_BUFSIZE */ 23167c478bd9Sstevel@tonic-gate 23177c478bd9Sstevel@tonic-gate # undef WUNTRACED 23187c478bd9Sstevel@tonic-gate # undef WIFEXITED 23197c478bd9Sstevel@tonic-gate # undef WIFSIGNALED 23207c478bd9Sstevel@tonic-gate # undef WIFSTOPPED 23217c478bd9Sstevel@tonic-gate # undef WEXITSTATUS 23227c478bd9Sstevel@tonic-gate # undef WTERMSIG 23237c478bd9Sstevel@tonic-gate # undef WSTOPSIG 23247c478bd9Sstevel@tonic-gate 23257c478bd9Sstevel@tonic-gate # endif /* __MAXION__ */ 23267c478bd9Sstevel@tonic-gate 23277c478bd9Sstevel@tonic-gate /* 23287c478bd9Sstevel@tonic-gate ** Harris Nighthawk PowerUX (nh6000 box) 23297c478bd9Sstevel@tonic-gate ** 23307c478bd9Sstevel@tonic-gate ** Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com> 23317c478bd9Sstevel@tonic-gate */ 23327c478bd9Sstevel@tonic-gate 23337c478bd9Sstevel@tonic-gate # ifdef _PowerUX 23347c478bd9Sstevel@tonic-gate # ifndef __svr4__ 23357c478bd9Sstevel@tonic-gate # define __svr4__ 23367c478bd9Sstevel@tonic-gate # endif /* ! __svr4__ */ 23377c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 23387c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 23397c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 23407c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 23417c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 23427c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 23437c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 1024 23447c478bd9Sstevel@tonic-gate # define LA_TYPE LA_ZERO 23457c478bd9Sstevel@tonic-gate typedef struct msgb mblk_t; 23467c478bd9Sstevel@tonic-gate # undef offsetof /* avoid stddefs.h and sys/sysmacros.h conflict */ 23477c478bd9Sstevel@tonic-gate # endif /* _PowerUX */ 23487c478bd9Sstevel@tonic-gate 23497c478bd9Sstevel@tonic-gate /* 23507c478bd9Sstevel@tonic-gate ** Siemens Nixdorf Informationssysteme AG SINIX 23517c478bd9Sstevel@tonic-gate ** 23527c478bd9Sstevel@tonic-gate ** Contributed by Gerald Rinske of Siemens Business Services VAS. 23537c478bd9Sstevel@tonic-gate */ 23547c478bd9Sstevel@tonic-gate # ifdef sinix 23557c478bd9Sstevel@tonic-gate # define HASRANDOM 0 /* has random(3) */ 23567c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 1024 23577c478bd9Sstevel@tonic-gate # define SM_INT32 int /* 32bit integer */ 23587c478bd9Sstevel@tonic-gate # endif /* sinix */ 23597c478bd9Sstevel@tonic-gate 23607c478bd9Sstevel@tonic-gate 23617c478bd9Sstevel@tonic-gate /* 23627c478bd9Sstevel@tonic-gate ** Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3 23637c478bd9Sstevel@tonic-gate ** 23647c478bd9Sstevel@tonic-gate ** Contributed by Sergey Rusanov <rsm@utfoms.udmnet.ru> 23657c478bd9Sstevel@tonic-gate */ 23667c478bd9Sstevel@tonic-gate 23677c478bd9Sstevel@tonic-gate # ifdef MOTO 23687c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 23697c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 0 23707c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 23717c478bd9Sstevel@tonic-gate # define HASSETREUID 1 23727c478bd9Sstevel@tonic-gate # define HASULIMIT 1 23737c478bd9Sstevel@tonic-gate # define HASWAITPID 1 23747c478bd9Sstevel@tonic-gate # define HASGETDTABLESIZE 1 23757c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 1 23767c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 0 23777c478bd9Sstevel@tonic-gate # define IDENTPROTO 0 23787c478bd9Sstevel@tonic-gate # define RES_DNSRCH_VARIABLE _res_dnsrch 23797c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/unix" 23807c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/etc/sendmail.cf" 23817c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/var/run/sendmail.pid" 23827c478bd9Sstevel@tonic-gate # endif /* MOTO */ 23837c478bd9Sstevel@tonic-gate 23847c478bd9Sstevel@tonic-gate /* 23857c478bd9Sstevel@tonic-gate ** Interix 23867c478bd9Sstevel@tonic-gate ** Contributed by Nedelcho Stanev <nedelcho.stanev@atlanticsky.com> 23877c478bd9Sstevel@tonic-gate ** 23887c478bd9Sstevel@tonic-gate ** Used for Interix support. 23897c478bd9Sstevel@tonic-gate */ 23907c478bd9Sstevel@tonic-gate 23917c478bd9Sstevel@tonic-gate # if defined(__INTERIX) 23927c478bd9Sstevel@tonic-gate # define HASURANDOMDEV 1 23937c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 23947c478bd9Sstevel@tonic-gate # define HASSTRERROR 1 23957c478bd9Sstevel@tonic-gate # define HASUNSETENV 1 23967c478bd9Sstevel@tonic-gate # define HASFCHOWN 1 23977c478bd9Sstevel@tonic-gate # undef HAVE_SYS_ERRLIST 23987c478bd9Sstevel@tonic-gate # define sys_errlist __sys_errlist 23997c478bd9Sstevel@tonic-gate # define sys_nerr __sys_nerr 24007c478bd9Sstevel@tonic-gate # include <sys/mkdev.h> 24017c478bd9Sstevel@tonic-gate # ifndef major 24027c478bd9Sstevel@tonic-gate # define major(dev) ((int)(((dev) >> 8) & 0xff)) 24037c478bd9Sstevel@tonic-gate # endif /* ! major */ 24047c478bd9Sstevel@tonic-gate # ifndef minor 24057c478bd9Sstevel@tonic-gate # define minor(dev) ((int)((dev) & 0xff)) 24067c478bd9Sstevel@tonic-gate # endif /* ! minor */ 24077c478bd9Sstevel@tonic-gate # endif /* defined(__INTERIX) */ 24087c478bd9Sstevel@tonic-gate 24097c478bd9Sstevel@tonic-gate 24107c478bd9Sstevel@tonic-gate /********************************************************************** 24117c478bd9Sstevel@tonic-gate ** End of Per-Operating System defines 24127c478bd9Sstevel@tonic-gate **********************************************************************/ 24137c478bd9Sstevel@tonic-gate /********************************************************************** 24147c478bd9Sstevel@tonic-gate ** More general defines 24157c478bd9Sstevel@tonic-gate **********************************************************************/ 24167c478bd9Sstevel@tonic-gate 24177c478bd9Sstevel@tonic-gate /* general BSD defines */ 24187c478bd9Sstevel@tonic-gate # ifdef BSD 24197c478bd9Sstevel@tonic-gate # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 24207c478bd9Sstevel@tonic-gate # ifndef HASSETREUID 24217c478bd9Sstevel@tonic-gate # define HASSETREUID 1 /* has setreuid(2) call */ 24227c478bd9Sstevel@tonic-gate # endif /* ! HASSETREUID */ 24237c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 24247c478bd9Sstevel@tonic-gate # ifndef IP_SRCROUTE 24257c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 1 /* can check IP source routing */ 24267c478bd9Sstevel@tonic-gate # endif /* ! IP_SRCROUTE */ 24277c478bd9Sstevel@tonic-gate # ifndef HASSETRLIMIT 24287c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 24297c478bd9Sstevel@tonic-gate # endif /* ! HASSETRLIMIT */ 24307c478bd9Sstevel@tonic-gate # ifndef HASFLOCK 24317c478bd9Sstevel@tonic-gate # define HASFLOCK 1 /* has flock(2) call */ 24327c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */ 24337c478bd9Sstevel@tonic-gate # ifndef TZ_TYPE 24347c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */ 24357c478bd9Sstevel@tonic-gate # endif /* ! TZ_TYPE */ 24367c478bd9Sstevel@tonic-gate # endif /* BSD */ 24377c478bd9Sstevel@tonic-gate 24387c478bd9Sstevel@tonic-gate /* general System V Release 4 defines */ 24397c478bd9Sstevel@tonic-gate # ifdef __svr4__ 24407c478bd9Sstevel@tonic-gate # define SYSTEM5 1 24417c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* has usable seteuid(2) call */ 24427c478bd9Sstevel@tonic-gate # define HASINITGROUPS 1 /* has initgroups(3) call */ 24437c478bd9Sstevel@tonic-gate # define BSD_COMP 1 /* get BSD ioctl calls */ 24447c478bd9Sstevel@tonic-gate # ifndef HASSETRLIMIT 24457c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 1 /* has setrlimit(2) call */ 24467c478bd9Sstevel@tonic-gate # endif /* ! HASSETRLIMIT */ 24477c478bd9Sstevel@tonic-gate # ifndef HASGETUSERSHELL 24487c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 24497c478bd9Sstevel@tonic-gate # endif /* ! HASGETUSERSHELL */ 24507c478bd9Sstevel@tonic-gate # ifndef HASFCHMOD 24517c478bd9Sstevel@tonic-gate # define HASFCHMOD 1 /* most (all?) SVr4s seem to have fchmod(2) */ 24527c478bd9Sstevel@tonic-gate # endif /* ! HASFCHMOD */ 24537c478bd9Sstevel@tonic-gate 24547c478bd9Sstevel@tonic-gate # ifndef _PATH_UNIX 24557c478bd9Sstevel@tonic-gate # define _PATH_UNIX "/unix" 24567c478bd9Sstevel@tonic-gate # endif /* ! _PATH_UNIX */ 24577c478bd9Sstevel@tonic-gate # ifndef _PATH_VENDOR_CF 24587c478bd9Sstevel@tonic-gate # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 24597c478bd9Sstevel@tonic-gate # endif /* ! _PATH_VENDOR_CF */ 24607c478bd9Sstevel@tonic-gate # ifndef _PATH_SENDMAILPID 24617c478bd9Sstevel@tonic-gate # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 24627c478bd9Sstevel@tonic-gate # endif /* ! _PATH_SENDMAILPID */ 24637c478bd9Sstevel@tonic-gate # ifndef SYSLOG_BUFSIZE 24647c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 128 24657c478bd9Sstevel@tonic-gate # endif /* ! SYSLOG_BUFSIZE */ 24667c478bd9Sstevel@tonic-gate # ifndef SFS_TYPE 24677c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_STATVFS 24687c478bd9Sstevel@tonic-gate # endif /* ! SFS_TYPE */ 24697c478bd9Sstevel@tonic-gate 24707c478bd9Sstevel@tonic-gate # ifndef USE_SIGLONGJMP 24717c478bd9Sstevel@tonic-gate # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ 24727c478bd9Sstevel@tonic-gate # endif /* ! USE_SIGLONGJMP */ 24737c478bd9Sstevel@tonic-gate # endif /* __svr4__ */ 24747c478bd9Sstevel@tonic-gate 24757c478bd9Sstevel@tonic-gate # ifdef __SVR4 24767c478bd9Sstevel@tonic-gate # define LDA_USE_LOCKF 1 24777c478bd9Sstevel@tonic-gate # define LDA_USE_SETEUID 1 24787c478bd9Sstevel@tonic-gate # define _PATH_MAILDIR "/var/mail" 24797c478bd9Sstevel@tonic-gate # endif /* __SVR4 */ 24807c478bd9Sstevel@tonic-gate 24817c478bd9Sstevel@tonic-gate /* general System V defines */ 24827c478bd9Sstevel@tonic-gate # ifdef SYSTEM5 24837c478bd9Sstevel@tonic-gate # include <sys/sysmacros.h> 24847c478bd9Sstevel@tonic-gate # define HASUNAME 1 /* use System V uname(2) system call */ 24857c478bd9Sstevel@tonic-gate # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 24867c478bd9Sstevel@tonic-gate # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 24877c478bd9Sstevel@tonic-gate # ifndef HASULIMIT 24887c478bd9Sstevel@tonic-gate # define HASULIMIT 1 /* has the ulimit(2) syscall */ 24897c478bd9Sstevel@tonic-gate # endif /* ! HASULIMIT */ 24907c478bd9Sstevel@tonic-gate # ifndef LA_TYPE 24917c478bd9Sstevel@tonic-gate # ifdef MIOC_READKSYM 24927c478bd9Sstevel@tonic-gate # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ 24937c478bd9Sstevel@tonic-gate # else /* MIOC_READKSYM */ 24947c478bd9Sstevel@tonic-gate # define LA_TYPE LA_INT /* assume integer load average */ 24957c478bd9Sstevel@tonic-gate # endif /* MIOC_READKSYM */ 24967c478bd9Sstevel@tonic-gate # endif /* ! LA_TYPE */ 24977c478bd9Sstevel@tonic-gate # ifndef SFS_TYPE 24987c478bd9Sstevel@tonic-gate # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 24997c478bd9Sstevel@tonic-gate # endif /* ! SFS_TYPE */ 25007c478bd9Sstevel@tonic-gate # ifndef TZ_TYPE 25017c478bd9Sstevel@tonic-gate # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 25027c478bd9Sstevel@tonic-gate # endif /* ! TZ_TYPE */ 25037c478bd9Sstevel@tonic-gate # endif /* SYSTEM5 */ 25047c478bd9Sstevel@tonic-gate 25057c478bd9Sstevel@tonic-gate /* general POSIX defines */ 25067c478bd9Sstevel@tonic-gate # ifdef _POSIX_VERSION 25077c478bd9Sstevel@tonic-gate # define HASSETSID 1 /* has POSIX setsid(2) call */ 25087c478bd9Sstevel@tonic-gate # define HASWAITPID 1 /* has POSIX waitpid(2) call */ 25097c478bd9Sstevel@tonic-gate # if _POSIX_VERSION >= 199500 && !defined(USESETEUID) 25107c478bd9Sstevel@tonic-gate # define USESETEUID 1 /* has usable seteuid(2) call */ 25117c478bd9Sstevel@tonic-gate # endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */ 25127c478bd9Sstevel@tonic-gate # endif /* _POSIX_VERSION */ 25137c478bd9Sstevel@tonic-gate /* 25147c478bd9Sstevel@tonic-gate ** Tweaking for systems that (for example) claim to be BSD or POSIX 25157c478bd9Sstevel@tonic-gate ** but don't have all the standard BSD or POSIX routines (boo hiss). 25167c478bd9Sstevel@tonic-gate */ 25177c478bd9Sstevel@tonic-gate 25187c478bd9Sstevel@tonic-gate # ifdef titan 25197c478bd9Sstevel@tonic-gate # undef HASINITGROUPS /* doesn't have initgroups(3) call */ 25207c478bd9Sstevel@tonic-gate # endif /* titan */ 25217c478bd9Sstevel@tonic-gate 25227c478bd9Sstevel@tonic-gate # ifdef _CRAYCOM 25237c478bd9Sstevel@tonic-gate # undef HASSETSID /* despite POSIX claim, doesn't have setsid */ 25247c478bd9Sstevel@tonic-gate # endif /* _CRAYCOM */ 25257c478bd9Sstevel@tonic-gate 25267c478bd9Sstevel@tonic-gate # ifdef MOTO 25277c478bd9Sstevel@tonic-gate # undef USESETEUID 25287c478bd9Sstevel@tonic-gate # endif /* MOTO */ 25297c478bd9Sstevel@tonic-gate 25307c478bd9Sstevel@tonic-gate /* 25317c478bd9Sstevel@tonic-gate ** Due to a "feature" in some operating systems such as Ultrix 4.3 and 25327c478bd9Sstevel@tonic-gate ** HPUX 8.0, if you receive a "No route to host" message (ICMP message 25337c478bd9Sstevel@tonic-gate ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 25347c478bd9Sstevel@tonic-gate ** are closed. Some firewalls return this error if you try to connect 25357c478bd9Sstevel@tonic-gate ** to the IDENT port (113), so you can't receive email from these hosts 25367c478bd9Sstevel@tonic-gate ** on these systems. The firewall really should use a more specific 25377c478bd9Sstevel@tonic-gate ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB. If 25387c478bd9Sstevel@tonic-gate ** not explicitly set to zero above, default it on. 25397c478bd9Sstevel@tonic-gate */ 25407c478bd9Sstevel@tonic-gate 25417c478bd9Sstevel@tonic-gate # ifndef IDENTPROTO 25427c478bd9Sstevel@tonic-gate # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 25437c478bd9Sstevel@tonic-gate # endif /* ! IDENTPROTO */ 25447c478bd9Sstevel@tonic-gate 25457c478bd9Sstevel@tonic-gate # ifndef IP_SRCROUTE 25467c478bd9Sstevel@tonic-gate # define IP_SRCROUTE 1 /* Detect IP source routing */ 25477c478bd9Sstevel@tonic-gate # endif /* ! IP_SRCROUTE */ 25487c478bd9Sstevel@tonic-gate 25497c478bd9Sstevel@tonic-gate # ifndef HASGETUSERSHELL 25507c478bd9Sstevel@tonic-gate # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 25517c478bd9Sstevel@tonic-gate # endif /* ! HASGETUSERSHELL */ 25527c478bd9Sstevel@tonic-gate 25537c478bd9Sstevel@tonic-gate # ifndef NETUNIX 25547c478bd9Sstevel@tonic-gate # define NETUNIX 1 /* include unix domain support */ 25557c478bd9Sstevel@tonic-gate # endif /* ! NETUNIX */ 25567c478bd9Sstevel@tonic-gate 25577c478bd9Sstevel@tonic-gate # ifndef HASRANDOM 25587c478bd9Sstevel@tonic-gate # define HASRANDOM 1 /* has random(3) support */ 25597c478bd9Sstevel@tonic-gate # endif /* ! HASRANDOM */ 25607c478bd9Sstevel@tonic-gate 25617c478bd9Sstevel@tonic-gate # ifndef HASFLOCK 25627c478bd9Sstevel@tonic-gate # define HASFLOCK 0 /* assume no flock(2) support */ 25637c478bd9Sstevel@tonic-gate # endif /* ! HASFLOCK */ 25647c478bd9Sstevel@tonic-gate 25657c478bd9Sstevel@tonic-gate # ifndef HASSETREUID 25667c478bd9Sstevel@tonic-gate # define HASSETREUID 0 /* assume no setreuid(2) call */ 25677c478bd9Sstevel@tonic-gate # endif /* ! HASSETREUID */ 25687c478bd9Sstevel@tonic-gate 25697c478bd9Sstevel@tonic-gate # ifndef HASFCHMOD 25707c478bd9Sstevel@tonic-gate # define HASFCHMOD 0 /* assume no fchmod(2) syscall */ 25717c478bd9Sstevel@tonic-gate # endif /* ! HASFCHMOD */ 25727c478bd9Sstevel@tonic-gate 25737c478bd9Sstevel@tonic-gate # ifndef USESETEUID 25747c478bd9Sstevel@tonic-gate # define USESETEUID 0 /* assume no seteuid(2) call or no saved ids */ 25757c478bd9Sstevel@tonic-gate # endif /* ! USESETEUID */ 25767c478bd9Sstevel@tonic-gate 25777c478bd9Sstevel@tonic-gate # ifndef HASSETRLIMIT 25787c478bd9Sstevel@tonic-gate # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */ 25797c478bd9Sstevel@tonic-gate # endif /* ! HASSETRLIMIT */ 25807c478bd9Sstevel@tonic-gate 25817c478bd9Sstevel@tonic-gate # ifndef HASULIMIT 25827c478bd9Sstevel@tonic-gate # define HASULIMIT 0 /* assume no ulimit(2) support */ 25837c478bd9Sstevel@tonic-gate # endif /* ! HASULIMIT */ 25847c478bd9Sstevel@tonic-gate 25857c478bd9Sstevel@tonic-gate # ifndef SECUREWARE 25867c478bd9Sstevel@tonic-gate # define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */ 25877c478bd9Sstevel@tonic-gate # endif /* ! SECUREWARE */ 25887c478bd9Sstevel@tonic-gate 25897c478bd9Sstevel@tonic-gate # ifndef USE_DOUBLE_FORK 25907c478bd9Sstevel@tonic-gate # define USE_DOUBLE_FORK 1 /* avoid intermediate zombies */ 25917c478bd9Sstevel@tonic-gate # endif /* ! USE_DOUBLE_FORK */ 25927c478bd9Sstevel@tonic-gate 25937c478bd9Sstevel@tonic-gate # ifndef USE_ENVIRON 25947c478bd9Sstevel@tonic-gate # define USE_ENVIRON 0 /* use main() envp instead of extern environ */ 25957c478bd9Sstevel@tonic-gate # endif /* ! USE_ENVIRON */ 25967c478bd9Sstevel@tonic-gate 25977c478bd9Sstevel@tonic-gate # ifndef USE_SIGLONGJMP 25987c478bd9Sstevel@tonic-gate # define USE_SIGLONGJMP 0 /* assume setjmp handles signals properly */ 25997c478bd9Sstevel@tonic-gate # endif /* ! USE_SIGLONGJMP */ 26007c478bd9Sstevel@tonic-gate 26017c478bd9Sstevel@tonic-gate # ifndef FDSET_CAST 26027c478bd9Sstevel@tonic-gate # define FDSET_CAST /* (empty) cast for fd_set arg to select */ 26037c478bd9Sstevel@tonic-gate # endif /* ! FDSET_CAST */ 26047c478bd9Sstevel@tonic-gate 26057c478bd9Sstevel@tonic-gate /* 26067c478bd9Sstevel@tonic-gate ** Pick a mailer setuid method for changing the current uid 26077c478bd9Sstevel@tonic-gate */ 26087c478bd9Sstevel@tonic-gate 26097c478bd9Sstevel@tonic-gate # define USE_SETEUID 0 26107c478bd9Sstevel@tonic-gate # define USE_SETREUID 1 26117c478bd9Sstevel@tonic-gate # define USE_SETUID 2 26127c478bd9Sstevel@tonic-gate 26137c478bd9Sstevel@tonic-gate # if USESETEUID 26147c478bd9Sstevel@tonic-gate # define MAILER_SETUID_METHOD USE_SETEUID 26157c478bd9Sstevel@tonic-gate # else /* USESETEUID */ 26167c478bd9Sstevel@tonic-gate # if HASSETREUID 26177c478bd9Sstevel@tonic-gate # define MAILER_SETUID_METHOD USE_SETREUID 26187c478bd9Sstevel@tonic-gate # else /* HASSETREUID */ 26197c478bd9Sstevel@tonic-gate # define MAILER_SETUID_METHOD USE_SETUID 26207c478bd9Sstevel@tonic-gate # endif /* HASSETREUID */ 26217c478bd9Sstevel@tonic-gate # endif /* USESETEUID */ 26227c478bd9Sstevel@tonic-gate 26237c478bd9Sstevel@tonic-gate /* 26247c478bd9Sstevel@tonic-gate ** If no type for argument two of getgroups call is defined, assume 26257c478bd9Sstevel@tonic-gate ** it's an integer -- unfortunately, there seem to be several choices 26267c478bd9Sstevel@tonic-gate ** here. 26277c478bd9Sstevel@tonic-gate */ 26287c478bd9Sstevel@tonic-gate 26297c478bd9Sstevel@tonic-gate # ifndef GIDSET_T 26307c478bd9Sstevel@tonic-gate # define GIDSET_T int 26317c478bd9Sstevel@tonic-gate # endif /* ! GIDSET_T */ 26327c478bd9Sstevel@tonic-gate 26337c478bd9Sstevel@tonic-gate # ifndef UID_T 26347c478bd9Sstevel@tonic-gate # define UID_T uid_t 26357c478bd9Sstevel@tonic-gate # endif /* ! UID_T */ 26367c478bd9Sstevel@tonic-gate 26377c478bd9Sstevel@tonic-gate # ifndef GID_T 26387c478bd9Sstevel@tonic-gate # define GID_T gid_t 26397c478bd9Sstevel@tonic-gate # endif /* ! GID_T */ 26407c478bd9Sstevel@tonic-gate 26417c478bd9Sstevel@tonic-gate # ifndef MODE_T 26427c478bd9Sstevel@tonic-gate # define MODE_T mode_t 26437c478bd9Sstevel@tonic-gate # endif /* ! MODE_T */ 26447c478bd9Sstevel@tonic-gate 26457c478bd9Sstevel@tonic-gate # ifndef ARGV_T 26467c478bd9Sstevel@tonic-gate # define ARGV_T char ** 26477c478bd9Sstevel@tonic-gate # endif /* ! ARGV_T */ 26487c478bd9Sstevel@tonic-gate 26497c478bd9Sstevel@tonic-gate # ifndef SOCKADDR_LEN_T 26507c478bd9Sstevel@tonic-gate # define SOCKADDR_LEN_T int 26517c478bd9Sstevel@tonic-gate # endif /* ! SOCKADDR_LEN_T */ 26527c478bd9Sstevel@tonic-gate 26537c478bd9Sstevel@tonic-gate # ifndef SOCKOPT_LEN_T 26547c478bd9Sstevel@tonic-gate # define SOCKOPT_LEN_T int 26557c478bd9Sstevel@tonic-gate # endif /* ! SOCKOPT_LEN_T */ 26567c478bd9Sstevel@tonic-gate 26577c478bd9Sstevel@tonic-gate # ifndef QUAD_T 26587c478bd9Sstevel@tonic-gate # define QUAD_T unsigned long 26597c478bd9Sstevel@tonic-gate # endif /* ! QUAD_T */ 26607c478bd9Sstevel@tonic-gate /********************************************************************** 26617c478bd9Sstevel@tonic-gate ** Remaining definitions should never have to be changed. They are 26627c478bd9Sstevel@tonic-gate ** primarily to provide back compatibility for older systems -- for 26637c478bd9Sstevel@tonic-gate ** example, it includes some POSIX compatibility definitions 26647c478bd9Sstevel@tonic-gate **********************************************************************/ 26657c478bd9Sstevel@tonic-gate 26667c478bd9Sstevel@tonic-gate /* System 5 compatibility */ 26677c478bd9Sstevel@tonic-gate # ifndef S_ISREG 26687c478bd9Sstevel@tonic-gate # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 26697c478bd9Sstevel@tonic-gate # endif /* ! S_ISREG */ 26707c478bd9Sstevel@tonic-gate # ifndef S_ISDIR 26717c478bd9Sstevel@tonic-gate # define S_ISDIR(foo) ((foo & S_IFMT) == S_IFDIR) 26727c478bd9Sstevel@tonic-gate # endif /* ! S_ISDIR */ 26737c478bd9Sstevel@tonic-gate # if !defined(S_ISLNK) && defined(S_IFLNK) 26747c478bd9Sstevel@tonic-gate # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 26757c478bd9Sstevel@tonic-gate # endif /* !defined(S_ISLNK) && defined(S_IFLNK) */ 26767c478bd9Sstevel@tonic-gate # if !defined(S_ISFIFO) 26777c478bd9Sstevel@tonic-gate # if defined(S_IFIFO) 26787c478bd9Sstevel@tonic-gate # define S_ISFIFO(foo) ((foo & S_IFMT) == S_IFIFO) 26797c478bd9Sstevel@tonic-gate # else /* defined(S_IFIFO) */ 26807c478bd9Sstevel@tonic-gate # define S_ISFIFO(foo) false 26817c478bd9Sstevel@tonic-gate # endif /* defined(S_IFIFO) */ 26827c478bd9Sstevel@tonic-gate # endif /* !defined(S_ISFIFO) */ 26837c478bd9Sstevel@tonic-gate # ifndef S_IRUSR 26847c478bd9Sstevel@tonic-gate # define S_IRUSR 0400 26857c478bd9Sstevel@tonic-gate # endif /* ! S_IRUSR */ 26867c478bd9Sstevel@tonic-gate # ifndef S_IWUSR 26877c478bd9Sstevel@tonic-gate # define S_IWUSR 0200 26887c478bd9Sstevel@tonic-gate # endif /* ! S_IWUSR */ 26897c478bd9Sstevel@tonic-gate # ifndef S_IRGRP 26907c478bd9Sstevel@tonic-gate # define S_IRGRP 0040 26917c478bd9Sstevel@tonic-gate # endif /* ! S_IRGRP */ 26927c478bd9Sstevel@tonic-gate # ifndef S_IWGRP 26937c478bd9Sstevel@tonic-gate # define S_IWGRP 0020 26947c478bd9Sstevel@tonic-gate # endif /* ! S_IWGRP */ 26957c478bd9Sstevel@tonic-gate # ifndef S_IROTH 26967c478bd9Sstevel@tonic-gate # define S_IROTH 0004 26977c478bd9Sstevel@tonic-gate # endif /* ! S_IROTH */ 26987c478bd9Sstevel@tonic-gate # ifndef S_IWOTH 26997c478bd9Sstevel@tonic-gate # define S_IWOTH 0002 27007c478bd9Sstevel@tonic-gate # endif /* ! S_IWOTH */ 27017c478bd9Sstevel@tonic-gate 27027c478bd9Sstevel@tonic-gate /* close-on-exec flag */ 27037c478bd9Sstevel@tonic-gate # ifndef FD_CLOEXEC 27047c478bd9Sstevel@tonic-gate # define FD_CLOEXEC 1 27057c478bd9Sstevel@tonic-gate # endif /* ! FD_CLOEXEC */ 27067c478bd9Sstevel@tonic-gate 27077c478bd9Sstevel@tonic-gate /* 27087c478bd9Sstevel@tonic-gate ** Older systems don't have this error code -- it should be in 27097c478bd9Sstevel@tonic-gate ** /usr/include/sysexits.h. 27107c478bd9Sstevel@tonic-gate */ 27117c478bd9Sstevel@tonic-gate 27127c478bd9Sstevel@tonic-gate # ifndef EX_CONFIG 27137c478bd9Sstevel@tonic-gate # define EX_CONFIG 78 /* configuration error */ 27147c478bd9Sstevel@tonic-gate # endif /* ! EX_CONFIG */ 27157c478bd9Sstevel@tonic-gate 27167c478bd9Sstevel@tonic-gate /* pseudo-codes */ 27177c478bd9Sstevel@tonic-gate # define EX_QUIT 22 /* drop out of server immediately */ 27187c478bd9Sstevel@tonic-gate # define EX_RESTART 23 /* restart sendmail daemon */ 27197c478bd9Sstevel@tonic-gate # define EX_SHUTDOWN 24 /* shutdown sendmail daemon */ 27207c478bd9Sstevel@tonic-gate 27217c478bd9Sstevel@tonic-gate #ifndef EX_NOTFOUND 27227c478bd9Sstevel@tonic-gate # define EX_NOTFOUND EX_NOHOST 27237c478bd9Sstevel@tonic-gate #endif /* ! EX_NOTFOUND */ 27247c478bd9Sstevel@tonic-gate 27257c478bd9Sstevel@tonic-gate /* pseudo-code used for mci_setstat */ 27267c478bd9Sstevel@tonic-gate # define EX_NOTSTICKY (-5) /* don't save persistent status */ 27277c478bd9Sstevel@tonic-gate 27287c478bd9Sstevel@tonic-gate 27297c478bd9Sstevel@tonic-gate /* 27307c478bd9Sstevel@tonic-gate ** An "impossible" file mode to indicate that the file does not exist. 27317c478bd9Sstevel@tonic-gate */ 27327c478bd9Sstevel@tonic-gate 27337c478bd9Sstevel@tonic-gate # define ST_MODE_NOFILE 0171147 /* unlikely to occur */ 27347c478bd9Sstevel@tonic-gate 27357c478bd9Sstevel@tonic-gate 27367c478bd9Sstevel@tonic-gate /* type of arbitrary pointer */ 27377c478bd9Sstevel@tonic-gate # ifndef ARBPTR_T 27387c478bd9Sstevel@tonic-gate # define ARBPTR_T void * 27397c478bd9Sstevel@tonic-gate # endif /* ! ARBPTR_T */ 27407c478bd9Sstevel@tonic-gate 27417c478bd9Sstevel@tonic-gate # ifndef __P 27427c478bd9Sstevel@tonic-gate # include "sm/cdefs.h" 27437c478bd9Sstevel@tonic-gate # endif /* ! __P */ 27447c478bd9Sstevel@tonic-gate 27457c478bd9Sstevel@tonic-gate # if HESIOD && !defined(NAMED_BIND) 27467c478bd9Sstevel@tonic-gate # define NAMED_BIND 1 /* not one without the other */ 27477c478bd9Sstevel@tonic-gate # endif /* HESIOD && !defined(NAMED_BIND) */ 27487c478bd9Sstevel@tonic-gate 27497c478bd9Sstevel@tonic-gate # if NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) 27507c478bd9Sstevel@tonic-gate extern int h_errno; 27517c478bd9Sstevel@tonic-gate # endif /* NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) */ 27527c478bd9Sstevel@tonic-gate 27537c478bd9Sstevel@tonic-gate # if NEEDPUTENV 27547c478bd9Sstevel@tonic-gate extern int putenv __P((char *)); 27557c478bd9Sstevel@tonic-gate # endif /* NEEDPUTENV */ 27567c478bd9Sstevel@tonic-gate 27577c478bd9Sstevel@tonic-gate #if !HASUNSETENV 27587c478bd9Sstevel@tonic-gate extern void unsetenv __P((char *)); 27597c478bd9Sstevel@tonic-gate #endif /* !HASUNSETENV */ 27607c478bd9Sstevel@tonic-gate 27617c478bd9Sstevel@tonic-gate # ifdef LDAPMAP 27627c478bd9Sstevel@tonic-gate # include <sys/time.h> 27637c478bd9Sstevel@tonic-gate # include <lber.h> 27647c478bd9Sstevel@tonic-gate # include <ldap.h> 27657c478bd9Sstevel@tonic-gate 27667c478bd9Sstevel@tonic-gate /* Some LDAP constants */ 27677c478bd9Sstevel@tonic-gate # define LDAPMAP_FALSE 0 27687c478bd9Sstevel@tonic-gate # define LDAPMAP_TRUE 1 27697c478bd9Sstevel@tonic-gate 27707c478bd9Sstevel@tonic-gate /* 27717c478bd9Sstevel@tonic-gate ** ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1. 27727c478bd9Sstevel@tonic-gate ** Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations 27737c478bd9Sstevel@tonic-gate ** and assume (falsely) that all old API implementations are broken. 27747c478bd9Sstevel@tonic-gate ** (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT) 27757c478bd9Sstevel@tonic-gate */ 27767c478bd9Sstevel@tonic-gate 27777c478bd9Sstevel@tonic-gate # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) 27787c478bd9Sstevel@tonic-gate # define USE_LDAP_INIT 1 27797c478bd9Sstevel@tonic-gate # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) */ 27807c478bd9Sstevel@tonic-gate 27817c478bd9Sstevel@tonic-gate /* 27827c478bd9Sstevel@tonic-gate ** LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x, 27837c478bd9Sstevel@tonic-gate ** hence ldap_set_option() must not exist. 27847c478bd9Sstevel@tonic-gate */ 27857c478bd9Sstevel@tonic-gate 27867c478bd9Sstevel@tonic-gate # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) 27877c478bd9Sstevel@tonic-gate # define USE_LDAP_SET_OPTION 1 27887c478bd9Sstevel@tonic-gate # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) */ 27897c478bd9Sstevel@tonic-gate 27907c478bd9Sstevel@tonic-gate # endif /* LDAPMAP */ 27917c478bd9Sstevel@tonic-gate 27927c478bd9Sstevel@tonic-gate # if HASUNAME 27937c478bd9Sstevel@tonic-gate # include <sys/utsname.h> 27947c478bd9Sstevel@tonic-gate # ifdef newstr 27957c478bd9Sstevel@tonic-gate # undef newstr 27967c478bd9Sstevel@tonic-gate # endif /* newstr */ 27977c478bd9Sstevel@tonic-gate # else /* HASUNAME */ 27987c478bd9Sstevel@tonic-gate # define NODE_LENGTH 32 27997c478bd9Sstevel@tonic-gate struct utsname 28007c478bd9Sstevel@tonic-gate { 28017c478bd9Sstevel@tonic-gate char nodename[NODE_LENGTH + 1]; 28027c478bd9Sstevel@tonic-gate }; 28037c478bd9Sstevel@tonic-gate # endif /* HASUNAME */ 28047c478bd9Sstevel@tonic-gate 28057c478bd9Sstevel@tonic-gate # if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) 28067c478bd9Sstevel@tonic-gate # define MAXHOSTNAMELEN 256 28077c478bd9Sstevel@tonic-gate # endif /* !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) */ 28087c478bd9Sstevel@tonic-gate 28097c478bd9Sstevel@tonic-gate # if !defined(SIGCHLD) && defined(SIGCLD) 28107c478bd9Sstevel@tonic-gate # define SIGCHLD SIGCLD 28117c478bd9Sstevel@tonic-gate # endif /* !defined(SIGCHLD) && defined(SIGCLD) */ 28127c478bd9Sstevel@tonic-gate 28137c478bd9Sstevel@tonic-gate # ifndef STDIN_FILENO 28147c478bd9Sstevel@tonic-gate # define STDIN_FILENO 0 28157c478bd9Sstevel@tonic-gate # endif /* ! STDIN_FILENO */ 28167c478bd9Sstevel@tonic-gate 28177c478bd9Sstevel@tonic-gate # ifndef STDOUT_FILENO 28187c478bd9Sstevel@tonic-gate # define STDOUT_FILENO 1 28197c478bd9Sstevel@tonic-gate # endif /* ! STDOUT_FILENO */ 28207c478bd9Sstevel@tonic-gate 28217c478bd9Sstevel@tonic-gate # ifndef STDERR_FILENO 28227c478bd9Sstevel@tonic-gate # define STDERR_FILENO 2 28237c478bd9Sstevel@tonic-gate # endif /* ! STDERR_FILENO */ 28247c478bd9Sstevel@tonic-gate 28257c478bd9Sstevel@tonic-gate # ifndef LOCK_SH 28267c478bd9Sstevel@tonic-gate # define LOCK_SH 0x01 /* shared lock */ 28277c478bd9Sstevel@tonic-gate # define LOCK_EX 0x02 /* exclusive lock */ 28287c478bd9Sstevel@tonic-gate # define LOCK_NB 0x04 /* non-blocking lock */ 28297c478bd9Sstevel@tonic-gate # define LOCK_UN 0x08 /* unlock */ 28307c478bd9Sstevel@tonic-gate # endif /* ! LOCK_SH */ 28317c478bd9Sstevel@tonic-gate 28327c478bd9Sstevel@tonic-gate # ifndef S_IXOTH 28337c478bd9Sstevel@tonic-gate # define S_IXOTH (S_IEXEC >> 6) 28347c478bd9Sstevel@tonic-gate # endif /* ! S_IXOTH */ 28357c478bd9Sstevel@tonic-gate 28367c478bd9Sstevel@tonic-gate # ifndef S_IXGRP 28377c478bd9Sstevel@tonic-gate # define S_IXGRP (S_IEXEC >> 3) 28387c478bd9Sstevel@tonic-gate # endif /* ! S_IXGRP */ 28397c478bd9Sstevel@tonic-gate 28407c478bd9Sstevel@tonic-gate # ifndef S_IXUSR 28417c478bd9Sstevel@tonic-gate # define S_IXUSR (S_IEXEC) 28427c478bd9Sstevel@tonic-gate # endif /* ! S_IXUSR */ 28437c478bd9Sstevel@tonic-gate 28447c478bd9Sstevel@tonic-gate #ifndef O_ACCMODE 28457c478bd9Sstevel@tonic-gate # define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) 28467c478bd9Sstevel@tonic-gate #endif /* ! O_ACCMODE */ 28477c478bd9Sstevel@tonic-gate 28487c478bd9Sstevel@tonic-gate # ifndef SEEK_SET 28497c478bd9Sstevel@tonic-gate # define SEEK_SET 0 28507c478bd9Sstevel@tonic-gate # define SEEK_CUR 1 28517c478bd9Sstevel@tonic-gate # define SEEK_END 2 28527c478bd9Sstevel@tonic-gate # endif /* ! SEEK_SET */ 28537c478bd9Sstevel@tonic-gate 28547c478bd9Sstevel@tonic-gate # ifndef SIG_ERR 28557c478bd9Sstevel@tonic-gate # define SIG_ERR ((void (*)()) -1) 28567c478bd9Sstevel@tonic-gate # endif /* ! SIG_ERR */ 28577c478bd9Sstevel@tonic-gate 28587c478bd9Sstevel@tonic-gate # ifndef WEXITSTATUS 28597c478bd9Sstevel@tonic-gate # define WEXITSTATUS(st) (((st) >> 8) & 0377) 28607c478bd9Sstevel@tonic-gate # endif /* ! WEXITSTATUS */ 28617c478bd9Sstevel@tonic-gate # ifndef WIFEXITED 28627c478bd9Sstevel@tonic-gate # define WIFEXITED(st) (((st) & 0377) == 0) 28637c478bd9Sstevel@tonic-gate # endif /* ! WIFEXITED */ 28647c478bd9Sstevel@tonic-gate # ifndef WIFSTOPPED 28657c478bd9Sstevel@tonic-gate # define WIFSTOPPED(st) (((st) & 0100) == 0) 28667c478bd9Sstevel@tonic-gate # endif /* ! WIFSTOPPED */ 28677c478bd9Sstevel@tonic-gate # ifndef WCOREDUMP 28687c478bd9Sstevel@tonic-gate # define WCOREDUMP(st) (((st) & 0200) != 0) 28697c478bd9Sstevel@tonic-gate # endif /* ! WCOREDUMP */ 28707c478bd9Sstevel@tonic-gate # ifndef WTERMSIG 28717c478bd9Sstevel@tonic-gate # define WTERMSIG(st) (((st) & 0177)) 28727c478bd9Sstevel@tonic-gate # endif /* ! WTERMSIG */ 28737c478bd9Sstevel@tonic-gate 28747c478bd9Sstevel@tonic-gate # ifndef SIGFUNC_DEFINED 28757c478bd9Sstevel@tonic-gate typedef void (*sigfunc_t) __P((int)); 28767c478bd9Sstevel@tonic-gate # endif /* ! SIGFUNC_DEFINED */ 28777c478bd9Sstevel@tonic-gate # ifndef SIGFUNC_RETURN 28787c478bd9Sstevel@tonic-gate # define SIGFUNC_RETURN 28797c478bd9Sstevel@tonic-gate # endif /* ! SIGFUNC_RETURN */ 28807c478bd9Sstevel@tonic-gate # ifndef SIGFUNC_DECL 28817c478bd9Sstevel@tonic-gate # define SIGFUNC_DECL void 28827c478bd9Sstevel@tonic-gate # endif /* ! SIGFUNC_DECL */ 28837c478bd9Sstevel@tonic-gate 28847c478bd9Sstevel@tonic-gate /* size of syslog buffer */ 28857c478bd9Sstevel@tonic-gate # ifndef SYSLOG_BUFSIZE 28867c478bd9Sstevel@tonic-gate # define SYSLOG_BUFSIZE 1024 28877c478bd9Sstevel@tonic-gate # endif /* ! SYSLOG_BUFSIZE */ 28887c478bd9Sstevel@tonic-gate 28897c478bd9Sstevel@tonic-gate /* for FD_SET() */ 28907c478bd9Sstevel@tonic-gate #ifndef FD_SETSIZE 28917c478bd9Sstevel@tonic-gate # define FD_SETSIZE 256 28927c478bd9Sstevel@tonic-gate #endif /* ! FD_SETSIZE */ 28937c478bd9Sstevel@tonic-gate 28947c478bd9Sstevel@tonic-gate /* 28957c478bd9Sstevel@tonic-gate ** Size of prescan buffer. 28967c478bd9Sstevel@tonic-gate ** Despite comments in the _sendmail_ book, this probably should 28977c478bd9Sstevel@tonic-gate ** not be changed; there are some hard-to-define dependencies. 28987c478bd9Sstevel@tonic-gate */ 28997c478bd9Sstevel@tonic-gate 29007c478bd9Sstevel@tonic-gate # define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 29017c478bd9Sstevel@tonic-gate 29027c478bd9Sstevel@tonic-gate /* fork routine -- set above using #ifdef _osname_ or in Makefile */ 29037c478bd9Sstevel@tonic-gate # ifndef FORK 29047c478bd9Sstevel@tonic-gate # define FORK fork /* function to call to fork mailer */ 29057c478bd9Sstevel@tonic-gate # endif /* ! FORK */ 29067c478bd9Sstevel@tonic-gate 29077c478bd9Sstevel@tonic-gate /* setting h_errno */ 29087c478bd9Sstevel@tonic-gate # ifndef SM_SET_H_ERRNO 29097c478bd9Sstevel@tonic-gate # define SM_SET_H_ERRNO(err) h_errno = (err) 29107c478bd9Sstevel@tonic-gate # endif /* SM_SET_H_ERRNO */ 29117c478bd9Sstevel@tonic-gate 29127c478bd9Sstevel@tonic-gate # ifndef SM_CONF_GETOPT 29137c478bd9Sstevel@tonic-gate # define SM_CONF_GETOPT 1 29147c478bd9Sstevel@tonic-gate # endif /* ! SM_CONF_GETOPT */ 29157c478bd9Sstevel@tonic-gate 29167c478bd9Sstevel@tonic-gate /* random routine -- set above using #ifdef _osname_ or in Makefile */ 29177c478bd9Sstevel@tonic-gate # if HASRANDOM 29187c478bd9Sstevel@tonic-gate # define get_random() random() 29197c478bd9Sstevel@tonic-gate # else /* HASRANDOM */ 29207c478bd9Sstevel@tonic-gate # define get_random() ((long) rand()) 29217c478bd9Sstevel@tonic-gate # ifndef RANDOMSHIFT 29227c478bd9Sstevel@tonic-gate # define RANDOMSHIFT 8 29237c478bd9Sstevel@tonic-gate # endif /* ! RANDOMSHIFT */ 29247c478bd9Sstevel@tonic-gate # endif /* HASRANDOM */ 29257c478bd9Sstevel@tonic-gate 29267c478bd9Sstevel@tonic-gate /* 29277c478bd9Sstevel@tonic-gate ** Default to using scanf in readcf. 29287c478bd9Sstevel@tonic-gate */ 29297c478bd9Sstevel@tonic-gate 29307c478bd9Sstevel@tonic-gate # ifndef SCANF 29317c478bd9Sstevel@tonic-gate # define SCANF 1 29327c478bd9Sstevel@tonic-gate # endif /* ! SCANF */ 29337c478bd9Sstevel@tonic-gate 29347c478bd9Sstevel@tonic-gate /* XXX 32 bit type */ 29357c478bd9Sstevel@tonic-gate # ifndef SM_INT32 29367c478bd9Sstevel@tonic-gate # define SM_INT32 int32_t 29377c478bd9Sstevel@tonic-gate # endif /* ! SM_INT32 */ 29387c478bd9Sstevel@tonic-gate 29397c478bd9Sstevel@tonic-gate /* 29407c478bd9Sstevel@tonic-gate ** SVr4 and similar systems use different routines for setjmp/longjmp 29417c478bd9Sstevel@tonic-gate ** with signal support 29427c478bd9Sstevel@tonic-gate */ 29437c478bd9Sstevel@tonic-gate 29447c478bd9Sstevel@tonic-gate # if USE_SIGLONGJMP 29457c478bd9Sstevel@tonic-gate # ifdef jmp_buf 29467c478bd9Sstevel@tonic-gate # undef jmp_buf 29477c478bd9Sstevel@tonic-gate # endif /* jmp_buf */ 29487c478bd9Sstevel@tonic-gate # define jmp_buf sigjmp_buf 29497c478bd9Sstevel@tonic-gate # ifdef setjmp 29507c478bd9Sstevel@tonic-gate # undef setjmp 29517c478bd9Sstevel@tonic-gate # endif /* setjmp */ 29527c478bd9Sstevel@tonic-gate # define setjmp(env) sigsetjmp(env, 1) 29537c478bd9Sstevel@tonic-gate # ifdef longjmp 29547c478bd9Sstevel@tonic-gate # undef longjmp 29557c478bd9Sstevel@tonic-gate # endif /* longjmp */ 29567c478bd9Sstevel@tonic-gate # define longjmp(env, val) siglongjmp(env, val) 29577c478bd9Sstevel@tonic-gate # endif /* USE_SIGLONGJMP */ 29587c478bd9Sstevel@tonic-gate 29597c478bd9Sstevel@tonic-gate # if !defined(NGROUPS_MAX) && defined(NGROUPS) 29607c478bd9Sstevel@tonic-gate # define NGROUPS_MAX NGROUPS /* POSIX naming convention */ 29617c478bd9Sstevel@tonic-gate # endif /* !defined(NGROUPS_MAX) && defined(NGROUPS) */ 29627c478bd9Sstevel@tonic-gate 29637c478bd9Sstevel@tonic-gate /* 29647c478bd9Sstevel@tonic-gate ** Some snprintf() implementations are rumored not to NUL terminate. 29657c478bd9Sstevel@tonic-gate */ 29667c478bd9Sstevel@tonic-gate # if SNPRINTF_IS_BROKEN 29677c478bd9Sstevel@tonic-gate # ifdef snprintf 29687c478bd9Sstevel@tonic-gate # undef snprintf 29697c478bd9Sstevel@tonic-gate # endif /* snprintf */ 29707c478bd9Sstevel@tonic-gate # define snprintf sm_snprintf 29717c478bd9Sstevel@tonic-gate # ifdef vsnprintf 29727c478bd9Sstevel@tonic-gate # undef vsnprintf 29737c478bd9Sstevel@tonic-gate # endif /* vsnprintf */ 29747c478bd9Sstevel@tonic-gate # define vsnprintf sm_vsnprintf 29757c478bd9Sstevel@tonic-gate # endif /* SNPRINTF_IS_BROKEN */ 29767c478bd9Sstevel@tonic-gate 29777c478bd9Sstevel@tonic-gate /* 29787c478bd9Sstevel@tonic-gate ** If we don't have a system syslog, simulate it. 29797c478bd9Sstevel@tonic-gate */ 29807c478bd9Sstevel@tonic-gate 29817c478bd9Sstevel@tonic-gate # if !LOG 29827c478bd9Sstevel@tonic-gate # define LOG_EMERG 0 /* system is unusable */ 29837c478bd9Sstevel@tonic-gate # define LOG_ALERT 1 /* action must be taken immediately */ 29847c478bd9Sstevel@tonic-gate # define LOG_CRIT 2 /* critical conditions */ 29857c478bd9Sstevel@tonic-gate # define LOG_ERR 3 /* error conditions */ 29867c478bd9Sstevel@tonic-gate # define LOG_WARNING 4 /* warning conditions */ 29877c478bd9Sstevel@tonic-gate # define LOG_NOTICE 5 /* normal but significant condition */ 29887c478bd9Sstevel@tonic-gate # define LOG_INFO 6 /* informational */ 29897c478bd9Sstevel@tonic-gate # define LOG_DEBUG 7 /* debug-level messages */ 29907c478bd9Sstevel@tonic-gate # endif /* !LOG */ 29917c478bd9Sstevel@tonic-gate 29927c478bd9Sstevel@tonic-gate # ifndef SM_CONF_SYSLOG 29937c478bd9Sstevel@tonic-gate # define SM_CONF_SYSLOG 1 /* syslog.h has prototype for syslog() */ 29947c478bd9Sstevel@tonic-gate # endif /* SM_CONF_SYSLOG */ 29957c478bd9Sstevel@tonic-gate 29967c478bd9Sstevel@tonic-gate # if !SM_CONF_SYSLOG 29977c478bd9Sstevel@tonic-gate # ifdef __STDC__ 29987c478bd9Sstevel@tonic-gate extern void syslog(int, const char *, ...); 29997c478bd9Sstevel@tonic-gate # else /* __STDC__ */ 30007c478bd9Sstevel@tonic-gate extern void syslog(); 30017c478bd9Sstevel@tonic-gate # endif /* __STDC__ */ 30027c478bd9Sstevel@tonic-gate # endif /* !SM_CONF_SYSLOG */ 30037c478bd9Sstevel@tonic-gate 30047c478bd9Sstevel@tonic-gate /* portable(?) definition for alignment */ 30057c478bd9Sstevel@tonic-gate # ifndef SM_ALIGN_SIZE 30067c478bd9Sstevel@tonic-gate struct sm_align 30077c478bd9Sstevel@tonic-gate { 30087c478bd9Sstevel@tonic-gate char al_c; 30097c478bd9Sstevel@tonic-gate union 30107c478bd9Sstevel@tonic-gate { 30117c478bd9Sstevel@tonic-gate long al_l; 30127c478bd9Sstevel@tonic-gate void *al_p; 30137c478bd9Sstevel@tonic-gate double al_d; 30147c478bd9Sstevel@tonic-gate void (*al_f) __P((void)); 30157c478bd9Sstevel@tonic-gate } al_u; 30167c478bd9Sstevel@tonic-gate }; 30177c478bd9Sstevel@tonic-gate # define SM_ALIGN_SIZE offsetof(struct sm_align, al_u) 30187c478bd9Sstevel@tonic-gate # endif /* ! SM_ALIGN_SIZE */ 30197c478bd9Sstevel@tonic-gate # define SM_ALIGN_BITS (SM_ALIGN_SIZE - 1) 30207c478bd9Sstevel@tonic-gate 30217c478bd9Sstevel@tonic-gate #endif /* ! SM_CONF_H */ 3022