conf.h revision 266527
190792Sgshapiro/* 2261194Sgshapiro * Copyright (c) 1998-2011 Proofpoint, Inc. and its suppliers. 390792Sgshapiro * All rights reserved. 490792Sgshapiro * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. 590792Sgshapiro * Copyright (c) 1988, 1993 690792Sgshapiro * The Regents of the University of California. All rights reserved. 790792Sgshapiro * 890792Sgshapiro * By using this file, you agree to the terms and conditions set 990792Sgshapiro * forth in the LICENSE file which can be found at the top level of 1090792Sgshapiro * the sendmail distribution. 1190792Sgshapiro * 1290792Sgshapiro * 13266527Sgshapiro * $Id: conf.h,v 1.147 2013-11-22 20:51:31 ca Exp $ 1490792Sgshapiro */ 1590792Sgshapiro 1690792Sgshapiro/* 1790792Sgshapiro** CONF.H -- All user-configurable parameters for sendmail 1890792Sgshapiro** 19168515Sgshapiro** Send updates to Sendmail.ORG so they will be 20168515Sgshapiro** included in the next release; see 21168515Sgshapiro** http://www.sendmail.org/email-addresses.html 22168515Sgshapiro** for current e-mail address. 2390792Sgshapiro*/ 2490792Sgshapiro 2590792Sgshapiro#ifndef SM_CONF_H 2690792Sgshapiro# define SM_CONF_H 1 2790792Sgshapiro 2890792Sgshapiro 2990792Sgshapiro# include <sm/config.h> 3090792Sgshapiro# include <sm/varargs.h> 3190792Sgshapiro 3290792Sgshapiro/* 3390792Sgshapiro** General "standard C" defines. 3490792Sgshapiro** 3590792Sgshapiro** These may be undone later, to cope with systems that claim to 3690792Sgshapiro** be Standard C but aren't. Gcc is the biggest offender -- it 3790792Sgshapiro** doesn't realize that the library is part of the language. 3890792Sgshapiro** 3990792Sgshapiro** Life would be much easier if we could get rid of this sort 4090792Sgshapiro** of bozo problems. 4190792Sgshapiro*/ 4290792Sgshapiro 4390792Sgshapiro# ifdef __STDC__ 4490792Sgshapiro# define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 4590792Sgshapiro# endif /* __STDC__ */ 4690792Sgshapiro 4790792Sgshapiro/* 4890792Sgshapiro** Assume you have standard calls; can be #undefed below if necessary. 4990792Sgshapiro*/ 5090792Sgshapiro 5190792Sgshapiro# ifndef HASLSTAT 5290792Sgshapiro# define HASLSTAT 1 /* has lstat(2) call */ 5390792Sgshapiro# endif /* ! HASLSTAT */ 5490792Sgshapiro 5590792Sgshapiro# ifndef HASNICE 5690792Sgshapiro# define HASNICE 1 /* has nice(2) call */ 5790792Sgshapiro# endif /* ! HASNICE */ 5890792Sgshapiro 5990792Sgshapiro# ifndef HASRRESVPORT 6090792Sgshapiro# define HASRRESVPORT 1 /* has rrsevport(3) call */ 6190792Sgshapiro# endif /* ! HASRRESVPORT */ 6290792Sgshapiro 6390792Sgshapiro/********************************************************************** 6490792Sgshapiro** "Hard" compilation options. 6590792Sgshapiro** #define these if they are available; comment them out otherwise. 6690792Sgshapiro** These cannot be overridden from the Makefile, and should really not 6790792Sgshapiro** be turned off unless absolutely necessary. 6890792Sgshapiro**********************************************************************/ 6990792Sgshapiro 7090792Sgshapiro#define LOG 1 /* enable logging -- don't turn off */ 7190792Sgshapiro 7290792Sgshapiro/********************************************************************** 7390792Sgshapiro** Operating system configuration. 7490792Sgshapiro** 7590792Sgshapiro** Unless you are porting to a new OS, you shouldn't have to 7690792Sgshapiro** change these. 7790792Sgshapiro**********************************************************************/ 7890792Sgshapiro 7990792Sgshapiro/* 8090792Sgshapiro** HP-UX -- tested for 8.07, 9.00, and 9.01. 8190792Sgshapiro** 8290792Sgshapiro** If V4FS is defined, compile for HP-UX 10.0. 8390792Sgshapiro** 11.x support from Richard Allen <ra@hp.is>. 8490792Sgshapiro*/ 8590792Sgshapiro 8690792Sgshapiro# ifdef __hpux 8790792Sgshapiro /* common definitions for HP-UX 9.x and 10.x */ 8890792Sgshapiro# undef m_flags /* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */ 8990792Sgshapiro# define SYSTEM5 1 /* include all the System V defines */ 9090792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 9190792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 9290792Sgshapiro# define USESETEUID 1 /* has usable seteuid(2) call */ 9390792Sgshapiro# define HASSETRESGID 1 /* use setresgid(2) to set saved gid */ 9490792Sgshapiro# define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */ 9590792Sgshapiro# define seteuid(e) setresuid(-1, e, -1) 9690792Sgshapiro# define IP_SRCROUTE 1 /* can check IP source routing */ 9790792Sgshapiro# define LA_TYPE LA_HPUX 9890792Sgshapiro# define SPT_TYPE SPT_PSTAT 9990792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 10090792Sgshapiro# define GIDSET_T gid_t 10190792Sgshapiro# define LDA_USE_LOCKF 1 10290792Sgshapiro# ifndef HASGETUSERSHELL 10390792Sgshapiro# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 10490792Sgshapiro# endif /* ! HASGETUSERSHELL */ 10590792Sgshapiro# ifdef HPUX10 10690792Sgshapiro# define _PATH_SENDMAIL "/usr/sbin/sendmail" 107120256Sgshapiro# ifndef SMRSH_CMDDIR 108120256Sgshapiro# define SMRSH_CMDDIR "/var/adm/sm.bin" 109120256Sgshapiro# endif /* ! SMRSH_CMDDIR */ 11090792Sgshapiro# endif /* HPUX10 */ 11190792Sgshapiro# ifdef HPUX11 11294334Sgshapiro# define HASSETREUID 1 /* setreuid(2) works on HP-UX 11.x */ 11390792Sgshapiro# define HASFCHOWN 1 /* has fchown(2) */ 11490792Sgshapiro# ifndef BROKEN_RES_SEARCH 11590792Sgshapiro# define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 11690792Sgshapiro# endif /* ! BROKEN_RES_SEARCH */ 117120256Sgshapiro# ifndef SMRSH_CMDDIR 118120256Sgshapiro# define SMRSH_CMDDIR "/var/adm/sm.bin" 119120256Sgshapiro# endif /* ! SMRSH_CMDDIR */ 12090792Sgshapiro# define _PATH_SENDMAIL "/usr/sbin/sendmail" 12190792Sgshapiro# else /* HPUX11 */ 12290792Sgshapiro# ifndef NOT_SENDMAIL 12390792Sgshapiro# define syslog hard_syslog 12490792Sgshapiro# endif /* ! NOT_SENDMAIL */ 12590792Sgshapiro# endif /* HPUX11 */ 12690792Sgshapiro# define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 12790792Sgshapiro 12890792Sgshapiro# ifdef V4FS 12990792Sgshapiro /* HP-UX 10.x */ 13090792Sgshapiro# define _PATH_UNIX "/stand/vmunix" 13190792Sgshapiro# ifndef _PATH_VENDOR_CF 13290792Sgshapiro# define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 13390792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 13490792Sgshapiro# ifndef _PATH_SENDMAILPID 13590792Sgshapiro# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 13690792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 13790792Sgshapiro# ifndef IDENTPROTO 13890792Sgshapiro# define IDENTPROTO 1 /* TCP/IP implementation fixed in 10.0 */ 13990792Sgshapiro# endif /* ! IDENTPROTO */ 14090792Sgshapiro# include <sys/mpctl.h> /* for mpctl() in get_num_procs_online() */ 14190792Sgshapiro# else /* V4FS */ 14290792Sgshapiro /* HP-UX 9.x */ 14390792Sgshapiro# define _PATH_UNIX "/hp-ux" 14490792Sgshapiro# ifndef _PATH_VENDOR_CF 14590792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 14690792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 14790792Sgshapiro# ifndef IDENTPROTO 14890792Sgshapiro# define IDENTPROTO 0 /* TCP/IP implementation is broken */ 14990792Sgshapiro# endif /* ! IDENTPROTO */ 15090792Sgshapiro# ifdef __STDC__ 15190792Sgshapiroextern void hard_syslog(int, char *, ...); 15290792Sgshapiro# else /* __STDC__ */ 15390792Sgshapiroextern void hard_syslog(); 15490792Sgshapiro# endif /* __STDC__ */ 15590792Sgshapiro# define FDSET_CAST (int *) /* cast for fd_set parameters to select */ 15690792Sgshapiro# endif /* V4FS */ 15790792Sgshapiro 15890792Sgshapiro# endif /* __hpux */ 15990792Sgshapiro 16090792Sgshapiro/* 16190792Sgshapiro** IBM AIX 5.x 16290792Sgshapiro*/ 16390792Sgshapiro 16490792Sgshapiro# ifdef _AIX5 165168515Sgshapiro# include <sys/signal.h> 166168515Sgshapiro# include <sys/wait.h> 16790792Sgshapiro# define _AIX4 40300 168147078Sgshapiro# define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */ 169147078Sgshapiro# define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */ 170120256Sgshapiro# if _AIX5 >= 50200 171120256Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 172120256Sgshapiro# endif /* _AIX5 >= 50200 */ 17390792Sgshapiro# endif /* _AIX5 */ 17490792Sgshapiro 17590792Sgshapiro/* 17690792Sgshapiro** IBM AIX 4.x 17790792Sgshapiro*/ 17890792Sgshapiro 17990792Sgshapiro# ifdef _AIX4 18090792Sgshapiro# define _AIX3 1 /* pull in AIX3 stuff */ 18190792Sgshapiro# define BSD4_4_SOCKADDR /* has sa_len */ 18290792Sgshapiro# define USESETEUID 1 /* seteuid(2) works */ 18390792Sgshapiro# define TZ_TYPE TZ_NAME /* use tzname[] vector */ 184147078Sgshapiro# ifndef SOCKOPT_LEN_T 185147078Sgshapiro# define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */ 186147078Sgshapiro# endif /* SOCKOPT_LEN_T */ 18790792Sgshapiro# if _AIX4 >= 40200 18890792Sgshapiro# define HASSETREUID 1 /* setreuid(2) works as of AIX 4.2 */ 189147078Sgshapiro# ifndef SOCKADDR_LEN_T 190147078Sgshapiro# define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */ 191147078Sgshapiro# endif /* SOCKADDR_LEN_T */ 19290792Sgshapiro# endif /* _AIX4 >= 40200 */ 19390792Sgshapiro# if defined(_ILS_MACROS) /* IBM versions aren't side-effect clean */ 19490792Sgshapiro# undef isascii 19590792Sgshapiro# define isascii(c) !(c & ~0177) 19690792Sgshapiro# undef isdigit 19790792Sgshapiro# define isdigit(__a) (_IS(__a,_ISDIGIT)) 19890792Sgshapiro# undef isspace 19990792Sgshapiro# define isspace(__a) (_IS(__a,_ISSPACE)) 20090792Sgshapiro# endif /* defined(_ILS_MACROS) */ 20190792Sgshapiro# endif /* _AIX4 */ 20290792Sgshapiro 20390792Sgshapiro 20490792Sgshapiro/* 20590792Sgshapiro** IBM AIX 3.x -- actually tested for 3.2.3 20690792Sgshapiro*/ 20790792Sgshapiro 20890792Sgshapiro# ifdef _AIX3 20990792Sgshapiro# include <paths.h> 21090792Sgshapiro# include <sys/machine.h> /* to get byte order */ 21190792Sgshapiro# include <sys/select.h> 21290792Sgshapiro# define HASFCHOWN 1 /* has fchown(2) */ 21390792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 21490792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 21590792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 21690792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 21790792Sgshapiro# define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 21890792Sgshapiro# define GIDSET_T gid_t 21990792Sgshapiro# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 22090792Sgshapiro# define SPT_PADCHAR '\0' /* pad process title with nulls */ 221147078Sgshapiro# ifndef LA_TYPE 222147078Sgshapiro# define LA_TYPE LA_INT 223147078Sgshapiro# endif /* LA_TYPE */ 22490792Sgshapiro# define FSHIFT 16 22590792Sgshapiro# define LA_AVENRUN "avenrun" 22690792Sgshapiro# if !defined(_AIX4) || _AIX4 < 40300 22790792Sgshapiro# ifndef __BIT_TYPES_DEFINED__ 22890792Sgshapiro# define SM_INT32 int 22990792Sgshapiro# endif /* __BIT_TYPES_DEFINED__ */ 23090792Sgshapiro# endif /* !defined(_AIX4) || _AIX4 < 40300 */ 23190792Sgshapiro# if !defined(_AIX4) || _AIX4 < 40200 23290792Sgshapiro# define SM_CONF_SYSLOG 0 23390792Sgshapiro# endif /* !defined(_AIX4) || _AIX4 < 40200 */ 23490792Sgshapiro# endif /* _AIX3 */ 23590792Sgshapiro 23690792Sgshapiro 23790792Sgshapiro/* 23890792Sgshapiro** IBM AIX 2.2.1 -- actually tested for osupdate level 2706+1773 23990792Sgshapiro** 24090792Sgshapiro** From Mark Whetzel <markw@wg.waii.com>. 24190792Sgshapiro*/ 24290792Sgshapiro 24390792Sgshapiro# ifdef AIX /* AIX/RT compiler pre-defines this */ 24490792Sgshapiro# include <paths.h> 24590792Sgshapiro# include <sys/time.h> /* AIX/RT resource.h does NOT include this */ 24690792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 24790792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 24890792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 24990792Sgshapiro# define HASFCHMOD 0 /* does not have fchmod(2) syscall */ 25090792Sgshapiro# define HASSETREUID 1 /* use setreuid(2) -lbsd system call */ 25190792Sgshapiro# define HASSETVBUF 1 /* use setvbuf(2) system call */ 25290792Sgshapiro# define HASSETRLIMIT 0 /* does not have setrlimit call */ 25390792Sgshapiro# define HASFLOCK 0 /* does not have flock call - use fcntl */ 25490792Sgshapiro# define HASULIMIT 1 /* use ulimit instead of setrlimit call */ 25590792Sgshapiro# define SM_CONF_GETOPT 0 /* Do we need theirs or ours */ 25690792Sgshapiro# define SYS5SETPGRP 1 /* don't have setpgid on AIX/RT */ 25790792Sgshapiro# define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 25890792Sgshapiro# define BSD4_3 1 /* NOT bsd 4.4 or posix signals */ 25990792Sgshapiro# define GIDSET_T int 26090792Sgshapiro# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 26190792Sgshapiro# define SPT_PADCHAR '\0' /* pad process title with nulls */ 26290792Sgshapiro# define LA_TYPE LA_SUBR /* use our ported loadavgd daemon */ 26390792Sgshapiro# define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 26490792Sgshapiro# define ARBPTR_T int * 26590792Sgshapiro# define void int 26690792Sgshapirotypedef int pid_t; 26790792Sgshapiro/* RTisms for BSD compatibility, specified in the Makefile 26890792Sgshapiro define BSD 1 26990792Sgshapiro define BSD_INCLUDES 1 27090792Sgshapiro define BSD_REMAP_SIGNAL_TO_SIGVEC 27190792Sgshapiro RTisms needed above */ 27290792Sgshapiro/* make this sendmail in a completely different place */ 27390792Sgshapiro# ifndef _PATH_VENDOR_CF 27490792Sgshapiro# define _PATH_VENDOR_CF "/usr/local/newmail/sendmail.cf" 27590792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 27690792Sgshapiro# ifndef _PATH_SENDMAILPID 27790792Sgshapiro# define _PATH_SENDMAILPID "/usr/local/newmail/sendmail.pid" 27890792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 27990792Sgshapiro# endif /* AIX */ 28090792Sgshapiro 28190792Sgshapiro# if defined(_AIX) 28290792Sgshapiro# define LDA_USE_LOCKF 1 28390792Sgshapiro# define LDA_USE_SETEUID 1 28490792Sgshapiro# endif /* defined(_AIX) */ 28590792Sgshapiro 28690792Sgshapiro/* 28790792Sgshapiro** Silicon Graphics IRIX 28890792Sgshapiro** 28990792Sgshapiro** Compiles on 4.0.1. 29090792Sgshapiro** 29190792Sgshapiro** Use IRIX64 instead of IRIX for 64-bit IRIX (6.0). 29290792Sgshapiro** Use IRIX5 instead of IRIX for IRIX 5.x. 29390792Sgshapiro** 29490792Sgshapiro** IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>. 29590792Sgshapiro** IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>. 29690792Sgshapiro*/ 29790792Sgshapiro 29890792Sgshapiro# ifdef IRIX 29990792Sgshapiro# define SYSTEM5 1 /* this is a System-V derived system */ 30090792Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 30190792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 30290792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 30390792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 30490792Sgshapiro# define IP_SRCROUTE 1 /* can check IP source routing */ 30590792Sgshapiro# define setpgid BSDsetpgrp 30690792Sgshapiro# define GIDSET_T gid_t 30790792Sgshapiro# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 30890792Sgshapiro# define SFS_BAVAIL f_bfree /* alternate field name */ 30990792Sgshapiro# define SYSLOG_BUFSIZE 512 310110560Sgshapiro# if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) 311110560Sgshapiro /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */ 312110560Sgshapiro# define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN 313110560Sgshapiro# endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */ 31490792Sgshapiro# ifdef IRIX6 31590792Sgshapiro# define STAT64 1 31690792Sgshapiro# define QUAD_T unsigned long long 31790792Sgshapiro# define LA_TYPE LA_IRIX6 /* figure out at run time */ 31890792Sgshapiro# define SAFENFSPATHCONF 0 /* pathconf(2) lies on NFS filesystems */ 31990792Sgshapiro# else /* IRIX6 */ 32090792Sgshapiro# define LA_TYPE LA_INT 32190792Sgshapiro 32290792Sgshapiro# ifdef IRIX64 32390792Sgshapiro# define STAT64 1 32490792Sgshapiro# define QUAD_T unsigned long long 32590792Sgshapiro# define NAMELISTMASK 0x7fffffffffffffff /* mask for nlist() values */ 32690792Sgshapiro# else /* IRIX64 */ 32790792Sgshapiro# define STAT64 0 32890792Sgshapiro# define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ 32990792Sgshapiro# endif /* IRIX64 */ 33090792Sgshapiro# endif /* IRIX6 */ 33190792Sgshapiro# if defined(IRIX64) || defined(IRIX5) || defined(IRIX6) 33290792Sgshapiro# include <sys/cdefs.h> 33390792Sgshapiro# include <paths.h> 33490792Sgshapiro# define ARGV_T char *const * 33590792Sgshapiro# define HASFCHOWN 1 /* has fchown(2) */ 33690792Sgshapiro# define HASSETRLIMIT 1 /* has setrlimit(2) syscall */ 33790792Sgshapiro# define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */ 33890792Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 33990792Sgshapiro# else /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */ 34090792Sgshapiro# define ARGV_T const char ** 34190792Sgshapiro# define WAITUNION 1 /* use "union wait" as wait argument type */ 34290792Sgshapiro# endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */ 34390792Sgshapiro# endif /* IRIX */ 34490792Sgshapiro 34590792Sgshapiro 34690792Sgshapiro/* 34790792Sgshapiro** SunOS and Solaris 34890792Sgshapiro** 34990792Sgshapiro** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and 35090792Sgshapiro** Solaris 2.4 (a.k.a. SunOS 5.4). 35190792Sgshapiro*/ 35290792Sgshapiro 35390792Sgshapiro# if defined(sun) && !defined(BSD) 35490792Sgshapiro 35590792Sgshapiro# include <sys/time.h> 35690792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 35790792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 35890792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 35990792Sgshapiro# define IP_SRCROUTE 1 /* can check IP source routing */ 36090792Sgshapiro# define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 36190792Sgshapiro# ifndef HASFCHOWN 36290792Sgshapiro# define HASFCHOWN 1 /* fchown(2) */ 36390792Sgshapiro# endif /* ! HASFCHOWN */ 36490792Sgshapiro 36590792Sgshapiro# ifdef __svr4__ 36690792Sgshapiro# define LDA_USE_LOCKF 1 36790792Sgshapiro# define LDA_USE_SETEUID 1 36890792Sgshapiro# define _PATH_MAILDIR "/var/mail" 36990792Sgshapiro# endif /* __svr4__ */ 37090792Sgshapiro 37190792Sgshapiro# ifdef SOLARIS_2_3 37290792Sgshapiro# define SOLARIS 20300 /* for back compat only -- use -DSOLARIS=20300 */ 37390792Sgshapiro# endif /* SOLARIS_2_3 */ 37490792Sgshapiro 37590792Sgshapiro# if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) 37690792Sgshapiro# define SOLARIS 1 /* unknown Solaris version */ 37790792Sgshapiro# endif /* defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) */ 37890792Sgshapiro 37990792Sgshapiro# ifdef SOLARIS 38090792Sgshapiro /* Solaris 2.x (a.k.a. SunOS 5.x) */ 38190792Sgshapiro# ifndef __svr4__ 38290792Sgshapiro# define __svr4__ /* use all System V Release 4 defines below */ 38390792Sgshapiro# endif /* ! __svr4__ */ 384223067Sgshapiro# if SOLARIS >= 21100 385223067Sgshapiro# include <paths.h> 386223067Sgshapiro# endif /* SOLARIS >= 21100 */ 387223067Sgshapiro# ifndef _PATH_VARRUN 388223067Sgshapiro# define _PATH_VARRUN "/var/run/" 389223067Sgshapiro# endif /* _PATH_VARRUN */ 39090792Sgshapiro# define GIDSET_T gid_t 39190792Sgshapiro# define USE_SA_SIGACTION 1 /* use sa_sigaction field */ 39290792Sgshapiro# define BROKEN_PTHREAD_SLEEP 1 /* sleep after pthread_create() fails */ 39390792Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 39490792Sgshapiro# ifndef _PATH_UNIX 39590792Sgshapiro# define _PATH_UNIX "/dev/ksyms" 39690792Sgshapiro# endif /* ! _PATH_UNIX */ 39790792Sgshapiro# ifndef _PATH_VENDOR_CF 39890792Sgshapiro# define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 39990792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 40090792Sgshapiro# ifndef _PATH_SENDMAILPID 40190792Sgshapiro# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 40290792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 40390792Sgshapiro# ifndef _PATH_HOSTS 40490792Sgshapiro# define _PATH_HOSTS "/etc/inet/hosts" 40590792Sgshapiro# endif /* ! _PATH_HOSTS */ 40690792Sgshapiro# ifndef SYSLOG_BUFSIZE 40790792Sgshapiro# define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 40890792Sgshapiro# endif /* ! SYSLOG_BUFSIZE */ 40990792Sgshapiro# ifndef TZ_TYPE 41090792Sgshapiro# define TZ_TYPE TZ_TZNAME 41190792Sgshapiro# endif /* ! TZ_TYPE */ 41290792Sgshapiro# if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) 41390792Sgshapiro# define USESETEUID 1 /* seteuid works as of 2.3 */ 41490792Sgshapiro# define LDA_CONTENTLENGTH 1 /* Needs the Content-Length header */ 41590792Sgshapiro# endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */ 41690792Sgshapiro# if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) 41790792Sgshapiro# define HASSETREUID 1 /* setreuid works as of 2.5 */ 41890792Sgshapiro# define HASSETREGID 1 /* use setregid(2) to set saved gid */ 419157001Sgshapiro# if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) 420157001Sgshapiro# define HASSNPRINTF 1 /* has snprintf(3c) starting in 2.6 */ 421157001Sgshapiro# endif /* SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) */ 42290792Sgshapiro# if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) 42390792Sgshapiro# ifndef LA_TYPE 42490792Sgshapiro# define LA_TYPE LA_KSTAT /* use kstat(3k) -- may work in < 2.5 */ 42590792Sgshapiro# endif /* ! LA_TYPE */ 42690792Sgshapiro# ifndef RANDOMSHIFT /* random() doesn't work well (sometimes) */ 42790792Sgshapiro# define RANDOMSHIFT 8 42890792Sgshapiro# endif /* ! RANDOMSHIFT */ 42990792Sgshapiro# endif /* SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) */ 43090792Sgshapiro# else /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */ 43190792Sgshapiro# ifndef HASRANDOM 43290792Sgshapiro# define HASRANDOM 0 /* doesn't have random(3) */ 43390792Sgshapiro# endif /* ! HASRANDOM */ 43490792Sgshapiro# endif /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */ 43590792Sgshapiro# if (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206 43690792Sgshapiro# define SM_INT32 int /* 32bit integer */ 43790792Sgshapiro# endif /* (SOLARIS > 10000 && SOLARIS < 20600) || SOLARIS < 206 */ 43890792Sgshapiro# if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) 43990792Sgshapiro# ifndef LA_TYPE 44090792Sgshapiro# include <sys/loadavg.h> 44190792Sgshapiro# if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) 44290792Sgshapiro# include <sys/pset.h> 44390792Sgshapiro# define LA_TYPE LA_PSET /* pset_getloadavg(3c) appears in 2.9 */ 44490792Sgshapiro# else /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */ 44590792Sgshapiro# define LA_TYPE LA_SUBR /* getloadavg(3c) appears in 2.7 */ 44690792Sgshapiro# endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */ 44790792Sgshapiro# endif /* ! LA_TYPE */ 44890792Sgshapiro# define HASGETUSERSHELL 1 /* getusershell(3c) bug fixed in 2.7 */ 44990792Sgshapiro# endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */ 45090792Sgshapiro# if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) 45190792Sgshapiro# undef _PATH_SENDMAILPID /* tmpfs /var/run added in 2.8 */ 452223067Sgshapiro# define _PATH_SENDMAILPID _PATH_VARRUN "sendmail.pid" 453120256Sgshapiro# ifndef SMRSH_CMDDIR 454120256Sgshapiro# define SMRSH_CMDDIR "/var/adm/sm.bin" 455120256Sgshapiro# endif /* ! SMRSH_CMDDIR */ 45690792Sgshapiro# define SL_FUDGE 34 /* fudge offset for SyslogPrefixLen */ 457168515Sgshapiro# define HASLDAPGETALIASBYNAME 1 /* added in S8 */ 45890792Sgshapiro# endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */ 45990792Sgshapiro# if SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) 46090792Sgshapiro# define HASURANDOMDEV 1 /* /dev/[u]random added in S9 */ 461132943Sgshapiro# define HASCLOSEFROM 1 /* closefrom(3c) added in S9 */ 462132943Sgshapiro# define HASFDWALK 1 /* fdwalk(3c) added in S9 */ 46390792Sgshapiro# endif /* SOLARIS >= 20900 || (SOLARIS < 10000 && SOLARIS >= 209) */ 464125820Sgshapiro# if SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) 465125820Sgshapiro# define HASUNSETENV 1 /* unsetenv() added in S10 */ 466125820Sgshapiro# endif /* SOLARIS >= 21000 || (SOLARIS < 10000 && SOLARIS >= 210) */ 467173340Sgshapiro# if SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) 468173340Sgshapiro# define GETLDAPALIASBYNAME_VERSION 2 /* changed in S11 */ 469203004Sgshapiro# define HAVE_NANOSLEEP 1 /* moved from librt to libc in S11 */ 470223067Sgshapiro# define SOCKADDR_LEN_T socklen_t /* arg#3 to accept, getsockname */ 471223067Sgshapiro# define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */ 472173340Sgshapiro# endif /* SOLARIS >= 21100 || (SOLARIS < 10000 && SOLARIS >= 211) */ 47390792Sgshapiro# ifndef HASGETUSERSHELL 47490792Sgshapiro# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */ 47590792Sgshapiro# endif /* ! HASGETUSERSHELL */ 47690792Sgshapiro 47790792Sgshapiro# else /* SOLARIS */ 47890792Sgshapiro /* SunOS 4.0.3 or 4.1.x */ 47990792Sgshapiro# define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 48090792Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 48190792Sgshapiro# ifndef HASFLOCK 48290792Sgshapiro# define HASFLOCK 1 /* has flock(2) call */ 48390792Sgshapiro# endif /* ! HASFLOCK */ 48490792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 48590792Sgshapiro# define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 48690792Sgshapiro# include <memory.h> 48790792Sgshapiro# include <vfork.h> 48890792Sgshapiro# ifdef __GNUC__ 48990792Sgshapiro# define strtoul strtol /* gcc library bogosity */ 49090792Sgshapiro# endif /* __GNUC__ */ 49190792Sgshapiro# define memmove(d, s, l) (bcopy((s), (d), (l))) 49290792Sgshapiro# define atexit(f) on_exit((f), 0) /* ugly hack for SunOS */ 49390792Sgshapiro# define SM_INT32 int /* 32bit integer */ 49490792Sgshapiro# define SM_ALIGN_SIZE (sizeof(long)) 49590792Sgshapiro# define GIDSET_T int 49690792Sgshapiro# define SM_CONF_SYSLOG 0 49790792Sgshapiro 49890792Sgshapiro# ifdef SUNOS403 49990792Sgshapiro /* special tweaking for SunOS 4.0.3 */ 50090792Sgshapiro# include <malloc.h> 50190792Sgshapiro# define BSD4_3 1 /* 4.3 BSD-based */ 50290792Sgshapiro# define NEEDSTRSTR 1 /* need emulation of strstr(3) routine */ 50390792Sgshapiro# define WAITUNION 1 /* use "union wait" as wait argument type */ 50490792Sgshapiro# undef WIFEXITED 50590792Sgshapiro# undef WEXITSTATUS 50690792Sgshapiro# undef HASUNAME 50790792Sgshapiro# define setpgid setpgrp 50890792Sgshapiro# define MODE_T int 50990792Sgshapirotypedef int pid_t; 51090792Sgshapiroextern char *getenv(); 51190792Sgshapiro 51290792Sgshapiro# else /* SUNOS403 */ 51390792Sgshapiro /* 4.1.x specifics */ 514132943Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 51590792Sgshapiro# define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 51690792Sgshapiro 51790792Sgshapiro# endif /* SUNOS403 */ 51890792Sgshapiro# endif /* SOLARIS */ 51990792Sgshapiro 52090792Sgshapiro# ifndef LA_TYPE 52190792Sgshapiro# define LA_TYPE LA_INT 52290792Sgshapiro# endif /* ! LA_TYPE */ 52390792Sgshapiro 52490792Sgshapiro# endif /* defined(sun) && !defined(BSD) */ 52590792Sgshapiro 52690792Sgshapiro/* 52790792Sgshapiro** DG/UX 52890792Sgshapiro** 52990792Sgshapiro** Tested on 5.4.2 and 5.4.3. Use DGUX_5_4_2 to get the 53090792Sgshapiro** older support. 53190792Sgshapiro** 5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>. 53290792Sgshapiro*/ 53390792Sgshapiro 53490792Sgshapiro# ifdef DGUX_5_4_2 53590792Sgshapiro# define DGUX 1 53690792Sgshapiro# endif /* DGUX_5_4_2 */ 53790792Sgshapiro 53890792Sgshapiro# ifdef DGUX 53990792Sgshapiro# define SYSTEM5 1 54090792Sgshapiro# define LA_TYPE LA_DGUX 54190792Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 54290792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 543132943Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 54490792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 54590792Sgshapiro# define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */ 54690792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) */ 54790792Sgshapiro# ifndef IDENTPROTO 54890792Sgshapiro# define IDENTPROTO 0 /* TCP/IP implementation is broken */ 54990792Sgshapiro# endif /* ! IDENTPROTO */ 55090792Sgshapiro# define SPT_TYPE SPT_NONE /* don't use setproctitle */ 55190792Sgshapiro# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 55290792Sgshapiro# define LDA_USE_LOCKF 1 55390792Sgshapiro 55490792Sgshapiro/* these include files must be included early on DG/UX */ 55590792Sgshapiro# include <netinet/in.h> 55690792Sgshapiro# include <arpa/inet.h> 55790792Sgshapiro 55890792Sgshapiro/* compiler doesn't understand const? */ 55990792Sgshapiro# define const 56090792Sgshapiro 56190792Sgshapiro# ifdef DGUX_5_4_2 56290792Sgshapiro# define inet_addr dgux_inet_addr 56390792Sgshapiroextern long dgux_inet_addr(); 56490792Sgshapiro# endif /* DGUX_5_4_2 */ 56590792Sgshapiro# endif /* DGUX */ 56690792Sgshapiro 56790792Sgshapiro 56890792Sgshapiro/* 56990792Sgshapiro** Digital Ultrix 4.2 - 4.5 57090792Sgshapiro** 57190792Sgshapiro** Apparently, fcntl locking is broken on 4.2A, in that locks are 57290792Sgshapiro** not dropped when the process exits. This causes major problems, 57390792Sgshapiro** so flock is the only alternative. 57490792Sgshapiro*/ 57590792Sgshapiro 57690792Sgshapiro# ifdef ultrix 57790792Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 57890792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 57990792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 58090792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 58190792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 58290792Sgshapiro# define HASFCHOWN 1 /* has fchown(2) syscall */ 58390792Sgshapiro# ifndef HASFLOCK 58490792Sgshapiro# define HASFLOCK 1 /* has flock(2) call */ 58590792Sgshapiro# endif /* ! HASFLOCK */ 58690792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 58790792Sgshapiro# ifndef BROKEN_RES_SEARCH 58890792Sgshapiro# define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 58990792Sgshapiro# endif /* ! BROKEN_RES_SEARCH */ 59090792Sgshapiro# if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 59190792Sgshapiro# define NEEDLOCAL_HOSTNAME_LENGTH 1 /* see sendmail/README */ 59290792Sgshapiro# endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */ 59390792Sgshapiro# ifdef vax 59490792Sgshapiro# define LA_TYPE LA_FLOAT 59590792Sgshapiro# else /* vax */ 59690792Sgshapiro# define LA_TYPE LA_INT 59790792Sgshapiro# define LA_AVENRUN "avenrun" 59890792Sgshapiro# endif /* vax */ 59990792Sgshapiro# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 60090792Sgshapiro# ifndef IDENTPROTO 60190792Sgshapiro# define IDENTPROTO 0 /* pre-4.4 TCP/IP implementation is broken */ 60290792Sgshapiro# endif /* ! IDENTPROTO */ 60390792Sgshapiro# define SYSLOG_BUFSIZE 256 60490792Sgshapiro# define SM_CONF_SYSLOG 0 60590792Sgshapiro# endif /* ultrix */ 60690792Sgshapiro 60790792Sgshapiro 60890792Sgshapiro/* 60990792Sgshapiro** OSF/1 for KSR. 61090792Sgshapiro** 61190792Sgshapiro** Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu> 61290792Sgshapiro*/ 61390792Sgshapiro 61490792Sgshapiro# ifdef __ksr__ 61590792Sgshapiro# define __osf__ 1 /* get OSF/1 defines below */ 61690792Sgshapiro# ifndef TZ_TYPE 61790792Sgshapiro# define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 61890792Sgshapiro# endif /* ! TZ_TYPE */ 61990792Sgshapiro# endif /* __ksr__ */ 62090792Sgshapiro 62190792Sgshapiro 62290792Sgshapiro/* 62390792Sgshapiro** OSF/1 for Intel Paragon. 62490792Sgshapiro** 62590792Sgshapiro** Contributed by Jeff A. Earickson <jeff@ssd.intel.com> 62690792Sgshapiro** of Intel Scalable Systems Divison. 62790792Sgshapiro*/ 62890792Sgshapiro 62990792Sgshapiro# ifdef __PARAGON__ 63090792Sgshapiro# define __osf__ 1 /* get OSF/1 defines below */ 63190792Sgshapiro# ifndef TZ_TYPE 63290792Sgshapiro# define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 63390792Sgshapiro# endif /* ! TZ_TYPE */ 63490792Sgshapiro# define GIDSET_T gid_t 63590792Sgshapiro# define MAXNAMLEN NAME_MAX 63690792Sgshapiro# endif /* __PARAGON__ */ 63790792Sgshapiro 63890792Sgshapiro 63990792Sgshapiro/* 64090792Sgshapiro** Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1 64190792Sgshapiro** 64290792Sgshapiro** Tested for 3.2 and 4.0. 64390792Sgshapiro*/ 64490792Sgshapiro 64590792Sgshapiro# ifdef __osf__ 64690792Sgshapiro# define HASUNAME 1 /* has uname(2) call */ 64790792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 64890792Sgshapiro# define USESETEUID 1 /* has usable seteuid(2) call */ 64990792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 65090792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 65190792Sgshapiro# define HASFCHOWN 1 /* has fchown(2) syscall */ 65290792Sgshapiro# define HASSETLOGIN 1 /* has setlogin(2) */ 65390792Sgshapiro# define IP_SRCROUTE 1 /* can check IP source routing */ 65490792Sgshapiro# define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 65590792Sgshapiro# define GIDSET_T gid_t 65690792Sgshapiro# define SM_INT32 int /* 32bit integer */ 65790792Sgshapiro# ifndef HASFLOCK 65898121Sgshapiro# include <standards.h> 65998121Sgshapiro# if _XOPEN_SOURCE+0 >= 400 66098121Sgshapiro# define HASFLOCK 0 /* 5.0 and later has bad flock(2) call */ 66198121Sgshapiro# else /* _XOPEN_SOURCE+0 >= 400 */ 66298121Sgshapiro# define HASFLOCK 1 /* has flock(2) call */ 66398121Sgshapiro# endif /* _XOPEN_SOURCE+0 >= 400 */ 66490792Sgshapiro# endif /* ! HASFLOCK */ 66590792Sgshapiro# define LA_TYPE LA_ALPHAOSF 66690792Sgshapiro# define SFS_TYPE SFS_STATVFS /* use <sys/statvfs.h> statfs() impl */ 66790792Sgshapiro# ifndef _PATH_VENDOR_CF 66890792Sgshapiro# define _PATH_VENDOR_CF "/var/adm/sendmail/sendmail.cf" 66990792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 67090792Sgshapiro# ifndef _PATH_SENDMAILPID 67190792Sgshapiro# define _PATH_SENDMAILPID "/var/run/sendmail.pid" 67290792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 67394334Sgshapiro# if _FFR_DIGUNIX_SAFECHOWN 67494334Sgshapiro/* 67594334Sgshapiro** Testing on a Digital UNIX 4.0a system showed this to be the correct 67694334Sgshapiro** setting but given the security consequences, more testing and 67794334Sgshapiro** verification is needed. Unfortunately, the man page offers no 67894334Sgshapiro** assistance. 67994334Sgshapiro*/ 68094334Sgshapiro# define IS_SAFE_CHOWN >= 0 68194334Sgshapiro# endif /* _FFR_DIGUNIX_SAFECHOWN */ 68290792Sgshapiro# endif /* __osf__ */ 68390792Sgshapiro 68490792Sgshapiro 68590792Sgshapiro/* 68690792Sgshapiro** NeXTstep 68790792Sgshapiro*/ 68890792Sgshapiro 68990792Sgshapiro# ifdef NeXT 69090792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 69190792Sgshapiro# define NEEDPUTENV 2 /* need putenv(3) call; no setenv(3) call */ 69290792Sgshapiro# ifndef HASFLOCK 69390792Sgshapiro# define HASFLOCK 1 /* has flock(2) call */ 69490792Sgshapiro# endif /* ! HASFLOCK */ 69590792Sgshapiro# define UID_T int /* compiler gripes on uid_t */ 69690792Sgshapiro# define GID_T int /* ditto for gid_t */ 69790792Sgshapiro# define MODE_T int /* and mode_t */ 69890792Sgshapiro# define setpgid setpgrp 69990792Sgshapiro# ifndef NOT_SENDMAIL 70090792Sgshapiro# define sleep sleepX 70190792Sgshapiro# endif /* ! NOT_SENDMAIL */ 70290792Sgshapiro# ifndef LA_TYPE 70390792Sgshapiro# define LA_TYPE LA_MACH 70490792Sgshapiro# endif /* ! LA_TYPE */ 70590792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 70690792Sgshapiro# ifdef _POSIX_SOURCE 70790792Sgshapiroextern struct passwd *getpwent(); 70890792Sgshapiro# else /* _POSIX_SOURCE */ 70990792Sgshapiro# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 71090792Sgshapiro# define WAITUNION 1 /* use "union wait" as wait argument type */ 71190792Sgshapirotypedef int pid_t; 71290792Sgshapiro# undef WEXITSTATUS 71390792Sgshapiro# undef WIFEXITED 71490792Sgshapiro# undef WIFSTOPPED 71590792Sgshapiro# undef WTERMSIG 71690792Sgshapiro# endif /* _POSIX_SOURCE */ 71790792Sgshapiro# ifndef _PATH_VENDOR_CF 71890792Sgshapiro# define _PATH_VENDOR_CF "/etc/sendmail/sendmail.cf" 71990792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 72090792Sgshapiro# ifndef _PATH_SENDMAILPID 72190792Sgshapiro# define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" 72290792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 72390792Sgshapiro# define SM_INT32 int /* 32bit integer */ 72490792Sgshapiro 72590792Sgshapiro# ifdef TCPWRAPPERS 72690792Sgshapiro# ifndef HASUNSETENV 72790792Sgshapiro# define HASUNSETENV 1 72890792Sgshapiro# endif /* ! HASUNSETENV */ 72990792Sgshapiro# undef NEEDPUTENV 73090792Sgshapiro# endif /* TCPWRAPPERS */ 73190792Sgshapiro# ifndef __APPLE__ 73290792Sgshapiro# include <libc.h> 73390792Sgshapiro# ifndef S_IRUSR 73490792Sgshapiro# define S_IRUSR S_IREAD 73590792Sgshapiro# endif /* ! S_IRUSR */ 73690792Sgshapiro# ifndef S_IWUSR 73790792Sgshapiro# define S_IWUSR S_IWRITE 73890792Sgshapiro# endif /* ! S_IWUSR */ 73990792Sgshapiro# define _PATH_MAILDIR "/usr/spool/mail" 74090792Sgshapiro# endif /* ! __APPLE__ */ 74190792Sgshapiro# ifndef isascii 74290792Sgshapiro# define isascii(c) ((unsigned)(c) <= 0177) 74390792Sgshapiro# endif /* ! isascii */ 74490792Sgshapiro# endif /* NeXT */ 74590792Sgshapiro 74690792Sgshapiro/* 747132943Sgshapiro** Apple Darwin 748110560Sgshapiro** Contributed by Wilfredo Sanchez <wsanchez@mit.edu> 74990792Sgshapiro*/ 75090792Sgshapiro 75190792Sgshapiro# if defined(DARWIN) 752110560Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) */ 753110560Sgshapiro# define HASFCHOWN 1 /* has fchown(2) */ 754110560Sgshapiro# define HASFLOCK 1 /* has flock(2) */ 755110560Sgshapiro# define HASUNAME 1 /* has uname(2) */ 756110560Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) */ 757157001Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 758157001Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) */ 759110560Sgshapiro# define HASSETVBUF 1 /* has setvbuf (3) */ 760110560Sgshapiro# define HASSETREUID 0 /* setreuid(2) unusable */ 761110560Sgshapiro# define HASSETEUID 1 /* has seteuid(2) */ 762110560Sgshapiro# define USESETEUID 1 /* has seteuid(2) */ 763110560Sgshapiro# define HASSETEGID 1 /* has setegid(2) */ 764110560Sgshapiro# define HASSETREGID 1 /* has setregid(2) */ 765110560Sgshapiro# define HASSETRESGID 0 /* no setresgid(2) */ 766110560Sgshapiro# define HASLSTAT 1 /* has lstat(2) */ 767110560Sgshapiro# define HASSETRLIMIT 1 /* has setrlimit(2) */ 768110560Sgshapiro# define HASWAITPID 1 /* has waitpid(2) */ 769110560Sgshapiro# define HASGETDTABLESIZE 1 /* has getdtablesize(2) */ 770110560Sgshapiro# define HAS_ST_GEN 1 /* has st_gen field in struct stat */ 771157001Sgshapiro# define HASURANDOMDEV 1 /* has urandom(4) */ 772110560Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 773110560Sgshapiro# define HASGETUSERSHELL 1 /* had getusershell(3) */ 774110560Sgshapiro# define GIDSET_T gid_t /* getgroups(2) takes gid_t */ 775110560Sgshapiro# define LA_TYPE LA_SUBR /* use getloadavg(3) */ 776110560Sgshapiro# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 777157001Sgshapiro# if DARWIN >= 70000 778157001Sgshapiro# define SOCKADDR_LEN_T socklen_t 779157001Sgshapiro# endif 780157001Sgshapiro# if DARWIN >= 80000 781157001Sgshapiro# define SPT_TYPE SPT_REUSEARGV 782157001Sgshapiro# define SPT_PADCHAR '\0' 783157001Sgshapiro# define SOCKOPT_LEN_T socklen_t 784157001Sgshapiro# else 785157001Sgshapiro# define SPT_TYPE SPT_PSSTRINGS /* use magic PS_STRINGS pointer for setproctitle */ 786157001Sgshapiro# endif 787110560Sgshapiro# define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 788110560Sgshapiro# define BSD4_4_SOCKADDR /* struct sockaddr has sa_len */ 789110560Sgshapiro# define SAFENFSPATHCONF 0 /* unverified: pathconf(2) doesn't work on NFS */ 790110560Sgshapiro# define HAS_IN_H 1 791110560Sgshapiro# define NETLINK 1 /* supports AF_LINK */ 79294334Sgshapiro# ifndef NOT_SENDMAIL 793110560Sgshapiro# define sleep sleepX 794102528Sgshapiroextern unsigned int sleepX __P((unsigned int seconds)); 79594334Sgshapiro# endif /* ! NOT_SENDMAIL */ 79690792Sgshapiro# endif /* defined(DARWIN) */ 79790792Sgshapiro 79890792Sgshapiro 79990792Sgshapiro/* 80090792Sgshapiro** 4.4 BSD 80190792Sgshapiro** 80290792Sgshapiro** See also BSD defines. 80390792Sgshapiro*/ 80490792Sgshapiro 805157001Sgshapiro# if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN) 80690792Sgshapiro# include <paths.h> 80790792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 80890792Sgshapiro# define USESETEUID 1 /* has usable seteuid(2) call */ 80990792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 81090792Sgshapiro# define HASFCHOWN 1 /* has fchown(2) syscall */ 81190792Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 81290792Sgshapiro# define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 81390792Sgshapiro# include <sys/cdefs.h> 81490792Sgshapiro# define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 81590792Sgshapiro# define BSD4_4_SOCKADDR /* has sa_len */ 81690792Sgshapiro# define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */ 81790792Sgshapiro# define NETLINK 1 /* supports AF_LINK */ 81890792Sgshapiro# ifndef LA_TYPE 81990792Sgshapiro# define LA_TYPE LA_SUBR 82090792Sgshapiro# endif /* ! LA_TYPE */ 82190792Sgshapiro# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 82290792Sgshapiro# define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */ 823157001Sgshapiro# endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) && !defined(DARWIN)*/ 82490792Sgshapiro 82590792Sgshapiro 82690792Sgshapiro/* 82790792Sgshapiro** BSD/OS (was BSD/386) (all versions) 82890792Sgshapiro** From Tony Sanders, BSDI 82990792Sgshapiro*/ 83090792Sgshapiro 83190792Sgshapiro# ifdef __bsdi__ 83290792Sgshapiro# include <paths.h> 83390792Sgshapiro# define HASUNSETENV 1 /* has the unsetenv(3) call */ 83490792Sgshapiro# define HASSETREUID 0 /* BSD-OS has broken setreuid(2) emulation */ 835132943Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 83690792Sgshapiro# define USESETEUID 1 /* has usable seteuid(2) call */ 83790792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 83890792Sgshapiro# define HASSETLOGIN 1 /* has setlogin(2) */ 83990792Sgshapiro# define HASUNAME 1 /* has uname(2) syscall */ 84090792Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 84190792Sgshapiro# define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 84290792Sgshapiro# include <sys/cdefs.h> 84390792Sgshapiro# define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 84490792Sgshapiro# define BSD4_4_SOCKADDR /* has sa_len */ 84590792Sgshapiro# define NETLINK 1 /* supports AF_LINK */ 84690792Sgshapiro# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 84790792Sgshapiro# ifndef LA_TYPE 84890792Sgshapiro# define LA_TYPE LA_SUBR 84990792Sgshapiro# endif /* ! LA_TYPE */ 85090792Sgshapiro# define GIDSET_T gid_t 85190792Sgshapiro# define QUAD_T quad_t 85290792Sgshapiro# if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 85390792Sgshapiro /* version 1.1 or later */ 85490792Sgshapiro# undef SPT_TYPE 85590792Sgshapiro# define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 85690792Sgshapiro# else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */ 85790792Sgshapiro /* version 1.0 or earlier */ 85890792Sgshapiro# define SPT_PADCHAR '\0' /* pad process title with nulls */ 85990792Sgshapiro# endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */ 86090792Sgshapiro# if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 /* on 3.x */ 86190792Sgshapiro# define HASSETUSERCONTEXT 1 /* has setusercontext */ 86290792Sgshapiro# endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */ 86390792Sgshapiro# if defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 /* 3.1 and earlier */ 86490792Sgshapiro# define MODE_T int /* va_arg() can't handle less than int */ 86590792Sgshapiro# endif /* defined(_BSDI_VERSION) && _BSDI_VERSION <= 199701 */ 86690792Sgshapiro# if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 /* on 4.x */ 86790792Sgshapiro# define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 86890792Sgshapiro# endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199910 */ 86990792Sgshapiro# endif /* __bsdi__ */ 87090792Sgshapiro 87190792Sgshapiro 872168515Sgshapiro# if defined(__QNX__) 873168515Sgshapiro# if defined(__QNXNTO__) 874168515Sgshapiro/* QNX 6 */ 875168515Sgshapiro# include <unix.h> 876168515Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 877168515Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 878168515Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 879168515Sgshapiro# define USESETEUID 1 /* has usable seteuid(2) call */ 880168515Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 881168515Sgshapiro# define HASFCHOWN 1 /* has fchown(2) syscall */ 882168515Sgshapiro# define HASUNAME 1 /* has uname(2) syscall */ 883168515Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 884168515Sgshapiro# define BSD4_4_SOCKADDR /* has sa_len */ 885168515Sgshapiro# define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 886168515Sgshapiro# define NETLINK 1 /* supports AF_LINK */ 887168515Sgshapiro# define GIDSET_T gid_t 888168515Sgshapiro# define QUAD_T uint64_t 889168515Sgshapiro# define HASSNPRINTF 1 /* has snprintf(3) (all versions?) */ 890168515Sgshapiro# define HASGETUSERSHELL 0 891168515Sgshapiro 89290792Sgshapiro/* 893168515Sgshapiro** We have a strrev() that doesn't allocate anything. 894168515Sgshapiro** Make sure the one here is used. 895168515Sgshapiro*/ 896168515Sgshapiro 897168515Sgshapiro# define strrev strrev_sendmail 898168515Sgshapiro 899168515Sgshapiro# else /* defined(__QNXNTO__) */ 900168515Sgshapiro 901168515Sgshapiro/* 90290792Sgshapiro** QNX 4.2x 90390792Sgshapiro** Contributed by Glen McCready <glen@qnx.com>. 90490792Sgshapiro** 905168515Sgshapiro** Should work with all versions of QNX 4. 90690792Sgshapiro*/ 90790792Sgshapiro 908168515Sgshapiro# include <unix.h> 909168515Sgshapiro# include <sys/select.h> 910168515Sgshapiro# undef NGROUPS_MAX 911168515Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 912168515Sgshapiro# define USESETEUID 1 /* has usable seteuid(2) call */ 913168515Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 914168515Sgshapiro# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 915168515Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 916168515Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 917168515Sgshapiro# define HASFLOCK 0 918168515Sgshapiro# undef HASINITGROUPS /* has initgroups(3) call */ 919168515Sgshapiro# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 920168515Sgshapiro# define IP_SRCROUTE 1 /* can check IP source routing */ 921168515Sgshapiro# define TZ_TYPE TZ_TMNAME /* use tmname variable */ 922168515Sgshapiro# define GIDSET_T gid_t 923168515Sgshapiro# define LA_TYPE LA_ZERO 924168515Sgshapiro# define SFS_TYPE SFS_NONE 925168515Sgshapiro# define SPT_TYPE SPT_REUSEARGV 926168515Sgshapiro# define SPT_PADCHAR '\0' /* pad process title with nulls */ 927168515Sgshapiro# define HASGETUSERSHELL 0 928168515Sgshapiro# define _FILE_H_INCLUDED 929168515Sgshapiro# endif /* defined(__QNXNTO__) */ 93090792Sgshapiro# endif /* defined(__QNX__) */ 93190792Sgshapiro 93290792Sgshapiro 93390792Sgshapiro/* 934141858Sgshapiro** DragonFly BSD/ FreeBSD / NetBSD / OpenBSD (all architectures, all versions) 93590792Sgshapiro** 93690792Sgshapiro** 4.3BSD clone, closer to 4.4BSD for FreeBSD 1.x and NetBSD 0.9x 93790792Sgshapiro** 4.4BSD-Lite based for FreeBSD 2.x and NetBSD 1.x 93890792Sgshapiro** 93990792Sgshapiro** See also BSD defines. 94090792Sgshapiro*/ 94190792Sgshapiro 942141858Sgshapiro# if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) 94390792Sgshapiro# include <paths.h> 94490792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 945132943Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 94690792Sgshapiro# define USESETEUID 1 /* has usable seteuid(2) call */ 94790792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 948132943Sgshapiro# define HASFCHOWN 1 /* has fchown(2) syscall */ 94990792Sgshapiro# define HASUNAME 1 /* has uname(2) syscall */ 95090792Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 95190792Sgshapiro# define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 95290792Sgshapiro# define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */ 95390792Sgshapiro# include <sys/cdefs.h> 95490792Sgshapiro# define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 95590792Sgshapiro# define BSD4_4_SOCKADDR /* has sa_len */ 95690792Sgshapiro# define NETLINK 1 /* supports AF_LINK */ 95790792Sgshapiro# define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 95890792Sgshapiro# define GIDSET_T gid_t 959157001Sgshapiro# define QUAD_T unsigned long long 960157001Sgshapiro# define HASSNPRINTF 1 /* has snprintf(3) (all versions?) */ 96190792Sgshapiro# ifndef LA_TYPE 96290792Sgshapiro# define LA_TYPE LA_SUBR 96390792Sgshapiro# endif /* ! LA_TYPE */ 964157001Sgshapiro# if defined(__NetBSD__) && defined(__NetBSD_Version__) && \ 965157001Sgshapiro ((__NetBSD_Version__ >= 200040000 && __NetBSD_Version__ < 200090000) || \ 966157001Sgshapiro (__NetBSD_Version__ >= 299000900)) 967132943Sgshapiro# undef SFS_TYPE 968132943Sgshapiro# define SFS_TYPE SFS_STATVFS 969132943Sgshapiro# else 970132943Sgshapiro# define SFS_TYPE SFS_MOUNT /* use <sys/mount.h> statfs() impl */ 971132943Sgshapiro# endif 97290792Sgshapiro# if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) 97390792Sgshapiro# undef SPT_TYPE 97490792Sgshapiro# define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 97590792Sgshapiro# endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */ 97690792Sgshapiro# if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) 97790792Sgshapiro# define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 97890792Sgshapiro# endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */ 979132943Sgshapiro# if defined(__NetBSD__) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104170000 980132943Sgshapiro# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ 981132943Sgshapiro# endif 982157001Sgshapiro# if defined(__NetBSD__) && defined(__NetBSD_Version__) && \ 983157001Sgshapiro ((__NetBSD_Version__ >= 200060000 && __NetBSD_Version__ < 200090000) || \ 984157001Sgshapiro (__NetBSD_Version__ >= 299000900)) 985132943Sgshapiro# define HASCLOSEFROM 1 /* closefrom(3) added in 2.0F */ 986132943Sgshapiro# endif 987132943Sgshapiro# if defined(__NetBSD__) 988132943Sgshapiro# define USESYSCTL 1 /* use sysctl(3) for getting ncpus */ 989132943Sgshapiro# include <sys/param.h> 990132943Sgshapiro# include <sys/sysctl.h> 991132943Sgshapiro# endif 992141858Sgshapiro# if defined(__DragonFly__) 993141858Sgshapiro# define HASSETLOGIN 1 /* has setlogin(2) */ 994141858Sgshapiro# define HASSRANDOMDEV 1 /* has srandomdev(3) */ 995141858Sgshapiro# define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 996141858Sgshapiro# undef SPT_TYPE 997141858Sgshapiro# include <libutil.h> 998141858Sgshapiro# define SPT_TYPE SPT_BUILTIN 999141858Sgshapiro# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ 1000141858Sgshapiro# ifndef SMRSH_CMDDIR 1001141858Sgshapiro# define SMRSH_CMDDIR "/usr/libexec/sm.bin" 1002141858Sgshapiro# endif /* ! SMRSH_CMDDIR */ 1003141858Sgshapiro# ifndef SMRSH_PATH 1004141858Sgshapiro# define SMRSH_PATH "/bin:/usr/bin" 1005141858Sgshapiro# endif /* ! SMRSH_PATH */ 1006141858Sgshapiro# define USESYSCTL 1 /* use sysctl(3) for getting ncpus */ 1007141858Sgshapiro# include <sys/sysctl.h> 1008141858Sgshapiro# endif /* defined(__DragonFly__) */ 100990792Sgshapiro# if defined(__FreeBSD__) 101090792Sgshapiro# define HASSETLOGIN 1 /* has setlogin(2) */ 101190792Sgshapiro# if __FreeBSD_version >= 227001 101290792Sgshapiro# define HASSRANDOMDEV 1 /* has srandomdev(3) */ 101390792Sgshapiro# define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 101490792Sgshapiro# endif /* __FreeBSD_version >= 227001 */ 101590792Sgshapiro# undef SPT_TYPE 101690792Sgshapiro# if __FreeBSD__ >= 2 101790792Sgshapiro# include <osreldate.h> 101890792Sgshapiro# if __FreeBSD_version >= 199512 /* 2.2-current when it appeared */ 101990792Sgshapiro# include <libutil.h> 102090792Sgshapiro# define SPT_TYPE SPT_BUILTIN 102190792Sgshapiro# endif /* __FreeBSD_version >= 199512 */ 102290792Sgshapiro# if __FreeBSD_version >= 222000 /* 2.2.2-release and later */ 102390792Sgshapiro# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ 102490792Sgshapiro# endif /* __FreeBSD_version >= 222000 */ 1025223067Sgshapiro# if __FreeBSD_version >= 300000 /* 3.0.0-release and later */ 1026223067Sgshapiro# define HAVE_NANOSLEEP 1 /* has nanosleep(2) */ 1027223067Sgshapiro# endif /* __FreeBSD_version >= 300000 */ 102890792Sgshapiro# if __FreeBSD_version >= 330000 /* 3.3.0-release and later */ 1029120256Sgshapiro# ifndef SMRSH_CMDDIR 1030120256Sgshapiro# define SMRSH_CMDDIR "/usr/libexec/sm.bin" 1031120256Sgshapiro# endif /* ! SMRSH_CMDDIR */ 1032120256Sgshapiro# ifndef SMRSH_PATH 1033120256Sgshapiro# define SMRSH_PATH "/bin:/usr/bin" 1034120256Sgshapiro# endif /* ! SMRSH_PATH */ 103590792Sgshapiro# endif /* __FreeBSD_version >= 330000 */ 1036203004Sgshapiro# if __FreeBSD_version >= 430000 /* 4.3.0-release and later */ 1037203004Sgshapiro# define SOCKADDR_LEN_T socklen_t /* e.g., arg#3 to accept, getsockname */ 1038203004Sgshapiro# define SOCKOPT_LEN_T socklen_t /* arg#5 to getsockopt */ 1039203004Sgshapiro# endif /* __FreeBSD_version >= 430000 */ 104090792Sgshapiro# define USESYSCTL 1 /* use sysctl(3) for getting ncpus */ 104190792Sgshapiro# include <sys/sysctl.h> 104290792Sgshapiro# endif /* __FreeBSD__ >= 2 */ 104390792Sgshapiro# ifndef SPT_TYPE 104490792Sgshapiro# define SPT_TYPE SPT_REUSEARGV 104590792Sgshapiro# define SPT_PADCHAR '\0' /* pad process title with nulls */ 104690792Sgshapiro# endif /* ! SPT_TYPE */ 104790792Sgshapiro# endif /* defined(__FreeBSD__) */ 104890792Sgshapiro# if defined(__OpenBSD__) 104990792Sgshapiro# undef SPT_TYPE 105090792Sgshapiro# define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ 105190792Sgshapiro# define HASSETLOGIN 1 /* has setlogin(2) */ 1052120256Sgshapiro# if OpenBSD < 200305 1053120256Sgshapiro# define HASSETREUID 0 /* setreuid(2) broken in OpenBSD < 3.3 */ 1054120256Sgshapiro# endif /* OpenBSD < 200305 */ 105590792Sgshapiro# define HASSETEGID 1 /* use setegid(2) to set saved gid */ 105690792Sgshapiro# define HASURANDOMDEV 1 /* has /dev/urandom(4) */ 105790792Sgshapiro# if OpenBSD >= 200006 105890792Sgshapiro# define HASSRANDOMDEV 1 /* has srandomdev(3) */ 105990792Sgshapiro# endif /* OpenBSD >= 200006 */ 106090792Sgshapiro# if OpenBSD >= 200012 106190792Sgshapiro# define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ 106290792Sgshapiro# endif /* OpenBSD >= 200012 */ 1063132943Sgshapiro# if OpenBSD >= 200405 1064132943Sgshapiro# define HASCLOSEFROM 1 /* closefrom(3) added in 3.5 */ 1065132943Sgshapiro# endif /* OpenBSD >= 200405 */ 1066157001Sgshapiro# if OpenBSD >= 200505 1067157001Sgshapiro# undef NETISO /* iso.h removed in 3.7 */ 1068157001Sgshapiro# endif /* OpenBSD >= 200505 */ 1069223067Sgshapiro# if OpenBSD >= 200800 1070223067Sgshapiro# define HAVE_NANOSLEEP 1 /* has nanosleep(2) */ 1071223067Sgshapiro# endif /* OpenBSD >= 200800 */ 107290792Sgshapiro# endif /* defined(__OpenBSD__) */ 1073141858Sgshapiro# endif /* defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ 107490792Sgshapiro 107590792Sgshapiro 107690792Sgshapiro/* 107790792Sgshapiro** Mach386 107890792Sgshapiro** 107990792Sgshapiro** For mt Xinu's Mach386 system. 108090792Sgshapiro*/ 108190792Sgshapiro 108290792Sgshapiro# if defined(MACH) && defined(i386) && !defined(__GNU__) 108390792Sgshapiro# define MACH386 1 108490792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 108590792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 108690792Sgshapiro# ifndef HASFLOCK 108790792Sgshapiro# define HASFLOCK 1 /* has flock(2) call */ 108890792Sgshapiro# endif /* ! HASFLOCK */ 108990792Sgshapiro# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 109090792Sgshapiro# define NEEDSTRTOL 1 /* need the strtol() function */ 109190792Sgshapiro# define setpgid setpgrp 109290792Sgshapiro# ifndef LA_TYPE 109390792Sgshapiro# define LA_TYPE LA_FLOAT 109490792Sgshapiro# endif /* ! LA_TYPE */ 109590792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 109690792Sgshapiro# undef HASSETVBUF /* don't actually have setvbuf(3) */ 109790792Sgshapiro# undef WEXITSTATUS 109890792Sgshapiro# undef WIFEXITED 109990792Sgshapiro# ifndef _PATH_VENDOR_CF 110090792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 110190792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 110290792Sgshapiro# ifndef _PATH_SENDMAILPID 110390792Sgshapiro# define _PATH_SENDMAILPID "/etc/sendmail.pid" 110490792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 110590792Sgshapiro# endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */ 110690792Sgshapiro 110790792Sgshapiro 110890792Sgshapiro 110990792Sgshapiro/* 111090792Sgshapiro** GNU OS (hurd) 111190792Sgshapiro** Largely BSD & posix compatible. 111290792Sgshapiro** Port contributed by Miles Bader <miles@gnu.ai.mit.edu>. 111390792Sgshapiro** Updated by Mark Kettenis <kettenis@wins.uva.nl>. 111490792Sgshapiro*/ 111590792Sgshapiro 111690792Sgshapiro# if defined(__GNU__) && !defined(NeXT) 111790792Sgshapiro# include <paths.h> 111890792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) call */ 111990792Sgshapiro# define HASFCHOWN 1 /* has fchown(2) call */ 112090792Sgshapiro# define HASUNAME 1 /* has uname(2) call */ 112190792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 112290792Sgshapiro# define HAS_ST_GEN 1 /* has st_gen field in stat struct */ 112390792Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 112490792Sgshapiro# define GIDSET_T gid_t 112590792Sgshapiro# define SOCKADDR_LEN_T socklen_t 112690792Sgshapiro# define SOCKOPT_LEN_T socklen_t 112790792Sgshapiro# if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 112890792Sgshapiro# define LA_TYPE LA_SUBR 112990792Sgshapiro# else /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */ 113090792Sgshapiro# define LA_TYPE LA_MACH 113190792Sgshapiro /* GNU uses mach[34], which renames some rpcs from mach2.x. */ 113290792Sgshapiro# define host_self mach_host_self 113390792Sgshapiro# endif /* (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 */ 113490792Sgshapiro# define SFS_TYPE SFS_STATFS 113590792Sgshapiro# define SPT_TYPE SPT_CHANGEARGV 113690792Sgshapiro# define ERRLIST_PREDEFINED 1 /* don't declare sys_errlist */ 113790792Sgshapiro# define BSD4_4_SOCKADDR 1 /* has sa_len */ 113890792Sgshapiro# define SIOCGIFCONF_IS_BROKEN 1 /* SIOCGFCONF doesn't work */ 113990792Sgshapiro# define HAS_IN_H 1 /* GNU has netinet/in.h. */ 114090792Sgshapiro/* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */ 114190792Sgshapiro# define MAXPATHLEN 2048 114290792Sgshapiro# endif /* defined(__GNU__) && !defined(NeXT) */ 114390792Sgshapiro 114490792Sgshapiro/* 114590792Sgshapiro** 4.3 BSD -- this is for very old systems 114690792Sgshapiro** 114790792Sgshapiro** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1. 114890792Sgshapiro** 114990792Sgshapiro** You'll also have to install a new resolver library. 115090792Sgshapiro** I don't guarantee that support for this environment is complete. 115190792Sgshapiro*/ 115290792Sgshapiro 115390792Sgshapiro# if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) 115490792Sgshapiro# define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 115590792Sgshapiro# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 115690792Sgshapiro# define ARBPTR_T char * 115790792Sgshapiro# define setpgid setpgrp 115890792Sgshapiro# ifndef LA_TYPE 115990792Sgshapiro# define LA_TYPE LA_FLOAT 116090792Sgshapiro# endif /* ! LA_TYPE */ 116190792Sgshapiro# ifndef _PATH_VENDOR_CF 116290792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 116390792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 116490792Sgshapiro# ifndef IDENTPROTO 116590792Sgshapiro# define IDENTPROTO 0 /* TCP/IP implementation is broken */ 116690792Sgshapiro# endif /* ! IDENTPROTO */ 116790792Sgshapiro# undef WEXITSTATUS 116890792Sgshapiro# undef WIFEXITED 116990792Sgshapirotypedef short pid_t; 117090792Sgshapiro# endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */ 117190792Sgshapiro 117290792Sgshapiro 117390792Sgshapiro/* 117490792Sgshapiro** SCO Unix 117590792Sgshapiro** 117690792Sgshapiro** This includes three parts: 117790792Sgshapiro** 117890792Sgshapiro** The first is for SCO OpenServer 5. 117990792Sgshapiro** (Contributed by Keith Reynolds <keithr@sco.COM>). 118090792Sgshapiro** 118190792Sgshapiro** SCO OpenServer 5 has a compiler version number macro, 118290792Sgshapiro** which we can use to figure out what version we're on. 118390792Sgshapiro** This may have to change in future releases. 118490792Sgshapiro** 118590792Sgshapiro** The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0. 118690792Sgshapiro** (Contributed by Philippe Brand <phb@colombo.telesys-innov.fr>). 118790792Sgshapiro** 118890792Sgshapiro** The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier. 118990792Sgshapiro*/ 119090792Sgshapiro 119190792Sgshapiro/* SCO OpenServer 5 */ 119290792Sgshapiro# if _SCO_DS >= 1 119390792Sgshapiro# include <paths.h> 119490792Sgshapiro# define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM returns bogus value */ 119590792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) call */ 119690792Sgshapiro# define HASFCHOWN 1 /* has fchown(2) call */ 119790792Sgshapiro# define HASSETRLIMIT 1 /* has setrlimit(2) call */ 119890792Sgshapiro# define USESETEUID 1 /* has seteuid(2) call */ 119990792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 120090792Sgshapiro# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 120190792Sgshapiro# define RLIMIT_NEEDS_SYS_TIME_H 1 120290792Sgshapiro# define LDA_USE_LOCKF 1 120390792Sgshapiro# ifndef LA_TYPE 120490792Sgshapiro# define LA_TYPE LA_DEVSHORT 120590792Sgshapiro# endif /* ! LA_TYPE */ 120690792Sgshapiro# define _PATH_AVENRUN "/dev/table/avenrun" 120790792Sgshapiro# ifndef _SCO_unix_4_2 120890792Sgshapiro# define _SCO_unix_4_2 120990792Sgshapiro# else /* ! _SCO_unix_4_2 */ 121090792Sgshapiro# define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */ 1211147078Sgshapiro# define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */ 121290792Sgshapiro# endif /* ! _SCO_unix_4_2 */ 121390792Sgshapiro# endif /* _SCO_DS >= 1 */ 121490792Sgshapiro 121590792Sgshapiro/* SCO UNIX 3.2v4.2/Open Desktop 3.0 */ 121690792Sgshapiro# ifdef _SCO_unix_4_2 121790792Sgshapiro# define _SCO_unix_ 121890792Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 121990792Sgshapiro# endif /* _SCO_unix_4_2 */ 122090792Sgshapiro 122190792Sgshapiro/* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */ 122290792Sgshapiro# ifdef _SCO_unix_ 122390792Sgshapiro# include <sys/stream.h> /* needed for IP_SRCROUTE */ 122490792Sgshapiro# define SYSTEM5 1 /* include all the System V defines */ 122590792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 122690792Sgshapiro# define NOFTRUNCATE 0 /* has (simulated) ftruncate call */ 122790792Sgshapiro# ifndef USE_SIGLONGJMP 122890792Sgshapiro# define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ 122990792Sgshapiro# endif /* ! USE_SIGLONGJMP */ 123090792Sgshapiro# define MAXPATHLEN PATHSIZE 123190792Sgshapiro# define SFS_TYPE SFS_4ARGS /* use <sys/statfs.h> 4-arg impl */ 123290792Sgshapiro# define SFS_BAVAIL f_bfree /* alternate field name */ 123390792Sgshapiro# define SPT_TYPE SPT_SCO /* write kernel u. area */ 123490792Sgshapiro# define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */ 123590792Sgshapiro# define UID_T uid_t 123690792Sgshapiro# define GID_T gid_t 123790792Sgshapiro# define GIDSET_T gid_t 123890792Sgshapiro# define _PATH_UNIX "/unix" 123990792Sgshapiro# ifndef _PATH_VENDOR_CF 124090792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 124190792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 124290792Sgshapiro# ifndef _PATH_SENDMAILPID 124390792Sgshapiro# define _PATH_SENDMAILPID "/etc/sendmail.pid" 124490792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 124590792Sgshapiro 124690792Sgshapiro/* stuff fixed in later releases */ 124790792Sgshapiro# ifndef _SCO_unix_4_2 124890792Sgshapiro# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 124990792Sgshapiro# endif /* ! _SCO_unix_4_2 */ 125090792Sgshapiro 125190792Sgshapiro# ifndef _SCO_DS 125290792Sgshapiro# define ftruncate chsize /* use chsize(2) to emulate ftruncate */ 125390792Sgshapiro# define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 125490792Sgshapiro# define NETUNIX 0 /* no unix domain socket support */ 125590792Sgshapiro# define LA_TYPE LA_SHORT 125690792Sgshapiro# endif /* ! _SCO_DS */ 125790792Sgshapiro 125890792Sgshapiro# endif /* _SCO_unix_ */ 125990792Sgshapiro 126090792Sgshapiro/* 126190792Sgshapiro** ISC (SunSoft) Unix. 126290792Sgshapiro** 126390792Sgshapiro** Contributed by J.J. Bailey <jjb@jagware.bcc.com> 126490792Sgshapiro*/ 126590792Sgshapiro 126690792Sgshapiro# ifdef ISC_UNIX 126790792Sgshapiro# include <net/errno.h> 126890792Sgshapiro# include <sys/stream.h> /* needed for IP_SRCROUTE */ 126990792Sgshapiro# include <sys/bsdtypes.h> 127090792Sgshapiro# define SYSTEM5 1 /* include all the System V defines */ 127190792Sgshapiro# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 127290792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 127390792Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 127490792Sgshapiro# define NEEDFSYNC 1 /* needs the fsync(2) call stub */ 127590792Sgshapiro# define NETUNIX 0 /* no unix domain socket support */ 127690792Sgshapiro# define MAXPATHLEN 1024 127790792Sgshapiro# define LA_TYPE LA_SHORT 127890792Sgshapiro# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 127990792Sgshapiro# define SFS_BAVAIL f_bfree /* alternate field name */ 128090792Sgshapiro# define _PATH_UNIX "/unix" 128190792Sgshapiro# ifndef _PATH_VENDOR_CF 128290792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 128390792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 128490792Sgshapiro# ifndef _PATH_SENDMAILPID 128590792Sgshapiro# define _PATH_SENDMAILPID "/etc/sendmail.pid" 128690792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 128790792Sgshapiro# endif /* ISC_UNIX */ 128890792Sgshapiro 128990792Sgshapiro 129090792Sgshapiro/* 129190792Sgshapiro** Altos System V (5.3.1) 129290792Sgshapiro** Contributed by Tim Rice <tim@trr.metro.net>. 129390792Sgshapiro*/ 129490792Sgshapiro 129590792Sgshapiro# ifdef ALTOS_SYSTEM_V 129690792Sgshapiro# include <sys/stream.h> 129790792Sgshapiro# include <limits.h> 129890792Sgshapiro# define SYSTEM5 1 /* include all the System V defines */ 129990792Sgshapiro# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 130090792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 130190792Sgshapiro# define WAITUNION 1 /* use "union wait" as wait argument type */ 130290792Sgshapiro# define NEEDFSYNC 1 /* no fsync(2) in system library */ 130390792Sgshapiro# define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 130490792Sgshapiro# define NOFTRUNCATE 1 /* do not have ftruncate(2) */ 130590792Sgshapiro# define MAXPATHLEN PATH_MAX 130690792Sgshapiro# define LA_TYPE LA_SHORT 130790792Sgshapiro# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 130890792Sgshapiro# define SFS_BAVAIL f_bfree /* alternate field name */ 130990792Sgshapiro# define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 131090792Sgshapiro# define NETUNIX 0 /* no unix domain socket support */ 131190792Sgshapiro# undef WIFEXITED 131290792Sgshapiro# undef WEXITSTATUS 131390792Sgshapiro# define strtoul strtol /* gcc library bogosity */ 131490792Sgshapiro 131590792Sgshapirotypedef unsigned short uid_t; 131690792Sgshapirotypedef unsigned short gid_t; 131790792Sgshapirotypedef short pid_t; 131890792Sgshapirotypedef unsigned long mode_t; 131990792Sgshapiro 132090792Sgshapiro/* some stuff that should have been in the include files */ 132190792Sgshapiroextern char *malloc(); 132290792Sgshapiroextern struct passwd *getpwent(); 132390792Sgshapiroextern struct passwd *getpwnam(); 132490792Sgshapiroextern struct passwd *getpwuid(); 132590792Sgshapiroextern char *getenv(); 132690792Sgshapiroextern struct group *getgrgid(); 132790792Sgshapiroextern struct group *getgrnam(); 132890792Sgshapiro 132990792Sgshapiro# endif /* ALTOS_SYSTEM_V */ 133090792Sgshapiro 133190792Sgshapiro 133290792Sgshapiro/* 133390792Sgshapiro** ConvexOS 11.0 and later 133490792Sgshapiro** 133590792Sgshapiro** "Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this 133690792Sgshapiro** works on 9.1 as well. 133790792Sgshapiro** 133890792Sgshapiro** ConvexOS 11.5 and later, should work on 11.0 as defined. 133990792Sgshapiro** For pre-ConvexOOS 11.0, define SM_CONF_GETOPT=0, undef IDENTPROTO 134090792Sgshapiro** 134190792Sgshapiro** Eric Schnoebelen (eric@cirr.com) For CONVEX Computer Corp. 134290792Sgshapiro** (now the CONVEX Technologies Center of Hewlett Packard) 134390792Sgshapiro*/ 134490792Sgshapiro 134590792Sgshapiro# ifdef _CONVEX_SOURCE 134690792Sgshapiro# define HASGETDTABLESIZE 1 /* has getdtablesize(2) */ 134790792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) */ 134890792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 134990792Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 135090792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) */ 135190792Sgshapiro# define HASFLOCK 1 /* has flock(2) */ 135290792Sgshapiro# define HASSETRLIMIT 1 /* has setrlimit(2) */ 135390792Sgshapiro# define HASSETREUID 1 /* has setreuid(2) */ 135490792Sgshapiro# define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_error=0 */ 135590792Sgshapiro# define NEEDPUTENV 1 /* needs putenv (written in terms of setenv) */ 135690792Sgshapiro# define SM_CONF_GETOPT 1 /* need a replacement for getopt(3) */ 135790792Sgshapiro# define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 135890792Sgshapiro# define LA_TYPE LA_FLOAT 135990792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 136090792Sgshapiro# ifndef _PATH_VENDOR_CF 136190792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 136290792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 136390792Sgshapiro# ifndef S_IREAD 136490792Sgshapiro# define S_IREAD _S_IREAD 136590792Sgshapiro# define S_IWRITE _S_IWRITE 136690792Sgshapiro# define S_IEXEC _S_IEXEC 136790792Sgshapiro# define S_IFMT _S_IFMT 136890792Sgshapiro# define S_IFCHR _S_IFCHR 136990792Sgshapiro# define S_IFBLK _S_IFBLK 137090792Sgshapiro# endif /* ! S_IREAD */ 137190792Sgshapiro# ifndef TZ_TYPE 137290792Sgshapiro# define TZ_TYPE TZ_TIMEZONE 137390792Sgshapiro# endif /* ! TZ_TYPE */ 137490792Sgshapiro# ifndef IDENTPROTO 137590792Sgshapiro# define IDENTPROTO 1 137690792Sgshapiro# endif /* ! IDENTPROTO */ 137790792Sgshapiro# ifndef SHARE_V1 137890792Sgshapiro# define SHARE_V1 1 /* version 1 of the fair share scheduler */ 137990792Sgshapiro# endif /* ! SHARE_V1 */ 138090792Sgshapiro# if !defined(__GNUC__ ) 138190792Sgshapiro# define UID_T int /* GNUC gets it right, ConvexC botches */ 138290792Sgshapiro# define GID_T int /* GNUC gets it right, ConvexC botches */ 138390792Sgshapiro# endif /* !defined(__GNUC__ ) */ 138490792Sgshapiro# if SECUREWARE 138590792Sgshapiro# define FORK fork /* SecureWare wants the real fork! */ 138690792Sgshapiro# else /* SECUREWARE */ 138790792Sgshapiro# define FORK vfork /* the rest of the OS versions don't care */ 138890792Sgshapiro# endif /* SECUREWARE */ 138990792Sgshapiro# endif /* _CONVEX_SOURCE */ 139090792Sgshapiro 139190792Sgshapiro 139290792Sgshapiro/* 139390792Sgshapiro** RISC/os 4.52 139490792Sgshapiro** 139590792Sgshapiro** Gives a ton of warning messages, but otherwise compiles. 139690792Sgshapiro*/ 139790792Sgshapiro 139890792Sgshapiro# ifdef RISCOS 139990792Sgshapiro 140090792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 140190792Sgshapiro# ifndef HASFLOCK 140290792Sgshapiro# define HASFLOCK 1 /* has flock(2) call */ 140390792Sgshapiro# endif /* ! HASFLOCK */ 140490792Sgshapiro# define WAITUNION 1 /* use "union wait" as wait argument type */ 140590792Sgshapiro# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 140690792Sgshapiro# define NEEDPUTENV 1 /* need putenv(3) call */ 140790792Sgshapiro# define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 140890792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 140990792Sgshapiro# define LA_TYPE LA_INT 141090792Sgshapiro# define LA_AVENRUN "avenrun" 141190792Sgshapiro# define _PATH_UNIX "/unix" 141290792Sgshapiro# undef WIFEXITED 141390792Sgshapiro 141490792Sgshapiro# define setpgid setpgrp 141590792Sgshapiro 141690792Sgshapirotypedef int pid_t; 141790792Sgshapiro# define SIGFUNC_DEFINED 141890792Sgshapiro# define SIGFUNC_RETURN (0) 141990792Sgshapiro# define SIGFUNC_DECL int 142090792Sgshapirotypedef int (*sigfunc_t)(); 142190792Sgshapiroextern char *getenv(); 142290792Sgshapiroextern void *malloc(); 142390792Sgshapiro 142490792Sgshapiro/* added for RISC/os 4.01...which is dumber than 4.50 */ 142590792Sgshapiro# ifdef RISCOS_4_0 142690792Sgshapiro# ifndef ARBPTR_T 142790792Sgshapiro# define ARBPTR_T char * 142890792Sgshapiro# endif /* ! ARBPTR_T */ 142990792Sgshapiro# undef HASFLOCK 143090792Sgshapiro# define HASFLOCK 0 143190792Sgshapiro# endif /* RISCOS_4_0 */ 143290792Sgshapiro 143390792Sgshapiro# include <sys/time.h> 143490792Sgshapiro 143590792Sgshapiro# endif /* RISCOS */ 143690792Sgshapiro 143790792Sgshapiro 143890792Sgshapiro/* 143990792Sgshapiro** Linux 0.99pl10 and above... 144090792Sgshapiro** 144190792Sgshapiro** Thanks to, in reverse order of contact: 144290792Sgshapiro** 144390792Sgshapiro** John Kennedy <warlock@csuchico.edu> 144490792Sgshapiro** Andrew Pam <avatar@aus.xanadu.com> 144590792Sgshapiro** Florian La Roche <rzsfl@rz.uni-sb.de> 144690792Sgshapiro** Karl London <karl@borg.demon.co.uk> 144790792Sgshapiro** 144890792Sgshapiro** NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style 144990792Sgshapiro** file locking is no longer allowed. In particular, make sure 145090792Sgshapiro** your DBM library and sendmail are both using either flock(2) 145190792Sgshapiro** *or* fcntl(2) file locking, but not both. 145290792Sgshapiro*/ 145390792Sgshapiro 145490792Sgshapiro# ifdef __linux__ 145590792Sgshapiro# include <linux/version.h> 145690792Sgshapiro# if !defined(KERNEL_VERSION) /* not defined in 2.0.x kernel series */ 145790792Sgshapiro# define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) 145890792Sgshapiro# endif /* !defined(KERNEL_VERSION) */ 145990792Sgshapiro# define BSD 1 /* include BSD defines */ 146090792Sgshapiro# define HASSETREGID 1 /* use setregid(2) to set saved gid */ 146190792Sgshapiro# ifndef REQUIRES_DIR_FSYNC 146290792Sgshapiro# define REQUIRES_DIR_FSYNC 1 /* requires fsync() on directory */ 146390792Sgshapiro# endif /* REQUIRES_DIR_FSYNC */ 146490792Sgshapiro# ifndef USESETEUID 146590792Sgshapiro# define USESETEUID 0 /* has it due to POSIX, but doesn't work */ 146690792Sgshapiro# endif /* USESETEUID */ 1467112810Sgshapiro# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 146890792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 146990792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 147090792Sgshapiro# define ERRLIST_PREDEFINED /* don't declare sys_errlist */ 147190792Sgshapiro# define GIDSET_T gid_t /* from <linux/types.h> */ 147290792Sgshapiro# ifndef HASGETUSERSHELL 147390792Sgshapiro# define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */ 147490792Sgshapiro# endif /* HASGETUSERSHELL */ 147590792Sgshapiro# ifndef IP_SRCROUTE 147690792Sgshapiro# define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */ 147790792Sgshapiro# endif /* ! IP_SRCROUTE */ 147890792Sgshapiro# ifndef HAS_IN_H 147990792Sgshapiro# define HAS_IN_H 1 /* use netinet/in.h */ 148090792Sgshapiro# endif /* ! HAS_IN_H */ 148190792Sgshapiro# ifndef USE_SIGLONGJMP 148290792Sgshapiro# define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ 148390792Sgshapiro# endif /* ! USE_SIGLONGJMP */ 148490792Sgshapiro# ifndef HASFLOCK 148590792Sgshapiro# if LINUX_VERSION_CODE < 66399 148690792Sgshapiro# define HASFLOCK 0 /* flock(2) is broken after 0.99.13 */ 148790792Sgshapiro# else /* LINUX_VERSION_CODE < 66399 */ 1488132943Sgshapiro# if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) 1489132943Sgshapiro# define HASFLOCK 1 /* flock(2) fixed after 1.3.95 */ 1490132943Sgshapiro# else /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */ 1491132943Sgshapiro# define HASFLOCK 0 /* flock(2) is broken (again) after 2.4.0 */ 1492132943Sgshapiro# endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)) */ 149390792Sgshapiro# endif /* LINUX_VERSION_CODE < 66399 */ 149490792Sgshapiro# endif /* ! HASFLOCK */ 149590792Sgshapiro# ifndef LA_TYPE 149690792Sgshapiro# define LA_TYPE LA_PROCSTR 149790792Sgshapiro# endif /* ! LA_TYPE */ 149890792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() impl */ 149990792Sgshapiro# define SPT_PADCHAR '\0' /* pad process title with nulls */ 150090792Sgshapiro# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) 150190792Sgshapiro# ifndef HASURANDOMDEV 150290792Sgshapiro# define HASURANDOMDEV 1 /* 2.0 (at least) has linux/drivers/char/random.c */ 150390792Sgshapiro# endif /* ! HASURANDOMDEV */ 150490792Sgshapiro# endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) */ 1505120256Sgshapiro# if defined(__GLIBC__) && defined(__GLIBC_MINOR__) 1506132943Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 1507120256Sgshapiro# endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */ 150890792Sgshapiro# ifndef TZ_TYPE 150990792Sgshapiro# define TZ_TYPE TZ_NONE /* no standard for Linux */ 151090792Sgshapiro# endif /* ! TZ_TYPE */ 151198841Sgshapiro# if (__GLIBC__ >= 2) 151298841Sgshapiro# include <paths.h> 151398841Sgshapiro# endif /* (__GLIBC__ >= 2) */ 151490792Sgshapiro# ifndef _PATH_SENDMAILPID 151590792Sgshapiro# define _PATH_SENDMAILPID "/var/run/sendmail.pid" 151690792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 151790792Sgshapiro# include <sys/sysmacros.h> 151890792Sgshapiro# undef atol /* wounded in <stdlib.h> */ 151990792Sgshapiro# if NETINET6 152090792Sgshapiro /* 152190792Sgshapiro ** Linux doesn't have a good way to tell userland what interfaces are 152290792Sgshapiro ** IPv6-capable. Therefore, the BIND resolver can not determine if there 152390792Sgshapiro ** are IPv6 interfaces to honor AI_ADDRCONFIG. Unfortunately, it assumes 152490792Sgshapiro ** that none are present. (Excuse the macro name ADDRCONFIG_IS_BROKEN.) 152590792Sgshapiro */ 152690792Sgshapiro# define ADDRCONFIG_IS_BROKEN 1 152790792Sgshapiro 152890792Sgshapiro /* 152990792Sgshapiro ** Indirectly included from glibc's <feature.h>. IPv6 support is native 153090792Sgshapiro ** in 2.1 and later, but the APIs appear before the functions. 153190792Sgshapiro */ 153290792Sgshapiro# if defined(__GLIBC__) && defined(__GLIBC_MINOR__) 153390792Sgshapiro# define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__) 153490792Sgshapiro# if (GLIBC_VERSION >= 0x201) 1535261194Sgshapiro# define SOCKADDR_LEN_T socklen_t 1536261194Sgshapiro# define SOCKOPT_LEN_T socklen_t 153790792Sgshapiro# undef IPPROTO_ICMPV6 /* linux #defines, glibc enums */ 153890792Sgshapiro# else /* (GLIBC_VERSION >= 0x201) */ 153990792Sgshapiro# include <linux/in6.h> /* IPv6 support */ 154090792Sgshapiro# endif /* (GLIBC_VERSION >= 0x201) */ 154190792Sgshapiro# if (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) 154290792Sgshapiro /* Have APIs in <netdb.h>, but no support in glibc */ 154390792Sgshapiro# define NEEDSGETIPNODE 1 154490792Sgshapiro# endif /* (GLIBC_VERSION >= 0x201 && !defined(NEEDSGETIPNODE)) */ 154590792Sgshapiro# undef GLIBC_VERSION 154690792Sgshapiro# endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */ 154790792Sgshapiro# endif /* NETINET6 */ 154890792Sgshapiro# ifndef HASFCHOWN 154990792Sgshapiro# define HASFCHOWN 1 /* fchown(2) */ 155090792Sgshapiro# endif /* ! HASFCHOWN */ 155190792Sgshapiro# if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) 155290792Sgshapiro# define HASFCHMOD 1 /* fchmod(2) */ 155390792Sgshapiro# endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,36)) && !defined(HASFCHMOD) */ 155490792Sgshapiro# endif /* __linux__ */ 155590792Sgshapiro 155690792Sgshapiro 155790792Sgshapiro/* 155890792Sgshapiro** DELL SVR4 Issue 2.2, and others 155990792Sgshapiro** From Kimmo Suominen <kim@grendel.lut.fi> 156090792Sgshapiro** 156190792Sgshapiro** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ 156290792Sgshapiro** defined, and the definitions conflict. 156390792Sgshapiro** 156490792Sgshapiro** Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid 156590792Sgshapiro** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A 156690792Sgshapiro** (SVR4.0/386 version 3.0). 156790792Sgshapiro*/ 156890792Sgshapiro 156990792Sgshapiro# ifdef DELL_SVR4 157090792Sgshapiro /* no changes necessary */ 157190792Sgshapiro /* see general __svr4__ defines below */ 157290792Sgshapiro# endif /* DELL_SVR4 */ 157390792Sgshapiro 157490792Sgshapiro 157590792Sgshapiro/* 157690792Sgshapiro** Apple A/UX 3.0 157790792Sgshapiro*/ 157890792Sgshapiro 157990792Sgshapiro# ifdef _AUX_SOURCE 158090792Sgshapiro# include <sys/sysmacros.h> 158190792Sgshapiro# define BSD /* has BSD routines */ 158290792Sgshapiro# define HASSETRLIMIT 0 /* ... but not setrlimit(2) */ 158390792Sgshapiro# define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ 158490792Sgshapiro# define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */ 158590792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 158690792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 158790792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 158890792Sgshapiro# define HASSETVBUF 1 /* has setvbuf(3) in libc */ 158990792Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 159090792Sgshapiro# define SIGFUNC_DEFINED /* sigfunc_t already defined */ 159190792Sgshapiro# define SIGFUNC_RETURN /* POSIX-mode */ 159290792Sgshapiro# define SIGFUNC_DECL void /* POSIX-mode */ 159390792Sgshapiro# define ERRLIST_PREDEFINED 1 159490792Sgshapiro# ifndef IDENTPROTO 159590792Sgshapiro# define IDENTPROTO 0 /* TCP/IP implementation is broken */ 159690792Sgshapiro# endif /* ! IDENTPROTO */ 159790792Sgshapiro# ifndef LA_TYPE 159890792Sgshapiro# define LA_TYPE LA_INT 159990792Sgshapiro# define FSHIFT 16 160090792Sgshapiro# endif /* ! LA_TYPE */ 160190792Sgshapiro# define LA_AVENRUN "avenrun" 160290792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 160390792Sgshapiro# define TZ_TYPE TZ_TZNAME 160490792Sgshapiro# ifndef _PATH_UNIX 160590792Sgshapiro# define _PATH_UNIX "/unix" /* should be in <paths.h> */ 160690792Sgshapiro# endif /* ! _PATH_UNIX */ 160790792Sgshapiro# ifndef _PATH_VENDOR_CF 160890792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 160990792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 161090792Sgshapiro# undef WIFEXITED 161190792Sgshapiro# undef WEXITSTATUS 161290792Sgshapiro# endif /* _AUX_SOURCE */ 161390792Sgshapiro 161490792Sgshapiro 161590792Sgshapiro/* 161690792Sgshapiro** Encore UMAX V 161790792Sgshapiro** 161890792Sgshapiro** Not extensively tested. 161990792Sgshapiro*/ 162090792Sgshapiro 162190792Sgshapiro# ifdef UMAXV 162290792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 162390792Sgshapiro# define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 162490792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 162590792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 162690792Sgshapiro# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 162790792Sgshapiro# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 162890792Sgshapiro# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 162990792Sgshapiro# define MAXPATHLEN PATH_MAX 163090792Sgshapiroextern struct passwd *getpwent(), *getpwnam(), *getpwuid(); 163190792Sgshapiroextern struct group *getgrent(), *getgrnam(), *getgrgid(); 163290792Sgshapiro# undef WIFEXITED 163390792Sgshapiro# undef WEXITSTATUS 163490792Sgshapiro# endif /* UMAXV */ 163590792Sgshapiro 163690792Sgshapiro 163790792Sgshapiro/* 163890792Sgshapiro** Stardent Titan 3000 running TitanOS 4.2. 163990792Sgshapiro** 164090792Sgshapiro** Must be compiled in "cc -43" mode. 164190792Sgshapiro** 164290792Sgshapiro** From Kate Hedstrom <kate@ahab.rutgers.edu>. 164390792Sgshapiro** 164490792Sgshapiro** Note the tweaking below after the BSD defines are set. 164590792Sgshapiro*/ 164690792Sgshapiro 164790792Sgshapiro# ifdef titan 164890792Sgshapiro# define setpgid setpgrp 164990792Sgshapirotypedef int pid_t; 165090792Sgshapiro# undef WIFEXITED 165190792Sgshapiro# undef WEXITSTATUS 165290792Sgshapiro# endif /* titan */ 165390792Sgshapiro 165490792Sgshapiro 165590792Sgshapiro/* 165690792Sgshapiro** Sequent DYNIX 3.2.0 165790792Sgshapiro** 165890792Sgshapiro** From Jim Davis <jdavis@cs.arizona.edu>. 165990792Sgshapiro*/ 166090792Sgshapiro 166190792Sgshapiro# ifdef sequent 166290792Sgshapiro 166390792Sgshapiro# define BSD 1 166490792Sgshapiro# define HASUNSETENV 1 166590792Sgshapiro# define BSD4_3 1 /* to get signal() in conf.c */ 166690792Sgshapiro# define WAITUNION 1 166790792Sgshapiro# define LA_TYPE LA_FLOAT 166890792Sgshapiro# ifdef _POSIX_VERSION 166990792Sgshapiro# undef _POSIX_VERSION /* set in <unistd.h> */ 167090792Sgshapiro# endif /* _POSIX_VERSION */ 167190792Sgshapiro# undef HASSETVBUF /* don't actually have setvbuf(3) */ 167290792Sgshapiro# define setpgid setpgrp 167390792Sgshapiro 167490792Sgshapiro/* Have to redefine WIFEXITED to take an int, to work with waitfor() */ 167590792Sgshapiro# undef WIFEXITED 167690792Sgshapiro# define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ 167790792Sgshapiro ((union wait*)&(s))->w_termsig == 0) 167890792Sgshapiro# define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) 167990792Sgshapirotypedef int pid_t; 168090792Sgshapiro# define isgraph(c) (isprint(c) && (c != ' ')) 168190792Sgshapiro 168290792Sgshapiro# ifndef IDENTPROTO 168390792Sgshapiro# define IDENTPROTO 0 /* TCP/IP implementation is broken */ 168490792Sgshapiro# endif /* ! IDENTPROTO */ 168590792Sgshapiro 168690792Sgshapiro# ifndef _PATH_UNIX 168790792Sgshapiro# define _PATH_UNIX "/dynix" 168890792Sgshapiro# endif /* ! _PATH_UNIX */ 168990792Sgshapiro# ifndef _PATH_VENDOR_CF 169090792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 169190792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 169290792Sgshapiro# endif /* sequent */ 169390792Sgshapiro 169490792Sgshapiro 169590792Sgshapiro/* 169690792Sgshapiro** Sequent DYNIX/ptx v2.0 (and higher) 169790792Sgshapiro** 169890792Sgshapiro** For DYNIX/ptx v1.x, undefine HASSETREUID. 169990792Sgshapiro** 170090792Sgshapiro** From Tim Wright <timw@sequent.com>. 170190792Sgshapiro** Update from Jack Woolley <jwoolley@sctcorp.com>, 26 Dec 1995, 170290792Sgshapiro** for DYNIX/ptx 4.0.2. 170390792Sgshapiro*/ 170490792Sgshapiro 170590792Sgshapiro# ifdef _SEQUENT_ 170690792Sgshapiro# include <sys/stream.h> 170790792Sgshapiro# define SYSTEM5 1 /* include all the System V defines */ 170890792Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 170990792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 171090792Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 171190792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 171290792Sgshapiro# define GIDSET_T gid_t 171390792Sgshapiro# define LA_TYPE LA_INT 171490792Sgshapiro# define SFS_TYPE SFS_STATFS /* use <sys/statfs.h> statfs() impl */ 171590792Sgshapiro# define SPT_TYPE SPT_NONE /* don't use setproctitle */ 171690792Sgshapiro# ifndef IDENTPROTO 171790792Sgshapiro# define IDENTPROTO 0 /* TCP/IP implementation is broken */ 171890792Sgshapiro# endif /* ! IDENTPROTO */ 171990792Sgshapiro# ifndef _PATH_VENDOR_CF 172090792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 172190792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 172290792Sgshapiro# ifndef _PATH_SENDMAILPID 172390792Sgshapiro# define _PATH_SENDMAILPID "/etc/sendmail.pid" 172490792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 172590792Sgshapiro# endif /* _SEQUENT_ */ 172690792Sgshapiro 172790792Sgshapiro/* 1728132943Sgshapiro** Cray UNICOS, UNICOS/mk, and UNICOS/mp 172990792Sgshapiro** 1730132943Sgshapiro** UNICOS: 173190792Sgshapiro** Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov> 1732132943Sgshapiro** Update Brian Ginsbach <ginsbach@cray.com> 1733132943Sgshapiro** UNICOS/mk (Cray T3E): 1734132943Sgshapiro** Contributed by Manu Mahonen <mailadm@csc.fi> 1735132943Sgshapiro** of Center for Scientific Computing. 1736132943Sgshapiro** Update Brian Ginsbach <ginsbach@cray.com> 1737132943Sgshapiro** UNICOS/mp: 1738132943Sgshapiro** From Aaron Davis <awd@cray.com> & Brian Ginsbach <ginsbach@cray.com> 173990792Sgshapiro*/ 174090792Sgshapiro 1741132943Sgshapiro# if defined(_CRAY) || defined(UNICOS) || defined(_UNICOSMP) 174290792Sgshapiro# define SYSTEM5 1 /* include all the System V defines */ 1743132943Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 1744132943Sgshapiro# define HASFCHOWN 1 /* has fchown(2) */ 1745132943Sgshapiro# define HASUNSETENV 1 /* has unsetenv(3) call */ 1746132943Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 1747132943Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 1748132943Sgshapiro# define USESETEUID 1 /* has usable seteuid(2) call */ 1749132943Sgshapiro# define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */ 1750132943Sgshapiro# define HASSTRERROR 1 /* has strerror(3) */ 1751132943Sgshapiro# define GIDSET_T gid_t 175290792Sgshapiro# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 1753132943Sgshapiro# define SFS_BAVAIL f_bfree /* alternate field name */ 1754132943Sgshapiro# define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ 1755132943Sgshapiro# ifdef UNICOS 1756132943Sgshapiro# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 1757132943Sgshapiro# define LA_TYPE LA_ZERO 1758132943Sgshapiro# define _PATH_MAILDIR "/usr/spool/mail" 1759132943Sgshapiro# define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst) 1760132943Sgshapiro# ifndef MAXPATHLEN 1761132943Sgshapiro# define MAXPATHLEN PATHSIZE 1762132943Sgshapiro# endif /* ! MAXPATHLEN */ 1763132943Sgshapiro# ifndef _PATH_UNIX 1764132943Sgshapiro# ifdef UNICOSMK 1765132943Sgshapiro# define _PATH_UNIX "/unicosmk.ar" 1766132943Sgshapiro# else 1767132943Sgshapiro# define _PATH_UNIX "/unicos" 1768132943Sgshapiro# endif /* UNICOSMK */ 1769132943Sgshapiro# endif /* ! _PATH_UNIX */ 1770132943Sgshapiro# ifndef _PATH_VENDOR_CF 1771132943Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 1772132943Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 1773132943Sgshapiro# endif /* UNICOS */ 1774132943Sgshapiro# ifdef _UNICOSMP 1775132943Sgshapiro# if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) 1776132943Sgshapiro /* _SC_NPROC_ONLN is 'mpadmin -u', total # of unrestricted processors */ 1777132943Sgshapiro# define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN 1778132943Sgshapiro# endif /* if defined(_SC_NPROC_ONLN) && !defined(_SC_NPROCESSORS_ONLN) */ 1779132943Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 1780132943Sgshapiro# define HASSETRLIMIT 1 /* has setrlimit(2) syscall */ 1781132943Sgshapiro# define LA_TYPE LA_IRIX6 /* figure out at run time */ 1782132943Sgshapiro# include <sys/cdefs.h> 1783132943Sgshapiro# include <paths.h> 1784132943Sgshapiro# define ARGV_T char *const * 1785132943Sgshapiro# endif /* _UNICOSMP */ 1786132943Sgshapiro# endif /* _CRAY */ 178790792Sgshapiro 178890792Sgshapiro/* 178990792Sgshapiro** Apollo DomainOS 179090792Sgshapiro** 179190792Sgshapiro** From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com> 179290792Sgshapiro** 179390792Sgshapiro** 15 Jan 1994; updated 2 Aug 1995 179490792Sgshapiro** 179590792Sgshapiro*/ 179690792Sgshapiro 179790792Sgshapiro# ifdef apollo 179890792Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 179990792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(2) call */ 180090792Sgshapiro# define IP_SRCROUTE 0 /* does not have <netinet/ip_var.h> */ 180190792Sgshapiro# define SPT_TYPE SPT_NONE /* don't use setproctitle */ 180290792Sgshapiro# define LA_TYPE LA_SUBR /* use getloadavg.c */ 180390792Sgshapiro# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 180490792Sgshapiro# define SFS_BAVAIL f_bfree /* alternate field name */ 180590792Sgshapiro# define TZ_TYPE TZ_TZNAME 180690792Sgshapiro# ifndef _PATH_VENDOR_CF 180790792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 180890792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 180990792Sgshapiro# ifndef _PATH_SENDMAILPID 181090792Sgshapiro# define _PATH_SENDMAILPID "/etc/sendmail.pid" 181190792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 181290792Sgshapiro# undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ 181390792Sgshapiro# undef S_IFIFO 181490792Sgshapiro# define S_IFIFO 0010000 181590792Sgshapiro# ifndef IDENTPROTO 181690792Sgshapiro# define IDENTPROTO 0 /* TCP/IP implementation is broken */ 181790792Sgshapiro# endif /* ! IDENTPROTO */ 181890792Sgshapiro# define RLIMIT_NEEDS_SYS_TIME_H 1 181990792Sgshapiro# if defined(NGROUPS_MAX) && !NGROUPS_MAX 182090792Sgshapiro# undef NGROUPS_MAX 182190792Sgshapiro# endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */ 182290792Sgshapiro# endif /* apollo */ 182390792Sgshapiro 182490792Sgshapiro/* 182590792Sgshapiro** MPE-iX 182690792Sgshapiro** 182790792Sgshapiro** Requires MPE 6.0 or greater. See sendmail/README for more info. 182890792Sgshapiro** 182990792Sgshapiro** From Mark Bixby <mark_bixby@hp.com> or <mark@bixby.org>. 183090792Sgshapiro*/ 183190792Sgshapiro 183290792Sgshapiro# ifdef MPE 183390792Sgshapiro 183490792Sgshapiro# include <sys/sysmacros.h> 183590792Sgshapiro# include <fcntl.h> 183690792Sgshapiro 183790792Sgshapiro/* Sendmail stuff */ 183890792Sgshapiro# define HASFCHOWN 0 /* lacks fchown() */ 183990792Sgshapiro# define HASGETUSERSHELL 0 /* lacks getusershell() */ 184090792Sgshapiro# ifdef HASNICE 184190792Sgshapiro# undef HASNICE 184290792Sgshapiro# endif /* HASNICE */ 184390792Sgshapiro# define HASNICE 0 /* lacks nice() */ 184490792Sgshapiro# define HASRANDOM 0 /* lacks random() */ 184590792Sgshapiro# ifdef HASRRESVPORT 184690792Sgshapiro# undef HASRRESVPORT 184790792Sgshapiro# endif /* HASRRESVPORT */ 184890792Sgshapiro# define HASRRESVPORT 0 /* lacks rresvport() */ 184990792Sgshapiro# define IP_SRCROUTE 0 /* lacks IP source routing fields */ 185090792Sgshapiro# ifdef MATCHGECOS 185190792Sgshapiro# undef MATCHGECOS 185290792Sgshapiro# endif /* MATCHGECOS */ 185390792Sgshapiro# define MATCHGECOS 0 /* lacks an initialized GECOS field */ 185490792Sgshapiro# define NEEDFSYNC 1 /* use sendmail's fsync() */ 185590792Sgshapiro# define NEEDLINK 1 /* use sendmail's link() */ 185690792Sgshapiro# define NOFTRUNCATE 1 /* lacks ftruncate() */ 185790792Sgshapiro# define SFS_TYPE SFS_NONE /* can't determine disk space */ 185890792Sgshapiro# define SM_CONF_SYSLOG 0 /* use sendmail decl of syslog() */ 185990792Sgshapiro# define USE_DOUBLE_FORK 0 /* don't fork an intermediate zombie */ 186090792Sgshapiro# define USE_ENVIRON 1 /* use environ instead of envp */ 186190792Sgshapiro 186290792Sgshapiro/* Missing header stuff */ 186390792Sgshapiro# define AF_UNSPEC 0 186490792Sgshapiro# define AF_MAX AF_INET 186590792Sgshapiro# define IFF_LOOPBACK 0x8 186690792Sgshapiro# define IN_LOOPBACKNET 127 186790792Sgshapiro# define MAXNAMLEN NAME_MAX 186890792Sgshapiro# define S_IEXEC S_IXUSR 186990792Sgshapiro# define S_IREAD S_IRUSR 187090792Sgshapiro# define S_IWRITE S_IWUSR 187190792Sgshapiro 187290792Sgshapiro/* Present header stuff that needs to be missing */ 187390792Sgshapiro# undef NGROUPS_MAX 187490792Sgshapiro 187590792Sgshapiro/* Shadow functions */ 187690792Sgshapiro# define bind sendmail_mpe_bind 187790792Sgshapiro# define _exit sendmail_mpe__exit 187890792Sgshapiro# define exit sendmail_mpe_exit 187990792Sgshapiro# define fcntl sendmail_mpe_fcntl 188090792Sgshapiro# define getegid sendmail_mpe_getegid 188190792Sgshapiro# define geteuid sendmail_mpe_geteuid 188290792Sgshapiro# define getpwnam sendmail_mpe_getpwnam 188390792Sgshapiro# define getpwuid sendmail_mpe_getpwuid 188490792Sgshapiro# define setgid sendmail_mpe_setgid 188590792Sgshapiro# define setuid sendmail_mpe_setuid 188690792Sgshapiroextern int sendmail_mpe_fcntl __P((int, int, ...)); 188790792Sgshapiroextern struct passwd * sendmail_mpe_getpwnam __P((const char *)); 188890792Sgshapiroextern struct passwd * sendmail_mpe_getpwuid __P((uid_t)); 188990792Sgshapiro# endif /* MPE */ 189090792Sgshapiro 189190792Sgshapiro/* 189290792Sgshapiro** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native) 189390792Sgshapiro** 189490792Sgshapiro** Contributed by Paul Gampe <paulg@apnic.net> 189590792Sgshapiro*/ 189690792Sgshapiro 189790792Sgshapiro# ifdef __svr5__ 189890792Sgshapiro# include <sys/mkdev.h> 189990792Sgshapiro# define __svr4__ 190090792Sgshapiro# define SYS5SIGNALS 1 190190792Sgshapiro# define HASFCHOWN 1 /* has fchown(2) call */ 1902132943Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 190390792Sgshapiro# define HASSETREUID 1 190490792Sgshapiro# define HASWAITPID 1 190590792Sgshapiro# define HASGETDTABLESIZE 1 190690792Sgshapiro# define GIDSET_T gid_t 1907147078Sgshapiro# define SOCKADDR_LEN_T size_t 190890792Sgshapiro# define SOCKOPT_LEN_T size_t 190990792Sgshapiro# ifndef _PATH_UNIX 191090792Sgshapiro# define _PATH_UNIX "/stand/unix" 191190792Sgshapiro# endif /* ! _PATH_UNIX */ 191290792Sgshapiro# define SPT_PADCHAR '\0' /* pad process title with nulls */ 191390792Sgshapiro# ifndef SYSLOG_BUFSIZE 191490792Sgshapiro# define SYSLOG_BUFSIZE 1024 /* unsure */ 191590792Sgshapiro# endif /* ! SYSLOG_BUFSIZE */ 191690792Sgshapiro# ifndef _PATH_VENDOR_CF 191790792Sgshapiro# define _PATH_VENDOR_CF "/etc/sendmail.cf" 191890792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 191990792Sgshapiro# ifndef _PATH_SENDMAILPID 192090792Sgshapiro# define _PATH_SENDMAILPID "/etc/sendmail.pid" 192190792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 192290792Sgshapiro# undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */ 192390792Sgshapiro#if !defined(SM_SET_H_ERRNO) && defined(_REENTRANT) 192490792Sgshapiro# define SM_SET_H_ERRNO(err) set_h_errno((err)) 192590792Sgshapiro#endif /* ! SM_SET_H_ERRNO && _REENTRANT */ 192690792Sgshapiro# endif /* __svr5__ */ 192790792Sgshapiro 192890792Sgshapiro/* ###################################################################### */ 192990792Sgshapiro 193090792Sgshapiro/* 193190792Sgshapiro** UnixWare 2.x 193290792Sgshapiro*/ 193390792Sgshapiro 193490792Sgshapiro# ifdef UNIXWARE2 193590792Sgshapiro# define UNIXWARE 1 193690792Sgshapiro# undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */ 193790792Sgshapiro# endif /* UNIXWARE2 */ 193890792Sgshapiro 193990792Sgshapiro 194090792Sgshapiro/* 194190792Sgshapiro** UnixWare 1.1.2. 194290792Sgshapiro** 194390792Sgshapiro** Updated by Petr Lampa <lampa@fee.vutbr.cz>. 194490792Sgshapiro** From Evan Champion <evanc@spatial.synapse.org>. 194590792Sgshapiro*/ 194690792Sgshapiro 194790792Sgshapiro# ifdef UNIXWARE 194890792Sgshapiro# include <sys/mkdev.h> 194990792Sgshapiro# define SYSTEM5 1 195090792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 195190792Sgshapiro# define HASSETREUID 1 1952132943Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 195390792Sgshapiro# define HASINITGROUPS 1 195490792Sgshapiro# define GIDSET_T gid_t 195590792Sgshapiro# define SLEEP_T unsigned 195690792Sgshapiro# define SFS_TYPE SFS_STATVFS 195790792Sgshapiro# define LA_TYPE LA_ZERO 195890792Sgshapiro# undef WIFEXITED 195990792Sgshapiro# undef WEXITSTATUS 196090792Sgshapiro# ifndef _PATH_UNIX 196190792Sgshapiro# define _PATH_UNIX "/unix" 196290792Sgshapiro# endif /* ! _PATH_UNIX */ 196390792Sgshapiro# ifndef _PATH_VENDOR_CF 196490792Sgshapiro# define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 196590792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 196690792Sgshapiro# ifndef _PATH_SENDMAILPID 196790792Sgshapiro# define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 196890792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 196990792Sgshapiro# define SYSLOG_BUFSIZE 128 197090792Sgshapiro# endif /* UNIXWARE */ 197190792Sgshapiro 197290792Sgshapiro 197390792Sgshapiro/* 197490792Sgshapiro** Intergraph CLIX 3.1 197590792Sgshapiro** 197690792Sgshapiro** From Paul Southworth <pauls@locust.cic.net> 197790792Sgshapiro*/ 197890792Sgshapiro 197990792Sgshapiro# ifdef CLIX 198090792Sgshapiro# define SYSTEM5 1 /* looks like System V */ 198190792Sgshapiro# ifndef HASGETUSERSHELL 198290792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 198390792Sgshapiro# endif /* ! HASGETUSERSHELL */ 198490792Sgshapiro# define DEV_BSIZE 512 /* device block size not defined */ 198590792Sgshapiro# define GIDSET_T gid_t 198690792Sgshapiro# undef LOG /* syslog not available */ 198790792Sgshapiro# define NEEDFSYNC 1 /* no fsync in system library */ 198890792Sgshapiro# define GETSHORT _getshort 198990792Sgshapiro# endif /* CLIX */ 199090792Sgshapiro 199190792Sgshapiro 199290792Sgshapiro/* 199390792Sgshapiro** NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP 199490792Sgshapiro** 199590792Sgshapiro** From Kevin Darcy <kevin@tech.mis.cfc.com>. 199690792Sgshapiro*/ 199790792Sgshapiro 199890792Sgshapiro# ifdef NCR_MP_RAS2 199990792Sgshapiro# include <sys/sockio.h> 200090792Sgshapiro# define __svr4__ 200190792Sgshapiro# define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ 200290792Sgshapiro# define SYSLOG_BUFSIZE 1024 200390792Sgshapiro# define SPT_TYPE SPT_NONE 200490792Sgshapiro# endif /* NCR_MP_RAS2 */ 200590792Sgshapiro 200690792Sgshapiro 200790792Sgshapiro/* 200890792Sgshapiro** NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP 200990792Sgshapiro** 201090792Sgshapiro** From Tom Moore <Tom.Moore@DaytonOH.NCR.COM> 201190792Sgshapiro*/ 201290792Sgshapiro 201390792Sgshapiro# ifdef NCR_MP_RAS3 201490792Sgshapiro# define __svr4__ 201590792Sgshapiro# define HASFCHOWN 1 /* has fchown(2) call */ 201690792Sgshapiro# define LDA_USE_LOCKF 1 201790792Sgshapiro# define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM has non-std interface */ 201890792Sgshapiro# define SO_REUSEADDR_IS_BROKEN 1 /* doesn't work if accept() fails */ 201990792Sgshapiro# define SYSLOG_BUFSIZE 1024 202090792Sgshapiro# define SPT_TYPE SPT_NONE 202190792Sgshapiro# define _PATH_MAILDIR "/var/mail" 202290792Sgshapiro# ifndef _XOPEN_SOURCE 202390792Sgshapiro# define _XOPEN_SOURCE 202490792Sgshapiro# define _XOPEN_SOURCE_EXTENDED 1 202590792Sgshapiro# include <sys/resource.h> 202690792Sgshapiro# undef _XOPEN_SOURCE 202790792Sgshapiro# undef _XOPEN_SOURCE_EXTENDED 202890792Sgshapiro# endif /* ! _XOPEN_SOURCE */ 202990792Sgshapiro# endif /* NCR_MP_RAS3 */ 203090792Sgshapiro 203190792Sgshapiro 203290792Sgshapiro/* 203390792Sgshapiro** Tandem NonStop-UX SVR4 203490792Sgshapiro** 203590792Sgshapiro** From Rick McCarty <mccarty@mpd.tandem.com>. 203690792Sgshapiro*/ 203790792Sgshapiro 203890792Sgshapiro# ifdef NonStop_UX_BXX 203990792Sgshapiro# define __svr4__ 204090792Sgshapiro# endif /* NonStop_UX_BXX */ 204190792Sgshapiro 204290792Sgshapiro 204390792Sgshapiro/* 204490792Sgshapiro** Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2. 204590792Sgshapiro** 204690792Sgshapiro** Tested for 1.04, 1.03 204790792Sgshapiro** From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>. 204890792Sgshapiro** 204990792Sgshapiro** Tested for 4.02, 6.10 and 7.10 205090792Sgshapiro** From Motonori NAKAMURA <motonori@media.kyoto-u.ac.jp>. 205190792Sgshapiro*/ 205290792Sgshapiro 205390792Sgshapiro# if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) 205490792Sgshapiro# define SYSTEM5 1 /* include all the System V defines */ 205590792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 205690792Sgshapiro# define HASFCHMOD 1 /* has fchmod(2) syscall */ 205790792Sgshapiro# define setreuid(r, e) setresuid(r, e, -1) 205890792Sgshapiro# define LA_TYPE LA_FLOAT 205990792Sgshapiro# define SPT_TYPE SPT_PSTAT 206090792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 206190792Sgshapiro# ifndef HASSETVBUF 206290792Sgshapiro# define HASSETVBUF /* HI-UX has no setlinebuf */ 206390792Sgshapiro# endif /* ! HASSETVBUF */ 206490792Sgshapiro# ifndef GIDSET_T 206590792Sgshapiro# define GIDSET_T gid_t 206690792Sgshapiro# endif /* ! GIDSET_T */ 206790792Sgshapiro# ifndef _PATH_UNIX 206890792Sgshapiro# define _PATH_UNIX "/HI-UX" 206990792Sgshapiro# endif /* ! _PATH_UNIX */ 207090792Sgshapiro# ifndef _PATH_VENDOR_CF 207190792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 207290792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 207390792Sgshapiro# ifndef IDENTPROTO 207490792Sgshapiro# define IDENTPROTO 0 /* TCP/IP implementation is broken */ 207590792Sgshapiro# endif /* ! IDENTPROTO */ 207690792Sgshapiro# ifndef HASGETUSERSHELL 207790792Sgshapiro# define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ 207890792Sgshapiro# endif /* ! HASGETUSERSHELL */ 207990792Sgshapiro# define FDSET_CAST (int *) /* cast for fd_set parameters to select */ 208090792Sgshapiro 208190792Sgshapiro/* 208290792Sgshapiro** avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h 208390792Sgshapiro** on HIUX 3050 208490792Sgshapiro*/ 208590792Sgshapiro# undef m_flags 208690792Sgshapiro 208790792Sgshapiro# define SM_CONF_SYSLOG 0 208890792Sgshapiro 208990792Sgshapiro# endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */ 209090792Sgshapiro 209190792Sgshapiro 209290792Sgshapiro/* 209390792Sgshapiro** Amdahl UTS System V 2.1.5 (SVr3-based) 209490792Sgshapiro** 209590792Sgshapiro** From: Janet Jackson <janet@dialix.oz.au>. 209690792Sgshapiro*/ 209790792Sgshapiro 209890792Sgshapiro# ifdef _UTS 209990792Sgshapiro# include <sys/sysmacros.h> 210090792Sgshapiro# undef HASLSTAT /* has symlinks, but they cause problems */ 210190792Sgshapiro# define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */ 210290792Sgshapiro# define SYS5SIGNALS 1 /* System V signal semantics */ 210390792Sgshapiro# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 210490792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 210590792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) function */ 210690792Sgshapiro# define HASSETVBUF 1 /* has setvbuf(3) function */ 210790792Sgshapiro# ifndef HASGETUSERSHELL 210890792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) function */ 210990792Sgshapiro# endif /* ! HASGETUSERSHELL */ 211090792Sgshapiro# define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */ 211190792Sgshapiro# define LA_TYPE LA_ZERO /* doesn't have load average */ 211290792Sgshapiro# define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */ 211390792Sgshapiro# define SFS_BAVAIL f_bfree /* alternate field name */ 211490792Sgshapiro# define _PATH_UNIX "/unix" 211590792Sgshapiro# ifndef _PATH_VENDOR_CF 211690792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 211790792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 211890792Sgshapiro# endif /* _UTS */ 211990792Sgshapiro 212090792Sgshapiro/* 212190792Sgshapiro** Cray Computer Corporation's CSOS 212290792Sgshapiro** 212390792Sgshapiro** From Scott Bolte <scott@craycos.com>. 212490792Sgshapiro*/ 212590792Sgshapiro 212690792Sgshapiro# ifdef _CRAYCOM 212790792Sgshapiro# define SYSTEM5 1 /* include all the System V defines */ 212890792Sgshapiro# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 212990792Sgshapiro# define NEEDFSYNC 1 /* no fsync in system library */ 213090792Sgshapiro# define MAXPATHLEN PATHSIZE 213190792Sgshapiro# define LA_TYPE LA_ZERO 213290792Sgshapiro# define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ 213390792Sgshapiro# define SFS_BAVAIL f_bfree /* alternate field name */ 213490792Sgshapiro# define _POSIX_CHOWN_RESTRICTED -1 213590792Sgshapiroextern struct group *getgrent(), *getgrnam(), *getgrgid(); 213690792Sgshapiro# endif /* _CRAYCOM */ 213790792Sgshapiro 213890792Sgshapiro 213990792Sgshapiro/* 214090792Sgshapiro** Sony NEWS-OS 4.2.1R and 6.0.3 214190792Sgshapiro** 214290792Sgshapiro** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 214390792Sgshapiro*/ 214490792Sgshapiro 214590792Sgshapiro# ifdef sony_news 214690792Sgshapiro# ifndef __svr4 214790792Sgshapiro /* NEWS-OS 4.2.1R */ 214890792Sgshapiro# ifndef BSD 214990792Sgshapiro# define BSD /* has BSD routines */ 215090792Sgshapiro# endif /* ! BSD */ 215190792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(2) call */ 215290792Sgshapiro# undef HASSETVBUF /* don't actually have setvbuf(3) */ 215390792Sgshapiro# define WAITUNION 1 /* use "union wait" as wait argument type */ 215490792Sgshapiro# define LA_TYPE LA_INT 215590792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 215690792Sgshapiro# ifndef HASFLOCK 215790792Sgshapiro# define HASFLOCK 1 /* has flock(2) call */ 215890792Sgshapiro# endif /* ! HASFLOCK */ 215990792Sgshapiro# define setpgid setpgrp 216090792Sgshapiro# undef WIFEXITED 216190792Sgshapiro# undef WEXITSTATUS 216290792Sgshapiro# define MODE_T int /* system include files have no mode_t */ 216390792Sgshapirotypedef int pid_t; 216490792Sgshapirotypedef int (*sigfunc_t)(); 216590792Sgshapiro# define SIGFUNC_DEFINED 216690792Sgshapiro# define SIGFUNC_RETURN (0) 216790792Sgshapiro# define SIGFUNC_DECL int 216890792Sgshapiro 216990792Sgshapiro# else /* ! __svr4 */ 217090792Sgshapiro /* NEWS-OS 6.0.3 with /bin/cc */ 217190792Sgshapiro# ifndef __svr4__ 217290792Sgshapiro# define __svr4__ /* use all System V Release 4 defines below */ 217390792Sgshapiro# endif /* ! __svr4__ */ 2174132943Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 217590792Sgshapiro# define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ 217690792Sgshapiro# define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ 217790792Sgshapiro# ifndef SPT_TYPE 217890792Sgshapiro# define SPT_TYPE SPT_SYSMIPS /* use sysmips() (OS 6.0.2 or later) */ 217990792Sgshapiro# endif /* ! SPT_TYPE */ 218090792Sgshapiro# define GIDSET_T gid_t 218190792Sgshapiro# undef WIFEXITED 218290792Sgshapiro# undef WEXITSTATUS 218390792Sgshapiro# ifndef SYSLOG_BUFSIZE 218490792Sgshapiro# define SYSLOG_BUFSIZE 256 218590792Sgshapiro# endif /* ! SYSLOG_BUFSIZE */ 218690792Sgshapiro# define _PATH_UNIX "/stand/unix" 218790792Sgshapiro# ifndef _PATH_VENDOR_CF 218890792Sgshapiro# define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 218990792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 219090792Sgshapiro# ifndef _PATH_SENDMAILPID 219190792Sgshapiro# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 219290792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 219390792Sgshapiro 219490792Sgshapiro# endif /* ! __svr4 */ 219590792Sgshapiro# endif /* sony_news */ 219690792Sgshapiro 219790792Sgshapiro 219890792Sgshapiro/* 219990792Sgshapiro** Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach 220090792Sgshapiro** 220190792Sgshapiro** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 220290792Sgshapiro*/ 220390792Sgshapiro 220490792Sgshapiro# ifdef luna 220590792Sgshapiro# ifndef IDENTPROTO 220690792Sgshapiro# define IDENTPROTO 0 /* TCP/IP implementation is broken */ 220790792Sgshapiro# endif /* ! IDENTPROTO */ 220890792Sgshapiro# define HASUNSETENV 1 /* has unsetenv(2) call */ 220990792Sgshapiro# define NEEDPUTENV 1 /* need putenv(3) call */ 221090792Sgshapiro# define SM_CONF_GETOPT 0 /* need a replacement for getopt(3) */ 221190792Sgshapiro# define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ 221290792Sgshapiro# define WAITUNION 1 /* use "union wait" as wait argument type */ 221390792Sgshapiro# ifdef uniosb 221490792Sgshapiro# include <sys/time.h> 221590792Sgshapiro# define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ 221690792Sgshapiro# define LA_TYPE LA_INT 221790792Sgshapiro# define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 221890792Sgshapiro# endif /* uniosb */ 221990792Sgshapiro# ifdef luna2 222090792Sgshapiro# define LA_TYPE LA_SUBR 222190792Sgshapiro# define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ 222290792Sgshapiro# endif /* luna2 */ 222390792Sgshapiro# ifdef luna88k 222490792Sgshapiro# define LA_TYPE LA_INT 222590792Sgshapiro# endif /* luna88k */ 222690792Sgshapiro# define SFS_TYPE SFS_VFS /* use <sys/vfs.h> statfs() implementation */ 222790792Sgshapiro# define setpgid setpgrp 222890792Sgshapiro# undef WIFEXITED 222990792Sgshapiro# undef WEXITSTATUS 223090792Sgshapirotypedef int pid_t; 223190792Sgshapirotypedef int (*sigfunc_t)(); 223290792Sgshapiro# define SIGFUNC_DEFINED 223390792Sgshapiro# define SIGFUNC_RETURN (0) 223490792Sgshapiro# define SIGFUNC_DECL int 223590792Sgshapiroextern char *getenv(); 223690792Sgshapiro# ifndef _PATH_VENDOR_CF 223790792Sgshapiro# define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" 223890792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 223990792Sgshapiro# endif /* luna */ 224090792Sgshapiro 224190792Sgshapiro 224290792Sgshapiro/* 224390792Sgshapiro** NEC EWS-UX/V 4.2 (with /usr/ucb/cc) 224490792Sgshapiro** 224590792Sgshapiro** From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>. 224690792Sgshapiro*/ 224790792Sgshapiro 224890792Sgshapiro# if defined(nec_ews_svr4) || defined(_nec_ews_svr4) 224990792Sgshapiro# ifndef __svr4__ 225090792Sgshapiro# define __svr4__ /* use all System V Release 4 defines below */ 225190792Sgshapiro# endif /* ! __svr4__ */ 225290792Sgshapiro# define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ 2253132943Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 225490792Sgshapiro# define LA_TYPE LA_READKSYM /* use MIOC_READSYM ioctl */ 225590792Sgshapiro# define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 225690792Sgshapiro# define GIDSET_T gid_t 225790792Sgshapiro# undef WIFEXITED 225890792Sgshapiro# undef WEXITSTATUS 225990792Sgshapiro# define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ 226090792Sgshapiro# ifndef _PATH_VENDOR_CF 226190792Sgshapiro# define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 226290792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 226390792Sgshapiro# ifndef _PATH_SENDMAILPID 226490792Sgshapiro# define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 226590792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 226690792Sgshapiro# ifndef SYSLOG_BUFSIZE 226790792Sgshapiro# define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ 226890792Sgshapiro# endif /* ! SYSLOG_BUFSIZE */ 226990792Sgshapiro# endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */ 227090792Sgshapiro 227190792Sgshapiro 227290792Sgshapiro/* 227390792Sgshapiro** Fujitsu/ICL UXP/DS (For the DS/90 Series) 227490792Sgshapiro** 227590792Sgshapiro** From Diego R. Lopez <drlopez@cica.es>. 227690792Sgshapiro** Additional changes from Fumio Moriya and Toshiaki Nomura of the 227790792Sgshapiro** Fujitsu Fresoftware group <dsfrsoft@oai6.yk.fujitsu.co.jp>. 227890792Sgshapiro*/ 227990792Sgshapiro 228090792Sgshapiro# ifdef __uxp__ 228190792Sgshapiro# include <arpa/nameser.h> 228290792Sgshapiro# include <sys/sysmacros.h> 228390792Sgshapiro# include <sys/mkdev.h> 228490792Sgshapiro# define __svr4__ 228590792Sgshapiro# define HASGETUSERSHELL 0 228690792Sgshapiro# define HASFLOCK 0 228790792Sgshapiro# define _PATH_UNIX "/stand/unix" 228890792Sgshapiro# ifndef _PATH_VENDOR_CF 228990792Sgshapiro# define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 229090792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 229190792Sgshapiro# ifndef _PATH_SENDMAILPID 229290792Sgshapiro# define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 229390792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 229490792Sgshapiro# endif /* __uxp__ */ 229590792Sgshapiro 229690792Sgshapiro/* 229790792Sgshapiro** Pyramid DC/OSx 229890792Sgshapiro** 229990792Sgshapiro** From Earle Ake <akee@wpdiss1.wpafb.af.mil>. 230090792Sgshapiro*/ 230190792Sgshapiro 230290792Sgshapiro# ifdef DCOSx 230390792Sgshapiro# define GIDSET_T gid_t 230490792Sgshapiro# ifndef IDENTPROTO 230590792Sgshapiro# define IDENTPROTO 0 /* TCP/IP implementation is broken */ 230690792Sgshapiro# endif /* ! IDENTPROTO */ 230790792Sgshapiro# endif /* DCOSx */ 230890792Sgshapiro 230990792Sgshapiro/* 231090792Sgshapiro** Concurrent Computer Corporation Maxion 231190792Sgshapiro** 231290792Sgshapiro** From Donald R. Laster Jr. <laster@access.digex.net>. 231390792Sgshapiro*/ 231490792Sgshapiro 231590792Sgshapiro# ifdef __MAXION__ 231690792Sgshapiro 231790792Sgshapiro# include <sys/stream.h> 231890792Sgshapiro# define __svr4__ 1 /* SVR4.2MP */ 231990792Sgshapiro# define HASSETREUID 1 /* have setreuid(2) */ 232090792Sgshapiro# define HASLSTAT 1 /* have lstat(2) */ 232190792Sgshapiro# define HASSETRLIMIT 1 /* have setrlimit(2) */ 232290792Sgshapiro# define HASGETDTABLESIZE 1 /* have getdtablesize(2) */ 232390792Sgshapiro# define HASGETUSERSHELL 1 /* have getusershell(3) */ 232490792Sgshapiro# define NOFTRUNCATE 1 /* do not have ftruncate(2) */ 232590792Sgshapiro# define SLEEP_T unsigned 232690792Sgshapiro# define SFS_TYPE SFS_STATVFS 232790792Sgshapiro# define SFS_BAVAIL f_bavail 232890792Sgshapiro# ifndef SYSLOG_BUFSIZE 232990792Sgshapiro# define SYSLOG_BUFSIZE 256 /* Use 256 bytes */ 233090792Sgshapiro# endif /* ! SYSLOG_BUFSIZE */ 233190792Sgshapiro 233290792Sgshapiro# undef WUNTRACED 233390792Sgshapiro# undef WIFEXITED 233490792Sgshapiro# undef WIFSIGNALED 233590792Sgshapiro# undef WIFSTOPPED 233690792Sgshapiro# undef WEXITSTATUS 233790792Sgshapiro# undef WTERMSIG 233890792Sgshapiro# undef WSTOPSIG 233990792Sgshapiro 234090792Sgshapiro# endif /* __MAXION__ */ 234190792Sgshapiro 234290792Sgshapiro/* 234390792Sgshapiro** Harris Nighthawk PowerUX (nh6000 box) 234490792Sgshapiro** 234590792Sgshapiro** Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com> 234690792Sgshapiro*/ 234790792Sgshapiro 234890792Sgshapiro# ifdef _PowerUX 234990792Sgshapiro# ifndef __svr4__ 235090792Sgshapiro# define __svr4__ 235190792Sgshapiro# endif /* ! __svr4__ */ 235290792Sgshapiro# ifndef _PATH_VENDOR_CF 235390792Sgshapiro# define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" 235490792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 235590792Sgshapiro# ifndef _PATH_SENDMAILPID 235690792Sgshapiro# define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" 235790792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 235890792Sgshapiro# define SYSLOG_BUFSIZE 1024 235990792Sgshapiro# define LA_TYPE LA_ZERO 236090792Sgshapirotypedef struct msgb mblk_t; 236190792Sgshapiro# undef offsetof /* avoid stddefs.h and sys/sysmacros.h conflict */ 236290792Sgshapiro# endif /* _PowerUX */ 236390792Sgshapiro 236490792Sgshapiro/* 236590792Sgshapiro** Siemens Nixdorf Informationssysteme AG SINIX 236690792Sgshapiro** 236790792Sgshapiro** Contributed by Gerald Rinske of Siemens Business Services VAS. 236890792Sgshapiro*/ 236990792Sgshapiro# ifdef sinix 237090792Sgshapiro# define HASRANDOM 0 /* has random(3) */ 237190792Sgshapiro# define SYSLOG_BUFSIZE 1024 237290792Sgshapiro# define SM_INT32 int /* 32bit integer */ 237390792Sgshapiro# endif /* sinix */ 237490792Sgshapiro 237590792Sgshapiro 237690792Sgshapiro/* 237790792Sgshapiro** Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3 237890792Sgshapiro** 237990792Sgshapiro** Contributed by Sergey Rusanov <rsm@utfoms.udmnet.ru> 238090792Sgshapiro*/ 238190792Sgshapiro 238290792Sgshapiro# ifdef MOTO 238390792Sgshapiro# define HASFCHMOD 1 238490792Sgshapiro# define HASSETRLIMIT 0 2385132943Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 238690792Sgshapiro# define HASSETREUID 1 238790792Sgshapiro# define HASULIMIT 1 238890792Sgshapiro# define HASWAITPID 1 238990792Sgshapiro# define HASGETDTABLESIZE 1 239090792Sgshapiro# define HASGETUSERSHELL 1 239190792Sgshapiro# define IP_SRCROUTE 0 239290792Sgshapiro# define IDENTPROTO 0 239390792Sgshapiro# define RES_DNSRCH_VARIABLE _res_dnsrch 239490792Sgshapiro# define _PATH_UNIX "/unix" 239590792Sgshapiro# define _PATH_VENDOR_CF "/etc/sendmail.cf" 239690792Sgshapiro# define _PATH_SENDMAILPID "/var/run/sendmail.pid" 239790792Sgshapiro# endif /* MOTO */ 239890792Sgshapiro 2399110560Sgshapiro/* 2400110560Sgshapiro** Interix 2401110560Sgshapiro** Contributed by Nedelcho Stanev <nedelcho.stanev@atlanticsky.com> 2402110560Sgshapiro** 2403110560Sgshapiro** Used for Interix support. 2404110560Sgshapiro*/ 240590792Sgshapiro 2406110560Sgshapiro# if defined(__INTERIX) 2407110560Sgshapiro# define HASURANDOMDEV 1 2408110560Sgshapiro# define HASGETUSERSHELL 0 2409110560Sgshapiro# define HASSTRERROR 1 2410110560Sgshapiro# define HASUNSETENV 1 2411110560Sgshapiro# define HASFCHOWN 1 2412110560Sgshapiro# undef HAVE_SYS_ERRLIST 2413110560Sgshapiro# define sys_errlist __sys_errlist 2414110560Sgshapiro# define sys_nerr __sys_nerr 2415132943Sgshapiro# include <sys/mkdev.h> 2416132943Sgshapiro# ifndef major 2417132943Sgshapiro# define major(dev) ((int)(((dev) >> 8) & 0xff)) 2418132943Sgshapiro# endif /* ! major */ 2419132943Sgshapiro# ifndef minor 2420132943Sgshapiro# define minor(dev) ((int)((dev) & 0xff)) 2421132943Sgshapiro# endif /* ! minor */ 2422110560Sgshapiro# endif /* defined(__INTERIX) */ 2423110560Sgshapiro 2424110560Sgshapiro 242590792Sgshapiro/********************************************************************** 242690792Sgshapiro** End of Per-Operating System defines 242790792Sgshapiro**********************************************************************/ 242890792Sgshapiro/********************************************************************** 242990792Sgshapiro** More general defines 243090792Sgshapiro**********************************************************************/ 243190792Sgshapiro 243290792Sgshapiro/* general BSD defines */ 243390792Sgshapiro# ifdef BSD 243490792Sgshapiro# define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ 243590792Sgshapiro# ifndef HASSETREUID 243690792Sgshapiro# define HASSETREUID 1 /* has setreuid(2) call */ 243790792Sgshapiro# endif /* ! HASSETREUID */ 243890792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 243990792Sgshapiro# ifndef IP_SRCROUTE 244090792Sgshapiro# define IP_SRCROUTE 1 /* can check IP source routing */ 244190792Sgshapiro# endif /* ! IP_SRCROUTE */ 244290792Sgshapiro# ifndef HASSETRLIMIT 244390792Sgshapiro# define HASSETRLIMIT 1 /* has setrlimit(2) call */ 244490792Sgshapiro# endif /* ! HASSETRLIMIT */ 244590792Sgshapiro# ifndef HASFLOCK 244690792Sgshapiro# define HASFLOCK 1 /* has flock(2) call */ 244790792Sgshapiro# endif /* ! HASFLOCK */ 244890792Sgshapiro# ifndef TZ_TYPE 244990792Sgshapiro# define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */ 245090792Sgshapiro# endif /* ! TZ_TYPE */ 245190792Sgshapiro# endif /* BSD */ 245290792Sgshapiro 245390792Sgshapiro/* general System V Release 4 defines */ 245490792Sgshapiro# ifdef __svr4__ 245590792Sgshapiro# define SYSTEM5 1 245690792Sgshapiro# define USESETEUID 1 /* has usable seteuid(2) call */ 245790792Sgshapiro# define HASINITGROUPS 1 /* has initgroups(3) call */ 245890792Sgshapiro# define BSD_COMP 1 /* get BSD ioctl calls */ 245990792Sgshapiro# ifndef HASSETRLIMIT 246090792Sgshapiro# define HASSETRLIMIT 1 /* has setrlimit(2) call */ 246190792Sgshapiro# endif /* ! HASSETRLIMIT */ 246290792Sgshapiro# ifndef HASGETUSERSHELL 246390792Sgshapiro# define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ 246490792Sgshapiro# endif /* ! HASGETUSERSHELL */ 246590792Sgshapiro# ifndef HASFCHMOD 246690792Sgshapiro# define HASFCHMOD 1 /* most (all?) SVr4s seem to have fchmod(2) */ 246790792Sgshapiro# endif /* ! HASFCHMOD */ 246890792Sgshapiro 246990792Sgshapiro# ifndef _PATH_UNIX 247090792Sgshapiro# define _PATH_UNIX "/unix" 247190792Sgshapiro# endif /* ! _PATH_UNIX */ 247290792Sgshapiro# ifndef _PATH_VENDOR_CF 247390792Sgshapiro# define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" 247490792Sgshapiro# endif /* ! _PATH_VENDOR_CF */ 247590792Sgshapiro# ifndef _PATH_SENDMAILPID 247690792Sgshapiro# define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" 247790792Sgshapiro# endif /* ! _PATH_SENDMAILPID */ 247890792Sgshapiro# ifndef SYSLOG_BUFSIZE 247990792Sgshapiro# define SYSLOG_BUFSIZE 128 248090792Sgshapiro# endif /* ! SYSLOG_BUFSIZE */ 248190792Sgshapiro# ifndef SFS_TYPE 248290792Sgshapiro# define SFS_TYPE SFS_STATVFS 248390792Sgshapiro# endif /* ! SFS_TYPE */ 248490792Sgshapiro 248590792Sgshapiro# ifndef USE_SIGLONGJMP 248690792Sgshapiro# define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ 248790792Sgshapiro# endif /* ! USE_SIGLONGJMP */ 248890792Sgshapiro# endif /* __svr4__ */ 248990792Sgshapiro 249090792Sgshapiro# ifdef __SVR4 249190792Sgshapiro# define LDA_USE_LOCKF 1 249290792Sgshapiro# define LDA_USE_SETEUID 1 249390792Sgshapiro# define _PATH_MAILDIR "/var/mail" 249490792Sgshapiro# endif /* __SVR4 */ 249590792Sgshapiro 249690792Sgshapiro/* general System V defines */ 249790792Sgshapiro# ifdef SYSTEM5 249890792Sgshapiro# include <sys/sysmacros.h> 249990792Sgshapiro# define HASUNAME 1 /* use System V uname(2) system call */ 250090792Sgshapiro# define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ 250190792Sgshapiro# define HASSETVBUF 1 /* we have setvbuf(3) in libc */ 250290792Sgshapiro# ifndef HASULIMIT 250390792Sgshapiro# define HASULIMIT 1 /* has the ulimit(2) syscall */ 250490792Sgshapiro# endif /* ! HASULIMIT */ 250590792Sgshapiro# ifndef LA_TYPE 250690792Sgshapiro# ifdef MIOC_READKSYM 250790792Sgshapiro# define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ 250890792Sgshapiro# else /* MIOC_READKSYM */ 250990792Sgshapiro# define LA_TYPE LA_INT /* assume integer load average */ 251090792Sgshapiro# endif /* MIOC_READKSYM */ 251190792Sgshapiro# endif /* ! LA_TYPE */ 251290792Sgshapiro# ifndef SFS_TYPE 251390792Sgshapiro# define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ 251490792Sgshapiro# endif /* ! SFS_TYPE */ 251590792Sgshapiro# ifndef TZ_TYPE 251690792Sgshapiro# define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ 251790792Sgshapiro# endif /* ! TZ_TYPE */ 251890792Sgshapiro# endif /* SYSTEM5 */ 251990792Sgshapiro 252090792Sgshapiro/* general POSIX defines */ 252190792Sgshapiro# ifdef _POSIX_VERSION 2522132943Sgshapiro# define HASSETSID 1 /* has POSIX setsid(2) call */ 2523132943Sgshapiro# define HASWAITPID 1 /* has POSIX waitpid(2) call */ 252490792Sgshapiro# if _POSIX_VERSION >= 199500 && !defined(USESETEUID) 252590792Sgshapiro# define USESETEUID 1 /* has usable seteuid(2) call */ 252690792Sgshapiro# endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */ 252790792Sgshapiro# endif /* _POSIX_VERSION */ 252890792Sgshapiro/* 252990792Sgshapiro** Tweaking for systems that (for example) claim to be BSD or POSIX 253090792Sgshapiro** but don't have all the standard BSD or POSIX routines (boo hiss). 253190792Sgshapiro*/ 253290792Sgshapiro 253390792Sgshapiro# ifdef titan 253490792Sgshapiro# undef HASINITGROUPS /* doesn't have initgroups(3) call */ 253590792Sgshapiro# endif /* titan */ 253690792Sgshapiro 253790792Sgshapiro# ifdef _CRAYCOM 253890792Sgshapiro# undef HASSETSID /* despite POSIX claim, doesn't have setsid */ 253990792Sgshapiro# endif /* _CRAYCOM */ 254090792Sgshapiro 254190792Sgshapiro# ifdef MOTO 254290792Sgshapiro# undef USESETEUID 254390792Sgshapiro# endif /* MOTO */ 254490792Sgshapiro 254590792Sgshapiro/* 254690792Sgshapiro** Due to a "feature" in some operating systems such as Ultrix 4.3 and 254790792Sgshapiro** HPUX 8.0, if you receive a "No route to host" message (ICMP message 254890792Sgshapiro** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host 254990792Sgshapiro** are closed. Some firewalls return this error if you try to connect 255090792Sgshapiro** to the IDENT port (113), so you can't receive email from these hosts 255190792Sgshapiro** on these systems. The firewall really should use a more specific 255290792Sgshapiro** message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB. If 255390792Sgshapiro** not explicitly set to zero above, default it on. 255490792Sgshapiro*/ 255590792Sgshapiro 255690792Sgshapiro# ifndef IDENTPROTO 255790792Sgshapiro# define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ 255890792Sgshapiro# endif /* ! IDENTPROTO */ 255990792Sgshapiro 256090792Sgshapiro# ifndef IP_SRCROUTE 256190792Sgshapiro# define IP_SRCROUTE 1 /* Detect IP source routing */ 256290792Sgshapiro# endif /* ! IP_SRCROUTE */ 256390792Sgshapiro 256490792Sgshapiro# ifndef HASGETUSERSHELL 256590792Sgshapiro# define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ 256690792Sgshapiro# endif /* ! HASGETUSERSHELL */ 256790792Sgshapiro 256890792Sgshapiro# ifndef NETUNIX 256990792Sgshapiro# define NETUNIX 1 /* include unix domain support */ 257090792Sgshapiro# endif /* ! NETUNIX */ 257190792Sgshapiro 257290792Sgshapiro# ifndef HASRANDOM 257390792Sgshapiro# define HASRANDOM 1 /* has random(3) support */ 257490792Sgshapiro# endif /* ! HASRANDOM */ 257590792Sgshapiro 257690792Sgshapiro# ifndef HASFLOCK 257790792Sgshapiro# define HASFLOCK 0 /* assume no flock(2) support */ 257890792Sgshapiro# endif /* ! HASFLOCK */ 257990792Sgshapiro 258090792Sgshapiro# ifndef HASSETREUID 258190792Sgshapiro# define HASSETREUID 0 /* assume no setreuid(2) call */ 258290792Sgshapiro# endif /* ! HASSETREUID */ 258390792Sgshapiro 258490792Sgshapiro# ifndef HASFCHMOD 258590792Sgshapiro# define HASFCHMOD 0 /* assume no fchmod(2) syscall */ 258690792Sgshapiro# endif /* ! HASFCHMOD */ 258790792Sgshapiro 258890792Sgshapiro# ifndef USESETEUID 258990792Sgshapiro# define USESETEUID 0 /* assume no seteuid(2) call or no saved ids */ 259090792Sgshapiro# endif /* ! USESETEUID */ 259190792Sgshapiro 259290792Sgshapiro# ifndef HASSETRLIMIT 259390792Sgshapiro# define HASSETRLIMIT 0 /* assume no setrlimit(2) support */ 259490792Sgshapiro# endif /* ! HASSETRLIMIT */ 259590792Sgshapiro 259690792Sgshapiro# ifndef HASULIMIT 259790792Sgshapiro# define HASULIMIT 0 /* assume no ulimit(2) support */ 259890792Sgshapiro# endif /* ! HASULIMIT */ 259990792Sgshapiro 260090792Sgshapiro# ifndef SECUREWARE 260190792Sgshapiro# define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */ 260290792Sgshapiro# endif /* ! SECUREWARE */ 260390792Sgshapiro 260490792Sgshapiro# ifndef USE_DOUBLE_FORK 260590792Sgshapiro# define USE_DOUBLE_FORK 1 /* avoid intermediate zombies */ 260690792Sgshapiro# endif /* ! USE_DOUBLE_FORK */ 260790792Sgshapiro 260890792Sgshapiro# ifndef USE_ENVIRON 260990792Sgshapiro# define USE_ENVIRON 0 /* use main() envp instead of extern environ */ 261090792Sgshapiro# endif /* ! USE_ENVIRON */ 261190792Sgshapiro 261290792Sgshapiro# ifndef USE_SIGLONGJMP 261390792Sgshapiro# define USE_SIGLONGJMP 0 /* assume setjmp handles signals properly */ 261490792Sgshapiro# endif /* ! USE_SIGLONGJMP */ 261590792Sgshapiro 261690792Sgshapiro# ifndef FDSET_CAST 261790792Sgshapiro# define FDSET_CAST /* (empty) cast for fd_set arg to select */ 261890792Sgshapiro# endif /* ! FDSET_CAST */ 261990792Sgshapiro 262090792Sgshapiro/* 262190792Sgshapiro** Pick a mailer setuid method for changing the current uid 262290792Sgshapiro*/ 262390792Sgshapiro 262490792Sgshapiro# define USE_SETEUID 0 262590792Sgshapiro# define USE_SETREUID 1 262690792Sgshapiro# define USE_SETUID 2 262790792Sgshapiro 262890792Sgshapiro# if USESETEUID 262990792Sgshapiro# define MAILER_SETUID_METHOD USE_SETEUID 263090792Sgshapiro# else /* USESETEUID */ 263190792Sgshapiro# if HASSETREUID 263290792Sgshapiro# define MAILER_SETUID_METHOD USE_SETREUID 263390792Sgshapiro# else /* HASSETREUID */ 263490792Sgshapiro# define MAILER_SETUID_METHOD USE_SETUID 263590792Sgshapiro# endif /* HASSETREUID */ 263690792Sgshapiro# endif /* USESETEUID */ 263790792Sgshapiro 263890792Sgshapiro/* 263990792Sgshapiro** If no type for argument two of getgroups call is defined, assume 264090792Sgshapiro** it's an integer -- unfortunately, there seem to be several choices 264190792Sgshapiro** here. 264290792Sgshapiro*/ 264390792Sgshapiro 264490792Sgshapiro# ifndef GIDSET_T 264590792Sgshapiro# define GIDSET_T int 264690792Sgshapiro# endif /* ! GIDSET_T */ 264790792Sgshapiro 264890792Sgshapiro# ifndef UID_T 264990792Sgshapiro# define UID_T uid_t 265090792Sgshapiro# endif /* ! UID_T */ 265190792Sgshapiro 265290792Sgshapiro# ifndef GID_T 265390792Sgshapiro# define GID_T gid_t 265490792Sgshapiro# endif /* ! GID_T */ 265590792Sgshapiro 265690792Sgshapiro# ifndef MODE_T 265790792Sgshapiro# define MODE_T mode_t 265890792Sgshapiro# endif /* ! MODE_T */ 265990792Sgshapiro 266090792Sgshapiro# ifndef ARGV_T 266190792Sgshapiro# define ARGV_T char ** 266290792Sgshapiro# endif /* ! ARGV_T */ 266390792Sgshapiro 266490792Sgshapiro# ifndef SOCKADDR_LEN_T 266590792Sgshapiro# define SOCKADDR_LEN_T int 266690792Sgshapiro# endif /* ! SOCKADDR_LEN_T */ 266790792Sgshapiro 266890792Sgshapiro# ifndef SOCKOPT_LEN_T 266990792Sgshapiro# define SOCKOPT_LEN_T int 267090792Sgshapiro# endif /* ! SOCKOPT_LEN_T */ 267190792Sgshapiro 267290792Sgshapiro# ifndef QUAD_T 267390792Sgshapiro# define QUAD_T unsigned long 267490792Sgshapiro# endif /* ! QUAD_T */ 267590792Sgshapiro/********************************************************************** 267690792Sgshapiro** Remaining definitions should never have to be changed. They are 267790792Sgshapiro** primarily to provide back compatibility for older systems -- for 267890792Sgshapiro** example, it includes some POSIX compatibility definitions 267990792Sgshapiro**********************************************************************/ 268090792Sgshapiro 268190792Sgshapiro/* System 5 compatibility */ 268290792Sgshapiro# ifndef S_ISREG 268390792Sgshapiro# define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) 268490792Sgshapiro# endif /* ! S_ISREG */ 268590792Sgshapiro# ifndef S_ISDIR 268690792Sgshapiro# define S_ISDIR(foo) ((foo & S_IFMT) == S_IFDIR) 268790792Sgshapiro# endif /* ! S_ISDIR */ 268890792Sgshapiro# if !defined(S_ISLNK) && defined(S_IFLNK) 268990792Sgshapiro# define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) 269090792Sgshapiro# endif /* !defined(S_ISLNK) && defined(S_IFLNK) */ 269190792Sgshapiro# if !defined(S_ISFIFO) 269290792Sgshapiro# if defined(S_IFIFO) 269390792Sgshapiro# define S_ISFIFO(foo) ((foo & S_IFMT) == S_IFIFO) 269490792Sgshapiro# else /* defined(S_IFIFO) */ 269590792Sgshapiro# define S_ISFIFO(foo) false 269690792Sgshapiro# endif /* defined(S_IFIFO) */ 269790792Sgshapiro# endif /* !defined(S_ISFIFO) */ 269890792Sgshapiro# ifndef S_IRUSR 269990792Sgshapiro# define S_IRUSR 0400 270090792Sgshapiro# endif /* ! S_IRUSR */ 270190792Sgshapiro# ifndef S_IWUSR 270290792Sgshapiro# define S_IWUSR 0200 270390792Sgshapiro# endif /* ! S_IWUSR */ 270490792Sgshapiro# ifndef S_IRGRP 270590792Sgshapiro# define S_IRGRP 0040 270690792Sgshapiro# endif /* ! S_IRGRP */ 270790792Sgshapiro# ifndef S_IWGRP 270890792Sgshapiro# define S_IWGRP 0020 270990792Sgshapiro# endif /* ! S_IWGRP */ 271090792Sgshapiro# ifndef S_IROTH 271190792Sgshapiro# define S_IROTH 0004 271290792Sgshapiro# endif /* ! S_IROTH */ 271390792Sgshapiro# ifndef S_IWOTH 271490792Sgshapiro# define S_IWOTH 0002 271590792Sgshapiro# endif /* ! S_IWOTH */ 271690792Sgshapiro 271790792Sgshapiro/* close-on-exec flag */ 271890792Sgshapiro# ifndef FD_CLOEXEC 271990792Sgshapiro# define FD_CLOEXEC 1 272090792Sgshapiro# endif /* ! FD_CLOEXEC */ 272190792Sgshapiro 272290792Sgshapiro/* 272390792Sgshapiro** Older systems don't have this error code -- it should be in 272490792Sgshapiro** /usr/include/sysexits.h. 272590792Sgshapiro*/ 272690792Sgshapiro 272790792Sgshapiro# ifndef EX_CONFIG 272890792Sgshapiro# define EX_CONFIG 78 /* configuration error */ 272990792Sgshapiro# endif /* ! EX_CONFIG */ 273090792Sgshapiro 273190792Sgshapiro/* pseudo-codes */ 2732120256Sgshapiro# define EX_QUIT 22 /* drop out of server immediately */ 273390792Sgshapiro# define EX_RESTART 23 /* restart sendmail daemon */ 273490792Sgshapiro# define EX_SHUTDOWN 24 /* shutdown sendmail daemon */ 273590792Sgshapiro 273690792Sgshapiro#ifndef EX_NOTFOUND 273790792Sgshapiro# define EX_NOTFOUND EX_NOHOST 273890792Sgshapiro#endif /* ! EX_NOTFOUND */ 273990792Sgshapiro 274090792Sgshapiro/* pseudo-code used for mci_setstat */ 2741132943Sgshapiro# define EX_NOTSTICKY (-5) /* don't save persistent status */ 274290792Sgshapiro 274390792Sgshapiro 274490792Sgshapiro/* 274590792Sgshapiro** An "impossible" file mode to indicate that the file does not exist. 274690792Sgshapiro*/ 274790792Sgshapiro 274890792Sgshapiro# define ST_MODE_NOFILE 0171147 /* unlikely to occur */ 274990792Sgshapiro 275090792Sgshapiro 275190792Sgshapiro/* type of arbitrary pointer */ 275290792Sgshapiro# ifndef ARBPTR_T 275390792Sgshapiro# define ARBPTR_T void * 275490792Sgshapiro# endif /* ! ARBPTR_T */ 275590792Sgshapiro 275690792Sgshapiro# ifndef __P 275790792Sgshapiro# include "sm/cdefs.h" 275890792Sgshapiro# endif /* ! __P */ 275990792Sgshapiro 276090792Sgshapiro# if HESIOD && !defined(NAMED_BIND) 276190792Sgshapiro# define NAMED_BIND 1 /* not one without the other */ 276290792Sgshapiro# endif /* HESIOD && !defined(NAMED_BIND) */ 276390792Sgshapiro 276490792Sgshapiro# if NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) 276590792Sgshapiroextern int h_errno; 276690792Sgshapiro# endif /* NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) */ 276790792Sgshapiro 276890792Sgshapiro# if NEEDPUTENV 276990792Sgshapiroextern int putenv __P((char *)); 277090792Sgshapiro# endif /* NEEDPUTENV */ 277190792Sgshapiro 277290792Sgshapiro#if !HASUNSETENV 277390792Sgshapiroextern void unsetenv __P((char *)); 277490792Sgshapiro#endif /* !HASUNSETENV */ 277590792Sgshapiro 277690792Sgshapiro# ifdef LDAPMAP 277790792Sgshapiro# include <sys/time.h> 277890792Sgshapiro# include <lber.h> 277990792Sgshapiro# include <ldap.h> 278090792Sgshapiro 278190792Sgshapiro/* Some LDAP constants */ 278290792Sgshapiro# define LDAPMAP_FALSE 0 278390792Sgshapiro# define LDAPMAP_TRUE 1 278490792Sgshapiro 278590792Sgshapiro/* 278690792Sgshapiro** ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1. 278790792Sgshapiro** Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations 278890792Sgshapiro** and assume (falsely) that all old API implementations are broken. 278990792Sgshapiro** (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT) 279090792Sgshapiro*/ 279190792Sgshapiro 279290792Sgshapiro# if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) 279390792Sgshapiro# define USE_LDAP_INIT 1 279490792Sgshapiro# endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) */ 279590792Sgshapiro 279690792Sgshapiro/* 279790792Sgshapiro** LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x, 279890792Sgshapiro** hence ldap_set_option() must not exist. 279990792Sgshapiro*/ 280090792Sgshapiro 280190792Sgshapiro# if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) 280290792Sgshapiro# define USE_LDAP_SET_OPTION 1 280390792Sgshapiro# endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) */ 280490792Sgshapiro 280590792Sgshapiro# endif /* LDAPMAP */ 280690792Sgshapiro 280790792Sgshapiro# if HASUNAME 280890792Sgshapiro# include <sys/utsname.h> 280990792Sgshapiro# ifdef newstr 281090792Sgshapiro# undef newstr 281190792Sgshapiro# endif /* newstr */ 281290792Sgshapiro# else /* HASUNAME */ 281390792Sgshapiro# define NODE_LENGTH 32 281490792Sgshapirostruct utsname 281590792Sgshapiro{ 281690792Sgshapiro char nodename[NODE_LENGTH + 1]; 281790792Sgshapiro}; 281890792Sgshapiro# endif /* HASUNAME */ 281990792Sgshapiro 282090792Sgshapiro# if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) 282190792Sgshapiro# define MAXHOSTNAMELEN 256 282290792Sgshapiro# endif /* !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) */ 282390792Sgshapiro 2824203004Sgshapiro 2825203004Sgshapiro# if _FFR_LINUX_MHNL && defined(__linux__) && MAXHOSTNAMELEN < 255 2826203004Sgshapiro /* 2827223067Sgshapiro ** override Linux weirdness: a FQHN can be 255 chars long 2828203004Sgshapiro ** SUSv3 requires HOST_NAME_MAX ("Maximum length of a host 2829203004Sgshapiro ** name (not including the terminating null) as returned from the 2830203004Sgshapiro ** gethostname() function.") to be at least 255. c.f.: 2831203004Sgshapiro ** http://www.opengroup.org/onlinepubs/009695399 2832203004Sgshapiro ** but Linux defines that to 64 too. 2833203004Sgshapiro */ 2834203004Sgshapiro# undef MAXHOSTNAMELEN 2835203004Sgshapiro# define MAXHOSTNAMELEN 256 2836203004Sgshapiro# endif /* _FFR_LINUX_MHNL && defined(__linux__) && MAXHOSTNAMELEN < 255 */ 2837203004Sgshapiro 283890792Sgshapiro# if !defined(SIGCHLD) && defined(SIGCLD) 283990792Sgshapiro# define SIGCHLD SIGCLD 284090792Sgshapiro# endif /* !defined(SIGCHLD) && defined(SIGCLD) */ 284190792Sgshapiro 284290792Sgshapiro# ifndef STDIN_FILENO 284390792Sgshapiro# define STDIN_FILENO 0 284490792Sgshapiro# endif /* ! STDIN_FILENO */ 284590792Sgshapiro 284690792Sgshapiro# ifndef STDOUT_FILENO 284790792Sgshapiro# define STDOUT_FILENO 1 284890792Sgshapiro# endif /* ! STDOUT_FILENO */ 284990792Sgshapiro 285090792Sgshapiro# ifndef STDERR_FILENO 285190792Sgshapiro# define STDERR_FILENO 2 285290792Sgshapiro# endif /* ! STDERR_FILENO */ 285390792Sgshapiro 285490792Sgshapiro# ifndef LOCK_SH 285590792Sgshapiro# define LOCK_SH 0x01 /* shared lock */ 285690792Sgshapiro# define LOCK_EX 0x02 /* exclusive lock */ 285790792Sgshapiro# define LOCK_NB 0x04 /* non-blocking lock */ 285890792Sgshapiro# define LOCK_UN 0x08 /* unlock */ 285990792Sgshapiro# endif /* ! LOCK_SH */ 286090792Sgshapiro 286190792Sgshapiro# ifndef S_IXOTH 286290792Sgshapiro# define S_IXOTH (S_IEXEC >> 6) 286390792Sgshapiro# endif /* ! S_IXOTH */ 286490792Sgshapiro 286590792Sgshapiro# ifndef S_IXGRP 286690792Sgshapiro# define S_IXGRP (S_IEXEC >> 3) 286790792Sgshapiro# endif /* ! S_IXGRP */ 286890792Sgshapiro 286990792Sgshapiro# ifndef S_IXUSR 287090792Sgshapiro# define S_IXUSR (S_IEXEC) 287190792Sgshapiro# endif /* ! S_IXUSR */ 287290792Sgshapiro 287390792Sgshapiro#ifndef O_ACCMODE 287490792Sgshapiro# define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) 287590792Sgshapiro#endif /* ! O_ACCMODE */ 287690792Sgshapiro 287790792Sgshapiro# ifndef SEEK_SET 287890792Sgshapiro# define SEEK_SET 0 287990792Sgshapiro# define SEEK_CUR 1 288090792Sgshapiro# define SEEK_END 2 288190792Sgshapiro# endif /* ! SEEK_SET */ 288290792Sgshapiro 288390792Sgshapiro# ifndef SIG_ERR 288490792Sgshapiro# define SIG_ERR ((void (*)()) -1) 288590792Sgshapiro# endif /* ! SIG_ERR */ 288690792Sgshapiro 288790792Sgshapiro# ifndef WEXITSTATUS 288890792Sgshapiro# define WEXITSTATUS(st) (((st) >> 8) & 0377) 288990792Sgshapiro# endif /* ! WEXITSTATUS */ 289090792Sgshapiro# ifndef WIFEXITED 289190792Sgshapiro# define WIFEXITED(st) (((st) & 0377) == 0) 289290792Sgshapiro# endif /* ! WIFEXITED */ 289390792Sgshapiro# ifndef WIFSTOPPED 289490792Sgshapiro# define WIFSTOPPED(st) (((st) & 0100) == 0) 289590792Sgshapiro# endif /* ! WIFSTOPPED */ 289690792Sgshapiro# ifndef WCOREDUMP 289790792Sgshapiro# define WCOREDUMP(st) (((st) & 0200) != 0) 289890792Sgshapiro# endif /* ! WCOREDUMP */ 289990792Sgshapiro# ifndef WTERMSIG 290090792Sgshapiro# define WTERMSIG(st) (((st) & 0177)) 290190792Sgshapiro# endif /* ! WTERMSIG */ 290290792Sgshapiro 290390792Sgshapiro# ifndef SIGFUNC_DEFINED 290490792Sgshapirotypedef void (*sigfunc_t) __P((int)); 290590792Sgshapiro# endif /* ! SIGFUNC_DEFINED */ 290690792Sgshapiro# ifndef SIGFUNC_RETURN 290790792Sgshapiro# define SIGFUNC_RETURN 290890792Sgshapiro# endif /* ! SIGFUNC_RETURN */ 290990792Sgshapiro# ifndef SIGFUNC_DECL 291090792Sgshapiro# define SIGFUNC_DECL void 291190792Sgshapiro# endif /* ! SIGFUNC_DECL */ 291290792Sgshapiro 291390792Sgshapiro/* size of syslog buffer */ 291490792Sgshapiro# ifndef SYSLOG_BUFSIZE 291590792Sgshapiro# define SYSLOG_BUFSIZE 1024 291690792Sgshapiro# endif /* ! SYSLOG_BUFSIZE */ 291790792Sgshapiro 2918110560Sgshapiro/* for FD_SET() */ 2919110560Sgshapiro#ifndef FD_SETSIZE 2920110560Sgshapiro# define FD_SETSIZE 256 2921110560Sgshapiro#endif /* ! FD_SETSIZE */ 2922110560Sgshapiro 292390792Sgshapiro/* 292490792Sgshapiro** Size of prescan buffer. 292590792Sgshapiro** Despite comments in the _sendmail_ book, this probably should 292690792Sgshapiro** not be changed; there are some hard-to-define dependencies. 292790792Sgshapiro*/ 292890792Sgshapiro 292990792Sgshapiro# define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ 293090792Sgshapiro 293190792Sgshapiro/* fork routine -- set above using #ifdef _osname_ or in Makefile */ 293290792Sgshapiro# ifndef FORK 293390792Sgshapiro# define FORK fork /* function to call to fork mailer */ 293490792Sgshapiro# endif /* ! FORK */ 293590792Sgshapiro 293690792Sgshapiro/* setting h_errno */ 293790792Sgshapiro# ifndef SM_SET_H_ERRNO 293890792Sgshapiro# define SM_SET_H_ERRNO(err) h_errno = (err) 293990792Sgshapiro# endif /* SM_SET_H_ERRNO */ 294090792Sgshapiro 294190792Sgshapiro# ifndef SM_CONF_GETOPT 294290792Sgshapiro# define SM_CONF_GETOPT 1 294390792Sgshapiro# endif /* ! SM_CONF_GETOPT */ 294490792Sgshapiro 294590792Sgshapiro/* random routine -- set above using #ifdef _osname_ or in Makefile */ 294690792Sgshapiro# if HASRANDOM 294790792Sgshapiro# define get_random() random() 294890792Sgshapiro# else /* HASRANDOM */ 294990792Sgshapiro# define get_random() ((long) rand()) 295090792Sgshapiro# ifndef RANDOMSHIFT 295190792Sgshapiro# define RANDOMSHIFT 8 295290792Sgshapiro# endif /* ! RANDOMSHIFT */ 295390792Sgshapiro# endif /* HASRANDOM */ 295490792Sgshapiro 295590792Sgshapiro/* 295690792Sgshapiro** Default to using scanf in readcf. 295790792Sgshapiro*/ 295890792Sgshapiro 295990792Sgshapiro# ifndef SCANF 296090792Sgshapiro# define SCANF 1 296190792Sgshapiro# endif /* ! SCANF */ 296290792Sgshapiro 296390792Sgshapiro/* XXX 32 bit type */ 296490792Sgshapiro# ifndef SM_INT32 296590792Sgshapiro# define SM_INT32 int32_t 296690792Sgshapiro# endif /* ! SM_INT32 */ 296790792Sgshapiro 2968261194Sgshapiro/* XXX 16 bit type */ 2969261194Sgshapiro# ifndef SM_UINT16 2970261194Sgshapiro# define SM_UINT16 uint16_t 2971261194Sgshapiro# endif /* ! SM_UINT16 */ 2972261194Sgshapiro 297390792Sgshapiro/* 297490792Sgshapiro** SVr4 and similar systems use different routines for setjmp/longjmp 297590792Sgshapiro** with signal support 297690792Sgshapiro*/ 297790792Sgshapiro 297890792Sgshapiro# if USE_SIGLONGJMP 297990792Sgshapiro# ifdef jmp_buf 298090792Sgshapiro# undef jmp_buf 298190792Sgshapiro# endif /* jmp_buf */ 298290792Sgshapiro# define jmp_buf sigjmp_buf 298390792Sgshapiro# ifdef setjmp 298490792Sgshapiro# undef setjmp 298590792Sgshapiro# endif /* setjmp */ 298690792Sgshapiro# define setjmp(env) sigsetjmp(env, 1) 298790792Sgshapiro# ifdef longjmp 298890792Sgshapiro# undef longjmp 298990792Sgshapiro# endif /* longjmp */ 299090792Sgshapiro# define longjmp(env, val) siglongjmp(env, val) 299190792Sgshapiro# endif /* USE_SIGLONGJMP */ 299290792Sgshapiro 299390792Sgshapiro# if !defined(NGROUPS_MAX) && defined(NGROUPS) 299490792Sgshapiro# define NGROUPS_MAX NGROUPS /* POSIX naming convention */ 299590792Sgshapiro# endif /* !defined(NGROUPS_MAX) && defined(NGROUPS) */ 299690792Sgshapiro 299790792Sgshapiro/* 299890792Sgshapiro** Some snprintf() implementations are rumored not to NUL terminate. 299990792Sgshapiro*/ 300090792Sgshapiro# if SNPRINTF_IS_BROKEN 300190792Sgshapiro# ifdef snprintf 300290792Sgshapiro# undef snprintf 300390792Sgshapiro# endif /* snprintf */ 300490792Sgshapiro# define snprintf sm_snprintf 300590792Sgshapiro# ifdef vsnprintf 300690792Sgshapiro# undef vsnprintf 300790792Sgshapiro# endif /* vsnprintf */ 300890792Sgshapiro# define vsnprintf sm_vsnprintf 300990792Sgshapiro# endif /* SNPRINTF_IS_BROKEN */ 301090792Sgshapiro 301190792Sgshapiro/* 301290792Sgshapiro** If we don't have a system syslog, simulate it. 301390792Sgshapiro*/ 301490792Sgshapiro 301590792Sgshapiro# if !LOG 301690792Sgshapiro# define LOG_EMERG 0 /* system is unusable */ 301790792Sgshapiro# define LOG_ALERT 1 /* action must be taken immediately */ 301890792Sgshapiro# define LOG_CRIT 2 /* critical conditions */ 301990792Sgshapiro# define LOG_ERR 3 /* error conditions */ 302090792Sgshapiro# define LOG_WARNING 4 /* warning conditions */ 302190792Sgshapiro# define LOG_NOTICE 5 /* normal but significant condition */ 302290792Sgshapiro# define LOG_INFO 6 /* informational */ 302390792Sgshapiro# define LOG_DEBUG 7 /* debug-level messages */ 302490792Sgshapiro# endif /* !LOG */ 302590792Sgshapiro 302690792Sgshapiro# ifndef SM_CONF_SYSLOG 302790792Sgshapiro# define SM_CONF_SYSLOG 1 /* syslog.h has prototype for syslog() */ 302890792Sgshapiro# endif /* SM_CONF_SYSLOG */ 302990792Sgshapiro 303090792Sgshapiro# if !SM_CONF_SYSLOG 303190792Sgshapiro# ifdef __STDC__ 303290792Sgshapiroextern void syslog(int, const char *, ...); 303390792Sgshapiro# else /* __STDC__ */ 303490792Sgshapiroextern void syslog(); 303590792Sgshapiro# endif /* __STDC__ */ 303690792Sgshapiro# endif /* !SM_CONF_SYSLOG */ 303790792Sgshapiro 303890792Sgshapiro/* portable(?) definition for alignment */ 303990792Sgshapiro# ifndef SM_ALIGN_SIZE 304090792Sgshapirostruct sm_align 304190792Sgshapiro{ 304290792Sgshapiro char al_c; 304390792Sgshapiro union 304490792Sgshapiro { 304590792Sgshapiro long al_l; 304690792Sgshapiro void *al_p; 304790792Sgshapiro double al_d; 3048141858Sgshapiro void (*al_f) __P((void)); 304990792Sgshapiro } al_u; 305090792Sgshapiro}; 305190792Sgshapiro# define SM_ALIGN_SIZE offsetof(struct sm_align, al_u) 305290792Sgshapiro# endif /* ! SM_ALIGN_SIZE */ 305390792Sgshapiro# define SM_ALIGN_BITS (SM_ALIGN_SIZE - 1) 305490792Sgshapiro 3055261194Sgshapirochar *sm_inet6_ntop __P((const void *, char *, size_t)); 3056261194Sgshapiro 305790792Sgshapiro#endif /* ! SM_CONF_H */ 3058