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