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