Index: head/contrib/sendmail/src/conf.h =================================================================== --- head/contrib/sendmail/src/conf.h (revision 65352) +++ head/contrib/sendmail/src/conf.h (revision 65353) @@ -1,2802 +1,2806 @@ /* * Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 * The Regents of the University of California. All rights reserved. * * By using this file, you agree to the terms and conditions set * forth in the LICENSE file which can be found at the top level of * the sendmail distribution. * * * $Id: conf.h,v 8.496.4.20 2000/07/15 17:35:19 gshapiro Exp $ */ /* $FreeBSD$ */ /* ** CONF.H -- All user-configurable parameters for sendmail ** ** Send updates to sendmail@Sendmail.ORG so they will be ** included in the next release. */ #ifndef CONF_H #define CONF_H 1 #ifdef __GNUC__ struct rusage; /* forward declaration to get gcc to shut up in wait.h */ #endif /* __GNUC__ */ # include # include # if SFIO && defined(SF_APPEND) # undef SF_APPEND /* Both sfio/stdio.h and sys/stat.h define it */ # endif /* SFIO && defined(SF_APPEND) */ # include # ifndef __QNX__ /* in QNX this grabs bogus LOCK_* manifests */ # include # endif /* ! __QNX__ */ # include # include # include # include # include # include # include /* make sure TOBUFSIZ isn't larger than system limit for size of exec() args */ #ifdef ARG_MAX # if ARG_MAX > 4096 # define SM_ARG_MAX 4096 # else /* ARG_MAX > 4096 */ # define SM_ARG_MAX ARG_MAX # endif /* ARG_MAX > 4096 */ #else /* ARG_MAX */ # define SM_ARG_MAX 4096 #endif /* ARG_MAX */ /********************************************************************** ** Table sizes, etc.... ** There shouldn't be much need to change these.... **********************************************************************/ #define MAXLINE 2048 /* max line length */ #define MAXNAME 256 /* max length of a name */ #define MAXPV 256 /* max # of parms to mailers */ #define MAXATOM 1000 /* max atoms per address */ #define MAXRWSETS 200 /* max # of sets of rewriting rules */ #define MAXPRIORITIES 25 /* max values for Precedence: field */ #define MAXMXHOSTS 100 /* max # of MX records for one host */ #define SMTPLINELIM 990 /* maximum SMTP line length */ #define MAXKEY 128 /* maximum size of a database key */ #define MEMCHUNKSIZE 1024 /* chunk size for memory allocation */ #define MAXUSERENVIRON 100 /* max envars saved, must be >= 3 */ #define MAXALIASDB 12 /* max # of alias databases */ #define MAXMAPSTACK 12 /* max # of stacked or sequenced maps */ #if _FFR_MILTER # define MAXFILTERS 25 /* max # of milter filters */ # define MAXFILTERMACROS 50 /* max # of macros per milter cmd */ #endif /* _FFR_MILTER */ #define MAXSMTPARGS 20 /* max # of ESMTP args for MAIL/RCPT */ #define MAXTOCLASS 8 /* max # of message timeout classes */ #define MAXRESTOTYPES 3 /* max # of resolver timeout types */ #define MAXMIMEARGS 20 /* max args in Content-Type: */ #define MAXMIMENESTING 20 /* max MIME multipart nesting */ #define QUEUESEGSIZE 1000 /* increment for queue size */ #define MAXQFNAME 20 /* max qf file name length */ #define MACBUFSIZE 4096 /* max expanded macro buffer size */ #define TOBUFSIZE SM_ARG_MAX /* max buffer to hold address list */ #define MAXSHORTSTR 203 /* max short string length */ #define MAXMACNAMELEN 25 /* max macro name length */ #define MAXMACROID 0377 /* max macro id number */ #ifndef MAXHDRSLEN # define MAXHDRSLEN (32 * 1024) /* max size of message headers */ #endif /* ! MAXHDRSLEN */ #define MAXDAEMONS 10 /* max number of ports to listen to */ #ifndef MAXINTERFACES # define MAXINTERFACES 512 /* number of interfaces to probe */ #endif /* MAXINTERFACES */ #ifndef MAXSYMLINKS # define MAXSYMLINKS 32 /* max number of symlinks in a path */ #endif /* ! MAXSYMLINKS */ #define MAXLINKPATHLEN (MAXPATHLEN * MAXSYMLINKS) /* max link-expanded file */ #define DATA_PROGRESS_TIMEOUT 300 /* how ofter to check DATA progress */ #define ENHSCLEN 10 /* max len of enhanced status code */ #if _FFR_DYNAMIC_TOBUF # define DEFAULT_MAX_RCPT 100 /* max number of RCPTs per envelope */ #endif /* _FFR_DYNAMIC_TOBUF */ #if SASL # ifndef AUTH_MECHANISMS # if STARTTLS && _FFR_EXT_MECH # define AUTH_MECHANISMS "EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5" # else /* STARTTLS && _FFR_EXT_MECH */ # define AUTH_MECHANISMS "GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5" # endif /* STARTTLS && _FFR_EXT_MECH */ # endif /* ! AUTH_MECHANISMS */ #endif /* SASL */ #ifdef LDAPMAP # define LDAPMAP_MAX_ATTR 64 # define LDAPMAP_MAX_FILTER 1024 # define LDAPMAP_MAX_PASSWD 256 #endif /* LDAPMAP */ /********************************************************************** ** Compilation options. ** #define these to 1 if they are available; ** #define them to 0 otherwise. ** All can be overridden from Makefile. **********************************************************************/ #ifndef NETINET # define NETINET 1 /* include internet support */ #endif /* ! NETINET */ #ifndef NETINET6 # define NETINET6 0 /* do not include IPv6 support */ #endif /* ! NETINET6 */ #ifndef NETISO # define NETISO 0 /* do not include ISO socket support */ #endif /* ! NETISO */ #ifndef NAMED_BIND # define NAMED_BIND 1 /* use Berkeley Internet Domain Server */ #endif /* ! NAMED_BIND */ #ifndef XDEBUG # define XDEBUG 1 /* enable extended debugging */ #endif /* ! XDEBUG */ #ifndef MATCHGECOS # define MATCHGECOS 1 /* match user names from gecos field */ #endif /* ! MATCHGECOS */ #ifndef DSN # define DSN 1 /* include delivery status notification code */ #endif /* ! DSN */ #if !defined(USERDB) && (defined(NEWDB) || defined(HESIOD)) # define USERDB 1 /* look in user database */ #endif /* !defined(USERDB) && (defined(NEWDB) || defined(HESIOD)) */ #ifndef MIME8TO7 # define MIME8TO7 1 /* 8->7 bit MIME conversions */ #endif /* ! MIME8TO7 */ #ifndef MIME7TO8 # define MIME7TO8 1 /* 7->8 bit MIME conversions */ #endif /* ! MIME7TO8 */ /********************************************************************** ** "Hard" compilation options. ** #define these if they are available; comment them out otherwise. ** These cannot be overridden from the Makefile, and should really not ** be turned off unless absolutely necessary. **********************************************************************/ #define LOG 1 /* enable logging -- don't turn off */ /********************************************************************** ** End of site-specific configuration. **********************************************************************/ /* ** General "standard C" defines. ** ** These may be undone later, to cope with systems that claim to ** be Standard C but aren't. Gcc is the biggest offender -- it ** doesn't realize that the library is part of the language. ** ** Life would be much easier if we could get rid of this sort ** of bozo problems. */ #ifdef __STDC__ # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ #endif /* __STDC__ */ /* ** Assume you have standard calls; can be #undefed below if necessary. */ #ifndef HASLSTAT # define HASLSTAT 1 /* has lstat(2) call */ #endif /* ! HASLSTAT */ /********************************************************************** ** Operating system configuration. ** ** Unless you are porting to a new OS, you shouldn't have to ** change these. **********************************************************************/ /* ** HP-UX -- tested for 8.07, 9.00, and 9.01. ** ** If V4FS is defined, compile for HP-UX 10.0. ** 11.x support from Richard Allen . */ #ifdef __hpux /* common definitions for HP-UX 9.x and 10.x */ # undef m_flags /* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */ # define SYSTEM5 1 /* include all the System V defines */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define USESETEUID 1 /* has usable seteuid(2) call */ # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */ # define seteuid(e) setresuid(-1, e, -1) # define IP_SRCROUTE 1 /* can check IP source routing */ # define LA_TYPE LA_HPUX # define SPT_TYPE SPT_PSTAT # define SFS_TYPE SFS_VFS /* use statfs() implementation */ # define GIDSET_T gid_t # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ # endif /* ! HASGETUSERSHELL */ # ifdef HPUX11 # define HASFCHOWN 1 /* has fchown(2) */ # define HASSNPRINTF 1 /* has snprintf(3) */ # ifndef BROKEN_RES_SEARCH # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ # endif /* ! BROKEN_RES_SEARCH */ # else /* HPUX11 */ # ifndef NOT_SENDMAIL # define syslog hard_syslog # endif /* ! NOT_SENDMAIL */ # endif /* HPUX11 */ # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ # ifdef V4FS /* HP-UX 10.x */ # define _PATH_UNIX "/stand/vmunix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ # ifndef IDENTPROTO # define IDENTPROTO 1 /* TCP/IP implementation fixed in 10.0 */ # endif /* ! IDENTPROTO */ # include /* for mpctl() in get_num_procs_online() */ # else /* V4FS */ /* HP-UX 9.x */ # define _PATH_UNIX "/hp-ux" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ # ifdef __STDC__ extern void hard_syslog(int, char *, ...); # else /* __STDC__ */ extern void hard_syslog(); # endif /* __STDC__ */ # define FDSET_CAST (int *) /* cast for fd_set parameters to select */ # endif /* V4FS */ #endif /* __hpux */ /* ** IBM AIX 4.x */ #ifdef _AIX4 # define _AIX3 1 /* pull in AIX3 stuff */ # define BSD4_4_SOCKADDR /* has sa_len */ # define USESETEUID 1 /* seteuid(2) works */ # define TZ_TYPE TZ_NAME /* use tzname[] vector */ # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */ # if _AIX4 >= 40200 # define HASSETREUID 1 /* setreuid(2) works as of AIX 4.2 */ # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */ # endif /* _AIX4 >= 40200 */ # if _AIX4 >= 40300 # define HASSNPRINTF 1 /* has snprintf starting in 4.3 */ # endif /* _AIX4 >= 40300 */ # if defined(_ILS_MACROS) /* IBM versions aren't side-effect clean */ # undef isascii # define isascii(c) !(c & ~0177) # undef isdigit # define isdigit(__a) (_IS(__a,_ISDIGIT)) # undef isspace # define isspace(__a) (_IS(__a,_ISSPACE)) # endif /* defined(_ILS_MACROS) */ #endif /* _AIX4 */ /* ** IBM AIX 3.x -- actually tested for 3.2.3 */ #ifdef _AIX3 # include # include /* to get byte order */ # include # define HASFCHOWN 1 /* has fchown(2) */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ # define GIDSET_T gid_t # define SFS_TYPE SFS_STATFS /* use statfs() impl */ # define SPT_PADCHAR '\0' /* pad process title with nulls */ # define LA_TYPE LA_INT # define FSHIFT 16 # define LA_AVENRUN "avenrun" #endif /* _AIX3 */ /* ** IBM AIX 2.2.1 -- actually tested for osupdate level 2706+1773 ** ** From Mark Whetzel . */ #ifdef AIX /* AIX/RT compiler pre-defines this */ # include # include /* AIX/RT resource.h does NOT include this */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # define HASFCHMOD 0 /* does not have fchmod(2) syscall */ # define HASSETREUID 1 /* use setreuid(2) -lbsd system call */ # define HASSETVBUF 1 /* use setvbuf(2) system call */ # define HASSETRLIMIT 0 /* does not have setrlimit call */ # define HASFLOCK 0 /* does not have flock call - use fcntl */ # define HASULIMIT 1 /* use ulimit instead of setrlimit call */ # define NEEDGETOPT 1 /* Do we need theirs or ours */ # define SYS5SETPGRP 1 /* don't have setpgid on AIX/RT */ # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ # define BSD4_3 1 /* NOT bsd 4.4 or posix signals */ # define GIDSET_T int # define SFS_TYPE SFS_STATFS /* use statfs() impl */ # define SPT_PADCHAR '\0' /* pad process title with nulls */ # define LA_TYPE LA_SUBR /* use our ported loadavgd daemon */ # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ # define ARBPTR_T int * # define void int typedef int pid_t; /* RTisms for BSD compatibility, specified in the Makefile define BSD 1 define BSD_INCLUDES 1 define BSD_REMAP_SIGNAL_TO_SIGVEC RTisms needed above */ /* make this sendmail in a completely different place */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/local/newmail/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/usr/local/newmail/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ #endif /* AIX */ /* ** Silicon Graphics IRIX ** ** Compiles on 4.0.1. ** ** Use IRIX64 instead of IRIX for 64-bit IRIX (6.0). ** Use IRIX5 instead of IRIX for IRIX 5.x. ** ** This version tries to be adaptive using _MIPS_SIM: ** _MIPS_SIM == _ABIO32 (= 1) Abi: -32 on IRIX 6.2 ** _MIPS_SIM == _ABIN32 (= 2) Abi: -n32 on IRIX 6.2 ** _MIPS_SIM == _ABI64 (= 3) Abi: -64 on IRIX 6.2 ** ** _MIPS_SIM is 1 also on IRIX 5.3 ** ** IRIX64 changes from Mark R. Levinson . ** IRIX5 changes from Kari E. Hurtta . ** Adaptive changes from Kari E. Hurtta . */ #if defined(__sgi) # ifndef IRIX # define IRIX # endif /* ! IRIX */ # if _MIPS_SIM > 0 && !defined(IRIX5) # define IRIX5 /* IRIX5 or IRIX6 */ # endif /* _MIPS_SIM > 0 && !defined(IRIX5) */ # if _MIPS_SIM > 1 && !defined(IRIX6) && !defined(IRIX64) # define IRIX6 /* IRIX6 */ # endif /* _MIPS_SIM > 1 && !defined(IRIX6) && !defined(IRIX64) */ #endif /* defined(__sgi) */ #ifdef IRIX # define SYSTEM5 1 /* this is a System-V derived system */ # define HASSETREUID 1 /* has setreuid(2) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # define IP_SRCROUTE 1 /* can check IP source routing */ # define setpgid BSDsetpgrp # define GIDSET_T gid_t # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ # define SFS_BAVAIL f_bfree /* alternate field name */ # define SYSLOG_BUFSIZE 512 # ifdef IRIX6 # define STAT64 1 # define QUAD_T unsigned long long # define LA_TYPE LA_IRIX6 /* figure out at run time */ # define SAFENFSPATHCONF 0 /* pathconf(2) lies on NFS filesystems */ # else /* IRIX6 */ # define LA_TYPE LA_INT # ifdef IRIX64 # define STAT64 1 # define QUAD_T unsigned long long # define NAMELISTMASK 0x7fffffffffffffff /* mask for nlist() values */ # else /* IRIX64 */ # define STAT64 0 # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ # endif /* IRIX64 */ # endif /* IRIX6 */ # if defined(IRIX64) || defined(IRIX5) || defined(IRIX6) # include # include # define ARGV_T char *const * # define HASFCHOWN 1 /* has fchown(2) */ # define HASSETRLIMIT 1 /* has setrlimit(2) syscall */ # define HASGETDTABLESIZE 1 /* has getdtablesize(2) syscall */ # define HASSTRERROR 1 /* has strerror(3) */ # else /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */ # define ARGV_T const char ** # define WAITUNION 1 /* use "union wait" as wait argument type */ # endif /* defined(IRIX64) || defined(IRIX5) || defined(IRIX6) */ #endif /* IRIX */ /* ** SunOS and Solaris ** ** Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and ** Solaris 2.4 (a.k.a. SunOS 5.4). */ #if defined(sun) && !defined(BSD) # include # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define IP_SRCROUTE 1 /* can check IP source routing */ # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ # ifndef HASFCHOWN # define HASFCHOWN 1 /* fchown(2) */ # endif /* ! HASFCHOWN */ # ifdef SOLARIS_2_3 # define SOLARIS 20300 /* for back compat only -- use -DSOLARIS=20300 */ # endif /* SOLARIS_2_3 */ # if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) # define SOLARIS 1 /* unknown Solaris version */ # endif /* defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4)) */ # ifdef SOLARIS /* Solaris 2.x (a.k.a. SunOS 5.x) */ # ifndef __svr4__ # define __svr4__ /* use all System V Release 4 defines below */ # endif /* ! __svr4__ */ # define GIDSET_T gid_t # define USE_SA_SIGACTION 1 /* use sa_sigaction field */ # ifndef _PATH_UNIX # define _PATH_UNIX "/dev/ksyms" # endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ # ifndef _PATH_HOSTS # define _PATH_HOSTS "/etc/inet/hosts" # endif /* ! _PATH_HOSTS */ # ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ # endif /* ! SYSLOG_BUFSIZE */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TZNAME # endif /* ! TZ_TYPE */ # if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) # define USESETEUID 1 /* seteuid works as of 2.3 */ # endif /* SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203) */ # if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) # define HASSETREUID 1 /* setreuid works as of 2.5 */ # if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) # ifndef LA_TYPE # define LA_TYPE LA_KSTAT /* use kstat(3k) -- may work in < 2.5 */ # endif /* ! LA_TYPE */ # ifndef RANDOMSHIFT /* random() doesn't work well (sometimes) */ # define RANDOMSHIFT 8 # endif /* RANDOMSHIFT */ # endif /* SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700) */ # else /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */ # ifndef HASRANDOM # define HASRANDOM 0 /* doesn't have random(3) */ # endif /* ! HASRANDOM */ # endif /* SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205) */ # if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) # define HASSNPRINTF 1 /* has snprintf starting in 2.6 */ # endif /* SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206) */ # if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) # ifndef LA_TYPE # include # define LA_TYPE LA_SUBR /* getloadavg(3c) appears in 2.7 */ # endif /* ! LA_TYPE */ # define HASGETUSERSHELL 1 /* getusershell(3c) bug fixed in 2.7 */ # endif /* SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207) */ # if SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) # undef NETINET6 # define NETINET6 1 /* IPv6 added in 2.8 */ # define HASSTRL 1 /* str*(3) added in 2.8 */ # endif /* SOLARIS >= 20800 || (SOLARIS < 10000 && SOLARIS >= 208) */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps pre-2.7 */ # endif /* ! HASGETUSERSHELL */ # else /* SOLARIS */ /* SunOS 4.0.3 or 4.1.x */ # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ # define HASSETREUID 1 /* has setreuid(2) call */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ # endif /* ! HASFLOCK */ # define SFS_TYPE SFS_VFS /* use statfs() implementation */ # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ # include # include # ifdef __GNUC__ # define strtoul strtol /* gcc library bogosity */ # endif /* __GNUC__ */ # define memmove(d, s, l) (bcopy((s), (d), (l))) # ifdef SUNOS403 /* special tweaking for SunOS 4.0.3 */ # include # define BSD4_3 1 /* 4.3 BSD-based */ # define NEEDSTRSTR 1 /* need emulation of strstr(3) routine */ # define WAITUNION 1 /* use "union wait" as wait argument type */ # undef WIFEXITED # undef WEXITSTATUS # undef HASUNAME # define setpgid setpgrp # define MODE_T int typedef int pid_t; extern char *getenv(); # else /* SUNOS403 */ /* 4.1.x specifics */ # define HASSETSID 1 /* has Posix setsid(2) call */ # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ # endif /* SUNOS403 */ # endif /* SOLARIS */ # ifndef LA_TYPE # define LA_TYPE LA_INT # endif /* ! LA_TYPE */ #endif /* defined(sun) && !defined(BSD) */ /* ** DG/UX ** ** Tested on 5.4.2 and 5.4.3. Use DGUX_5_4_2 to get the ** older support. ** 5.4.3 changes from Mark T. Robinson . */ #ifdef DGUX_5_4_2 # define DGUX 1 #endif /* DGUX_5_4_2 */ #ifdef DGUX # define SYSTEM5 1 # define LA_TYPE LA_DGUX # define HASSETREUID 1 /* has setreuid(2) call */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASSETSID 1 /* has Posix setsid(2) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define IP_SRCROUTE 0 /* does not have */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) */ # define HASSNPRINTF 1 /* has snprintf(3) */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ # define SPT_TYPE SPT_NONE /* don't use setproctitle */ # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ /* these include files must be included early on DG/UX */ # include # include /* compiler doesn't understand const? */ # define const # ifdef DGUX_5_4_2 # define inet_addr dgux_inet_addr extern long dgux_inet_addr(); # endif /* DGUX_5_4_2 */ #endif /* DGUX */ /* ** Digital Ultrix 4.2A or 4.3 ** ** Apparently, fcntl locking is broken on 4.2A, in that locks are ** not dropped when the process exits. This causes major problems, ** so flock is the only alternative. */ #ifdef ultrix # define HASSETREUID 1 /* has setreuid(2) call */ # define HASUNSETENV 1 /* has unsetenv(3) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASFCHOWN 1 /* has fchown(2) syscall */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ # endif /* ! HASFLOCK */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # ifndef BROKEN_RES_SEARCH # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ # endif /* ! BROKEN_RES_SEARCH */ # if !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 # define NEEDLOCAL_HOSTNAME_LENGTH 1 /* see sendmail/README */ # endif /* !defined(NEEDLOCAL_HOSTNAME_LENGTH) && NAMED_BIND && __RES >= 19931104 && __RES < 19950621 */ # ifdef vax # define LA_TYPE LA_FLOAT # else /* vax */ # define LA_TYPE LA_INT # define LA_AVENRUN "avenrun" # endif /* vax */ # define SFS_TYPE SFS_MOUNT /* use statfs() impl */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* pre-4.4 TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ # define SYSLOG_BUFSIZE 256 #endif /* ultrix */ /* ** OSF/1 for KSR. ** ** Contributed by Todd C. Miller */ #ifdef __ksr__ # define __osf__ 1 /* get OSF/1 defines below */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ # endif /* ! TZ_TYPE */ #endif /* __ksr__ */ /* ** OSF/1 for Intel Paragon. ** ** Contributed by Jeff A. Earickson ** of Intel Scalable Systems Divison. */ #ifdef __PARAGON__ # define __osf__ 1 /* get OSF/1 defines below */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ # endif /* ! TZ_TYPE */ # define GIDSET_T gid_t # define MAXNAMLEN NAME_MAX #endif /* __PARAGON__ */ /* ** Tru64 UNIX, formerly known as Digital UNIX, formerly known as DEC OSF/1 ** ** Tested for 3.2 and 4.0. */ #ifdef __osf__ # define HASUNAME 1 /* has uname(2) call */ # define HASUNSETENV 1 /* has unsetenv(3) call */ # define USESETEUID 1 /* has usable seteuid(2) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASFCHOWN 1 /* has fchown(2) syscall */ # define HASSETLOGIN 1 /* has setlogin(2) */ # define IP_SRCROUTE 1 /* can check IP source routing */ # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ # define GIDSET_T gid_t # if _FFR_MILTER # define SM_INT32 int /* 32bit integer */ # endif /* _FFR_MILTER */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ # endif /* ! HASFLOCK */ # define LA_TYPE LA_ALPHAOSF # define SFS_TYPE SFS_STATVFS /* use statfs() impl */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/var/adm/sendmail/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/var/run/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ #endif /* __osf__ */ /* ** NeXTstep */ #ifdef NeXT # define HASINITGROUPS 1 /* has initgroups(3) call */ # define NEEDPUTENV 2 /* need putenv(3) call; no setenv(3) call */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ # endif /* ! HASFLOCK */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ # define WAITUNION 1 /* use "union wait" as wait argument type */ # define UID_T int /* compiler gripes on uid_t */ # define GID_T int /* ditto for gid_t */ # define MODE_T int /* and mode_t */ # define setpgid setpgrp # ifndef NOT_SENDMAIL # define sleep sleepX # endif /* ! NOT_SENDMAIL */ # ifndef LA_TYPE # define LA_TYPE LA_MACH # endif /* ! LA_TYPE */ # define SFS_TYPE SFS_VFS /* use statfs() implementation */ # ifndef _POSIX_SOURCE typedef int pid_t; # undef WEXITSTATUS # undef WIFEXITED # undef WIFSTOPPED # undef WTERMSIG # endif /* ! _POSIX_SOURCE */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/sendmail/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ # ifdef TCPWRAPPERS # ifndef HASUNSETENV # define HASUNSETENV 1 # endif /* ! HASUNSETENV */ # undef NEEDPUTENV # endif /* TCPWRAPPERS */ #endif /* NeXT */ /* ** Apple Rhapsody ** Contributed by Wilfredo Sanchez ** ** Also used for Apple Darwin support. */ #if defined(DARWIN) # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASFLOCK 1 /* has flock(2) syscall */ # define HASUNAME 1 /* has uname(2) syscall */ # define HASUNSETENV 1 # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ # define HASINITGROUPS 1 # define HASSETVBUF 1 # define HASSETREUID 1 # define USESETEUID 1 /* has usable seteuid(2) call */ # define HASLSTAT 1 # define HASSETRLIMIT 1 # define HASWAITPID 1 # define HASSTRERROR 1 /* has strerror(3) */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define HASSTRERROR 1 /* has strerror(3) */ # define HASGETDTABLESIZE 1 # define HASGETUSERSHELL 1 # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ # define BSD4_4_SOCKADDR /* has sa_len */ # define NETLINK 1 /* supports AF_LINK */ # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ # define GIDSET_T gid_t # define LA_TYPE LA_SUBR /* use getloadavg(3) */ # define SFS_TYPE SFS_MOUNT /* use statfs() impl */ # define SPT_TYPE SPT_PSSTRINGS # define SPT_PADCHAR '\0' /* pad process title with nulls */ # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ #endif /* DARWIN */ /* ** 4.4 BSD ** ** See also BSD defines. */ #if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) # include # define HASUNSETENV 1 /* has unsetenv(3) call */ # define USESETEUID 1 /* has usable seteuid(2) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define HASSTRERROR 1 /* has strerror(3) */ # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ # include # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ # define BSD4_4_SOCKADDR /* has sa_len */ # define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */ # define NETLINK 1 /* supports AF_LINK */ # ifndef LA_TYPE # define LA_TYPE LA_SUBR # endif /* ! LA_TYPE */ # define SFS_TYPE SFS_MOUNT /* use statfs() impl */ # define SPT_TYPE SPT_PSSTRINGS /* use PS_STRINGS pointer */ #endif /* defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__) */ /* ** BSD/OS (was BSD/386) (all versions) ** From Tony Sanders, BSDI */ #ifdef __bsdi__ # include # define HASUNSETENV 1 /* has the unsetenv(3) call */ # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ # define USESETEUID 1 /* has usable seteuid(2) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASSETLOGIN 1 /* has setlogin(2) */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define HASUNAME 1 /* has uname(2) syscall */ # define HASSTRERROR 1 /* has strerror(3) */ # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ # include # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ # define BSD4_4_SOCKADDR /* has sa_len */ # define NETLINK 1 /* supports AF_LINK */ # define SFS_TYPE SFS_MOUNT /* use statfs() impl */ # ifndef LA_TYPE # define LA_TYPE LA_SUBR # endif /* ! LA_TYPE */ # define GIDSET_T gid_t # define QUAD_T quad_t # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 /* version 1.1 or later */ # undef SPT_TYPE # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ # else /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */ /* version 1.0 or earlier */ # define SPT_PADCHAR '\0' /* pad process title with nulls */ # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312 */ # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 /* on 3.x */ # define HASSETUSERCONTEXT 1 /* has setusercontext */ # endif /* defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701 */ #endif /* __bsdi__ */ /* ** QNX 4.2x ** Contributed by Glen McCready . ** ** Should work with all versions of QNX. */ #if defined(__QNX__) # include # include # undef NGROUPS_MAX # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ # define USESETEUID 1 /* has usable seteuid(2) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ # define HASSETREUID 1 /* has setreuid(2) call */ # define HASSTRERROR 1 /* has strerror(3) */ # define HASFLOCK 0 # undef HASINITGROUPS /* has initgroups(3) call */ # define NEEDGETOPT 1 /* use sendmail's getopt */ # define IP_SRCROUTE 1 /* can check IP source routing */ # define TZ_TYPE TZ_TMNAME /* use tmname variable */ # define GIDSET_T gid_t # define LA_TYPE LA_ZERO # define SFS_TYPE SFS_NONE # define SPT_TYPE SPT_REUSEARGV # define SPT_PADCHAR '\0' /* pad process title with nulls */ # define HASGETUSERSHELL 0 # define E_PSEUDOBASE 512 # define _FILE_H_INCLUDED #endif /* defined(__QNX__) */ /* ** FreeBSD / NetBSD / OpenBSD (all architectures, all versions) ** ** 4.3BSD clone, closer to 4.4BSD for FreeBSD 1.x and NetBSD 0.9x ** 4.4BSD-Lite based for FreeBSD 2.x and NetBSD 1.x ** ** See also BSD defines. */ #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) # include # define HASUNSETENV 1 /* has unsetenv(3) call */ # define HASSETSID 1 /* has the setsid(2) POSIX syscall */ # define USESETEUID 1 /* has usable seteuid(2) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASFCHOWN 1 /* fchown(2) */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define HASUNAME 1 /* has uname(2) syscall */ # define HASSTRERROR 1 /* has strerror(3) */ # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ # define NEED_PRINTF_PERCENTQ 1 /* doesn't have %lld */ # include # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ # define BSD4_4_SOCKADDR /* has sa_len */ # define NETLINK 1 /* supports AF_LINK */ # define SAFENFSPATHCONF 1 /* pathconf(2) pessimizes on NFS filesystems */ # define GIDSET_T gid_t # define QUAD_T unsigned long long # define SFIO_STDIO_COMPAT 1 /* can use RES_DEBUG */ # ifndef LA_TYPE # define LA_TYPE LA_SUBR # endif /* ! LA_TYPE */ # define SFS_TYPE SFS_MOUNT /* use statfs() impl */ # if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) # undef SPT_TYPE # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ # endif /* defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1) */ # if defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ # endif /* defined(__NetBSD__) && ((__NetBSD_Version__ > 102070000) || (NetBSD1_2 > 8) || defined(NetBSD1_4) || defined(NetBSD1_3)) */ # if defined(__FreeBSD__) # define HASSETLOGIN 1 /* has setlogin(2) */ # if __FreeBSD_version >= 227001 # define HASSRANDOMDEV 1 /* has srandomdev(3) */ # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ # endif /* __FreeBSD_version >= 227001 */ # undef SPT_TYPE # if __FreeBSD__ >= 2 # include # if __FreeBSD_version >= 199512 /* 2.2-current when it appeared */ -# include +# if __FreeBSD_version >= 500012 /* Moved to libc in 5.0-current */ +# include +# else +# include +# endif # define SPT_TYPE SPT_BUILTIN # endif /* __FreeBSD_version >= 199512 */ # if __FreeBSD_version >= 222000 /* 2.2.2-release and later */ # define HASSETUSERCONTEXT 1 /* BSDI-style login classes */ # endif /* __FreeBSD_version >= 222000 */ # if __FreeBSD_version >= 330000 /* 3.3.0-release and later */ # ifndef HASSTRL # define HASSTRL 1 /* has strlc{py,at}(3) functions */ # endif /* HASSTRL */ # endif /* __FreeBSD_version >= 330000 */ # define USESYSCTL 1 /* use sysctl(3) for getting ncpus */ # include # endif /* __FreeBSD__ >= 2 */ # ifndef SPT_TYPE # define SPT_TYPE SPT_REUSEARGV # define SPT_PADCHAR '\0' /* pad process title with nulls */ # endif /* ! SPT_TYPE */ # endif /* defined(__FreeBSD__) */ # if defined(__OpenBSD__) # undef SPT_TYPE # define SPT_TYPE SPT_BUILTIN /* setproctitle is in libc */ # define HASSETLOGIN 1 /* has setlogin(2) */ # define HASURANDOMDEV 1 /* has /dev/urandom(4) */ # if OpenBSD < 199912 # define HASSTRL 0 /* strlcat(3) is broken in 2.5 and earlier */ # else /* OpenBSD < 199912 */ # define HASSTRL 1 /* has strlc{py,at}(3) functions */ # endif /* OpenBSD < 199912 */ # endif /* defined(__OpenBSD__) */ #endif /* defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) */ /* ** Mach386 ** ** For mt Xinu's Mach386 system. */ #if defined(MACH) && defined(i386) && !defined(__GNU__) # define MACH386 1 # define HASUNSETENV 1 /* has unsetenv(3) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ # endif /* ! HASFLOCK */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ # define NEEDSTRTOL 1 /* need the strtol() function */ # define setpgid setpgrp # ifndef LA_TYPE # define LA_TYPE LA_FLOAT # endif /* ! LA_TYPE */ # define SFS_TYPE SFS_VFS /* use statfs() implementation */ # undef HASSETVBUF /* don't actually have setvbuf(3) */ # undef WEXITSTATUS # undef WIFEXITED # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ #endif /* defined(MACH) && defined(i386) && !defined(__GNU__) */ /* ** GNU OS (hurd) ** Largely BSD & posix compatible. ** Port contributed by Miles Bader . ** Updated by Mark Kettenis . */ #if defined(__GNU__) && !defined(NeXT) # include # define HASFCHMOD 1 /* has fchmod(2) call */ # define HASFCHOWN 1 /* has fchown(2) call */ # define HASUNAME 1 /* has uname(2) call */ # define HASUNSETENV 1 /* has unsetenv(3) call */ # define HAS_ST_GEN 1 /* has st_gen field in stat struct */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define HASSTRERROR 1 /* has strerror(3) */ # define GIDSET_T gid_t # define SOCKADDR_LEN_T socklen_t # define SOCKOPT_LEN_T socklen_t # if (__GLIBC__ == 2 && __GLIBC_MINOR__ > 1) || __GLIBC__ > 2 # define LA_TYPE LA_SUBR # else # define LA_TYPE LA_MACH /* GNU uses mach[34], which renames some rpcs from mach2.x. */ # define host_self mach_host_self # endif # define SFS_TYPE SFS_STATFS # define SPT_TYPE SPT_CHANGEARGV # define ERRLIST_PREDEFINED 1 /* don't declare sys_errlist */ # define BSD4_4_SOCKADDR 1 /* has sa_len */ # define SIOCGIFCONF_IS_BROKEN 1 /* SIOCGFCONF doesn't work */ # define HAS_IN_H 1 /* GNU has netinet/in.h. */ /* GNU has no MAXPATHLEN; ideally the code should be changed to not use it. */ # define MAXPATHLEN 2048 #endif /* defined(__GNU__) && !defined(NeXT) */ /* ** 4.3 BSD -- this is for very old systems ** ** Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1. ** ** You'll also have to install a new resolver library. ** I don't guarantee that support for this environment is complete. */ #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ # define ARBPTR_T char * # define setpgid setpgrp # ifndef LA_TYPE # define LA_TYPE LA_FLOAT # endif /* ! LA_TYPE */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ # undef WEXITSTATUS # undef WIFEXITED typedef short pid_t; #endif /* defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd) */ /* ** SCO Unix ** ** This includes three parts: ** ** The first is for SCO OpenServer 5. ** (Contributed by Keith Reynolds ). ** ** SCO OpenServer 5 has a compiler version number macro, ** which we can use to figure out what version we're on. ** This may have to change in future releases. ** ** The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0. ** (Contributed by Philippe Brand ). ** ** The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier. */ /* SCO OpenServer 5 */ #if _SCO_DS >= 1 # include # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM returns bogus value */ # define HASSNPRINTF 1 /* has snprintf(3) call */ # define HASFCHMOD 1 /* has fchmod(2) call */ # define HASFCHOWN 1 /* has fchown(2) call */ # define HASSETRLIMIT 1 /* has setrlimit(2) call */ # define USESETEUID 1 /* has seteuid(2) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ # define RLIMIT_NEEDS_SYS_TIME_H 1 # ifndef LA_TYPE # define LA_TYPE LA_DEVSHORT # endif /* ! LA_TYPE */ # define _PATH_AVENRUN "/dev/table/avenrun" # ifndef _SCO_unix_4_2 # define _SCO_unix_4_2 # else /* ! _SCO_unix_4_2 */ # define SOCKADDR_LEN_T size_t /* e.g., arg#3 to accept, getsockname */ # define SOCKOPT_LEN_T size_t /* arg#5 to getsockopt */ # endif /* ! _SCO_unix_4_2 */ #endif /* _SCO_DS >= 1 */ /* SCO UNIX 3.2v4.2/Open Desktop 3.0 */ #ifdef _SCO_unix_4_2 # define _SCO_unix_ # define HASSETREUID 1 /* has setreuid(2) call */ #endif /* _SCO_unix_4_2 */ /* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */ #ifdef _SCO_unix_ # include /* needed for IP_SRCROUTE */ # define SYSTEM5 1 /* include all the System V defines */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # define NOFTRUNCATE 0 /* has (simulated) ftruncate call */ # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ # define MAXPATHLEN PATHSIZE # define SFS_TYPE SFS_4ARGS /* use 4-arg impl */ # define SFS_BAVAIL f_bfree /* alternate field name */ # define SPT_TYPE SPT_SCO /* write kernel u. area */ # define TZ_TYPE TZ_TM_NAME /* use tm->tm_name */ # define UID_T uid_t # define GID_T gid_t # define GIDSET_T gid_t # define _PATH_UNIX "/unix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ /* stuff fixed in later releases */ # ifndef _SCO_unix_4_2 # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ # endif /* ! _SCO_unix_4_2 */ # ifndef _SCO_DS # define ftruncate chsize /* use chsize(2) to emulate ftruncate */ # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ # define NETUNIX 0 /* no unix domain socket support */ # define LA_TYPE LA_SHORT # endif /* ! _SCO_DS */ #endif /* _SCO_unix_ */ /* ** ISC (SunSoft) Unix. ** ** Contributed by J.J. Bailey */ #ifdef ISC_UNIX # include # include /* needed for IP_SRCROUTE */ # include # define SYSTEM5 1 /* include all the System V defines */ # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # define HASSETREUID 1 /* has setreuid(2) call */ # define NEEDFSYNC 1 /* needs the fsync(2) call stub */ # define NETUNIX 0 /* no unix domain socket support */ # define MAXPATHLEN 1024 # define LA_TYPE LA_SHORT # define SFS_TYPE SFS_STATFS /* use statfs() impl */ # define SFS_BAVAIL f_bfree /* alternate field name */ # define _PATH_UNIX "/unix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ #endif /* ISC_UNIX */ /* ** Altos System V (5.3.1) ** Contributed by Tim Rice . */ #ifdef ALTOS_SYSTEM_V # include # include # define SYSTEM5 1 /* include all the System V defines */ # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # define WAITUNION 1 /* use "union wait" as wait argument type */ # define NEEDFSYNC 1 /* no fsync(2) in system library */ # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ # define NOFTRUNCATE 1 /* do not have ftruncate(2) */ # define MAXPATHLEN PATH_MAX # define LA_TYPE LA_SHORT # define SFS_TYPE SFS_STATFS /* use statfs() impl */ # define SFS_BAVAIL f_bfree /* alternate field name */ # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ # define NETUNIX 0 /* no unix domain socket support */ # undef WIFEXITED # undef WEXITSTATUS # define strtoul strtol /* gcc library bogosity */ typedef unsigned short uid_t; typedef unsigned short gid_t; typedef short pid_t; typedef unsigned long mode_t; /* some stuff that should have been in the include files */ extern char *malloc(); extern struct passwd *getpwent(); extern struct passwd *getpwnam(); extern struct passwd *getpwuid(); extern char *getenv(); extern struct group *getgrgid(); extern struct group *getgrnam(); #endif /* ALTOS_SYSTEM_V */ /* ** ConvexOS 11.0 and later ** ** "Todd C. Miller" claims this ** works on 9.1 as well. ** ** ConvexOS 11.5 and later, should work on 11.0 as defined. ** For pre-ConvexOOS 11.0, define NEEDGETOPT, undef IDENTPROTO ** ** Eric Schnoebelen (eric@cirr.com) For CONVEX Computer Corp. ** (now the CONVEX Technologies Center of Hewlett Packard) */ #ifdef _CONVEX_SOURCE # define HASGETDTABLESIZE 1 /* has getdtablesize(2) */ # define HASINITGROUPS 1 /* has initgroups(3) */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASSETSID 1 /* has POSIX setsid(2) call */ # define HASUNSETENV 1 /* has unsetenv(3) */ # define HASFLOCK 1 /* has flock(2) */ # define HASSETRLIMIT 1 /* has setrlimit(2) */ # define HASSETREUID 1 /* has setreuid(2) */ # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_error=0 */ # define NEEDPUTENV 1 /* needs putenv (written in terms of setenv) */ # define NEEDGETOPT 0 /* need replacement for getopt(3) */ # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ # define LA_TYPE LA_FLOAT # define SFS_TYPE SFS_VFS /* use statfs() implementation */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef S_IREAD # define S_IREAD _S_IREAD # define S_IWRITE _S_IWRITE # define S_IEXEC _S_IEXEC # define S_IFMT _S_IFMT # define S_IFCHR _S_IFCHR # define S_IFBLK _S_IFBLK # endif /* ! S_IREAD */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TIMEZONE # endif /* ! TZ_TYPE */ # ifndef IDENTPROTO # define IDENTPROTO 1 # endif /* ! IDENTPROTO */ # ifndef SHARE_V1 # define SHARE_V1 1 /* version 1 of the fair share scheduler */ # endif /* ! SHARE_V1 */ # if !defined(__GNUC__ ) # define UID_T int /* GNUC gets it right, ConvexC botches */ # define GID_T int /* GNUC gets it right, ConvexC botches */ # endif /* !defined(__GNUC__ ) */ # if SECUREWARE # define FORK fork /* SecureWare wants the real fork! */ # else /* SECUREWARE */ # define FORK vfork /* the rest of the OS versions don't care */ # endif /* SECUREWARE */ #endif /* _CONVEX_SOURCE */ /* ** RISC/os 4.52 ** ** Gives a ton of warning messages, but otherwise compiles. */ #ifdef RISCOS # define HASUNSETENV 1 /* has unsetenv(3) call */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ # endif /* ! HASFLOCK */ # define WAITUNION 1 /* use "union wait" as wait argument type */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ # define NEEDPUTENV 1 /* need putenv(3) call */ # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ # define SFS_TYPE SFS_VFS /* use statfs() implementation */ # define LA_TYPE LA_INT # define LA_AVENRUN "avenrun" # define _PATH_UNIX "/unix" # undef WIFEXITED # define setpgid setpgrp typedef int pid_t; # define SIGFUNC_DEFINED # define SIGFUNC_RETURN (0) # define SIGFUNC_DECL int typedef int (*sigfunc_t)(); extern char *getenv(); extern void *malloc(); /* added for RISC/os 4.01...which is dumber than 4.50 */ # ifdef RISCOS_4_0 # ifndef ARBPTR_T # define ARBPTR_T char * # endif /* ! ARBPTR_T */ # undef HASFLOCK # define HASFLOCK 0 # endif /* RISCOS_4_0 */ # include #endif /* RISCOS */ /* ** Linux 0.99pl10 and above... ** ** Thanks to, in reverse order of contact: ** ** John Kennedy ** Andrew Pam ** Florian La Roche ** Karl London ** ** Last compiled against: [07/21/98 @ 11:47:34 AM (Tuesday)] ** sendmail 8.9.1 bind-8.1.2 db-2.4.14 ** gcc-2.8.1 glibc-2.0.94 linux-2.1.109 ** ** NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style ** file locking is no longer allowed. In particular, make sure ** your DBM library and sendmail are both using either flock(2) ** *or* fcntl(2) file locking, but not both. */ #ifdef __linux__ # include # if !defined(KERNEL_VERSION) /* not defined in 2.0.x kernel series */ # define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) # endif /* KERNEL_VERSION */ # define BSD 1 /* include BSD defines */ # define USESETEUID 0 /* Have it due to POSIX, but doesn't work */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASUNSETENV 1 /* has unsetenv(3) call */ # ifndef HASSNPRINTF # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # endif /* ! HASSNPRINTF */ # define ERRLIST_PREDEFINED /* don't declare sys_errlist */ # define GIDSET_T gid_t /* from */ # define HASGETUSERSHELL 0 /* getusershell(3) broken in Slackware 2.0 */ # ifndef IP_SRCROUTE # define IP_SRCROUTE 0 /* linux <= 1.2.8 doesn't support IP_OPTIONS */ # endif /* ! IP_SRCROUTE */ # ifndef HAS_IN_H # define HAS_IN_H 1 /* use netinet/in.h */ # endif /* ! HAS_IN_H */ # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ # ifndef HASFLOCK # if LINUX_VERSION_CODE < 66399 # define HASFLOCK 0 /* flock(2) is broken after 0.99.13 */ # else /* LINUX_VERSION_CODE < 66399 */ # define HASFLOCK 1 /* flock(2) fixed after 1.3.95 */ # endif /* LINUX_VERSION_CODE < 66399 */ # endif /* ! HASFLOCK */ # ifndef LA_TYPE # define LA_TYPE LA_PROCSTR # endif /* ! LA_TYPE */ # define SFS_TYPE SFS_VFS /* use statfs() impl */ # define SPT_PADCHAR '\0' /* pad process title with nulls */ # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,0,0)) # ifndef HASURANDOMDEV # define HASURANDOMDEV 1 /* 2.0 (at least) has linux/drivers/char/random.c */ # endif /* ! HASURANDOMDEV */ # endif /* LINUX_VERSION_CODE */ # ifndef TZ_TYPE # define TZ_TYPE TZ_NONE /* no standard for Linux */ # endif /* ! TZ_TYPE */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/var/run/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ # include # undef atol /* wounded in */ # if NETINET6 /* ** Linux doesn't have a good way to tell userland what interfaces are ** IPv6-capable. Therefore, the BIND resolver can not determine if there ** are IPv6 interfaces to honor AI_ADDRCONFIG. Unfortunately, it assumes ** that none are present. (Excuse the macro name ADDRCONFIG_IS_BROKEN.) */ # define ADDRCONFIG_IS_BROKEN 1 /* ** Indirectly included from glibc's . IPv6 support is native ** in 2.1 and later, but the APIs appear before the functions. */ # if defined(__GLIBC__) && defined(__GLIBC_MINOR__) # define GLIBC_VERSION ((__GLIBC__ << 8) + __GLIBC_MINOR__) # if (GLIBC_VERSION >= 0x201) # undef IPPROTO_ICMPV6 /* linux #defines, glibc enums */ # else /* (GLIBC_VERSION >= 0x201) */ # include /* IPv6 support */ # endif /* (GLIBC_VERSION >= 0x201) */ # if (GLIBC_VERSION == 0x201 && !defined(NEEDSGETIPNODE)) /* Have APIs in , but no support in glibc */ # define NEEDSGETIPNODE 1 # endif /* (GLIBC_VERSION == 0x201 && ! NEEDSGETIPNODE) */ # undef GLIBC_VERSION # endif /* defined(__GLIBC__) && defined(__GLIBC_MINOR__) */ # endif /* NETINET6 */ # ifndef HASFCHOWN # define HASFCHOWN 1 /* fchown(2) */ # endif /* ! HASFCHOWN */ #endif /* __linux__ */ /* ** DELL SVR4 Issue 2.2, and others ** From Kimmo Suominen ** ** It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__ ** defined, and the definitions conflict. ** ** Peter Wemm claims that the setreuid ** trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A ** (SVR4.0/386 version 3.0). */ #ifdef DELL_SVR4 /* no changes necessary */ /* see general __svr4__ defines below */ #endif /* DELL_SVR4 */ /* ** Apple A/UX 3.0 */ #ifdef _AUX_SOURCE # include # define BSD /* has BSD routines */ # define HASSETRLIMIT 0 /* ... but not setrlimit(2) */ # define BROKEN_RES_SEARCH 1 /* res_search(unknown) returns h_errno=0 */ # define BOGUS_O_EXCL 1 /* exclusive open follows symlinks */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASSETVBUF 1 /* has setvbuf(3) in libc */ # define HASSTRERROR 1 /* has strerror(3) */ # define SIGFUNC_DEFINED /* sigfunc_t already defined */ # define SIGFUNC_RETURN /* POSIX-mode */ # define SIGFUNC_DECL void /* POSIX-mode */ # define ERRLIST_PREDEFINED 1 # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ # ifndef LA_TYPE # define LA_TYPE LA_INT # define FSHIFT 16 # endif /* ! LA_TYPE */ # define LA_AVENRUN "avenrun" # define SFS_TYPE SFS_VFS /* use statfs() implementation */ # define TZ_TYPE TZ_TZNAME # ifndef _PATH_UNIX # define _PATH_UNIX "/unix" /* should be in */ # endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # undef WIFEXITED # undef WEXITSTATUS #endif /* _AUX_SOURCE */ /* ** Encore UMAX V ** ** Not extensively tested. */ #ifdef UMAXV # define HASUNAME 1 /* use System V uname(2) system call */ # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ # define MAXPATHLEN PATH_MAX extern struct passwd *getpwent(), *getpwnam(), *getpwuid(); extern struct group *getgrent(), *getgrnam(), *getgrgid(); # undef WIFEXITED # undef WEXITSTATUS #endif /* UMAXV */ /* ** Stardent Titan 3000 running TitanOS 4.2. ** ** Must be compiled in "cc -43" mode. ** ** From Kate Hedstrom . ** ** Note the tweaking below after the BSD defines are set. */ #ifdef titan # define setpgid setpgrp typedef int pid_t; # undef WIFEXITED # undef WEXITSTATUS #endif /* titan */ /* ** Sequent DYNIX 3.2.0 ** ** From Jim Davis . */ #ifdef sequent # define BSD 1 # define HASUNSETENV 1 # define BSD4_3 1 /* to get signal() in conf.c */ # define WAITUNION 1 # define LA_TYPE LA_FLOAT # ifdef _POSIX_VERSION # undef _POSIX_VERSION /* set in */ # endif /* _POSIX_VERSION */ # undef HASSETVBUF /* don't actually have setvbuf(3) */ # define setpgid setpgrp /* Have to redefine WIFEXITED to take an int, to work with waitfor() */ # undef WIFEXITED # define WIFEXITED(s) (((union wait*)&(s))->w_stopval != WSTOPPED && \ ((union wait*)&(s))->w_termsig == 0) # define WEXITSTATUS(s) (((union wait*)&(s))->w_retcode) typedef int pid_t; # define isgraph(c) (isprint(c) && (c != ' ')) # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ # ifndef _PATH_UNIX # define _PATH_UNIX "/dynix" # endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ #endif /* sequent */ /* ** Sequent DYNIX/ptx v2.0 (and higher) ** ** For DYNIX/ptx v1.x, undefine HASSETREUID. ** ** From Tim Wright . ** Update from Jack Woolley , 26 Dec 1995, ** for DYNIX/ptx 4.0.2. */ #ifdef _SEQUENT_ # include # define SYSTEM5 1 /* include all the System V defines */ # define HASSETSID 1 /* has POSIX setsid(2) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASSETREUID 1 /* has setreuid(2) call */ # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # define GIDSET_T gid_t # define LA_TYPE LA_INT # define SFS_TYPE SFS_STATFS /* use statfs() impl */ # define SPT_TYPE SPT_NONE /* don't use setproctitle */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ #endif /* _SEQUENT_ */ /* ** Cray Unicos ** ** Ported by David L. Kensiski, Sterling Sofware */ #ifdef UNICOS # define SYSTEM5 1 /* include all the System V defines */ # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ # define MAXPATHLEN PATHSIZE # define LA_TYPE LA_ZERO # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ # define SFS_BAVAIL f_bfree /* alternate field name */ #endif /* UNICOS */ /* ** Apollo DomainOS ** ** From Todd Martin & Don Lewis ** ** 15 Jan 1994; updated 2 Aug 1995 ** */ #ifdef apollo # define HASSETREUID 1 /* has setreuid(2) call */ # define HASINITGROUPS 1 /* has initgroups(2) call */ # define IP_SRCROUTE 0 /* does not have */ # define SPT_TYPE SPT_NONE /* don't use setproctitle */ # define LA_TYPE LA_SUBR /* use getloadavg.c */ # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ # define SFS_BAVAIL f_bfree /* alternate field name */ # define TZ_TYPE TZ_TZNAME # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ # undef S_IFSOCK /* S_IFSOCK and S_IFIFO are the same */ # undef S_IFIFO # define S_IFIFO 0010000 # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ # define RLIMIT_NEEDS_SYS_TIME_H 1 # if defined(NGROUPS_MAX) && !NGROUPS_MAX # undef NGROUPS_MAX # endif /* defined(NGROUPS_MAX) && !NGROUPS_MAX */ #endif /* apollo */ /* ** System V Rel 5.x (a.k.a Unixware7 w/o BSD-Compatibility Libs ie. native) ** ** Contributed by Paul Gampe */ #ifdef __svr5__ # include # define __svr4__ # define SYS5SIGNALS 1 # define HASSETSID 1 # define HASSETREUID 1 # define HASWAITPID 1 # define HASGETDTABLESIZE 1 # define GIDSET_T gid_t # define SOCKADDR_LEN_T size_t # define SOCKOPT_LEN_T size_t # ifndef _PATH_UNIX # define _PATH_UNIX "/stand/unix" # endif /* ! _PATH_UNIX */ # define SPT_PADCHAR '\0' /* pad process title with nulls */ # ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 1024 /* unsure */ # endif /* SYSLOG_BUFSIZE */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ #endif /* __svr5__ */ /* ###################################################################### */ /* ** UnixWare 2.x */ #ifdef UNIXWARE2 # define UNIXWARE 1 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # undef offsetof /* avoid stddefs.h, sys/sysmacros.h conflict */ #endif /* UNIXWARE2 */ /* ** UnixWare 1.1.2. ** ** Updated by Petr Lampa . ** From Evan Champion . */ #ifdef UNIXWARE # include # define SYSTEM5 1 # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # define HASSETREUID 1 # define HASSETSID 1 # define HASINITGROUPS 1 # define GIDSET_T gid_t # define SLEEP_T unsigned # define SFS_TYPE SFS_STATVFS # define LA_TYPE LA_ZERO # undef WIFEXITED # undef WEXITSTATUS # ifndef _PATH_UNIX # define _PATH_UNIX "/unix" # endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ # define SYSLOG_BUFSIZE 128 #endif /* UNIXWARE */ /* ** Intergraph CLIX 3.1 ** ** From Paul Southworth */ #ifdef CLIX # define SYSTEM5 1 /* looks like System V */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # endif /* ! HASGETUSERSHELL */ # define DEV_BSIZE 512 /* device block size not defined */ # define GIDSET_T gid_t # undef LOG /* syslog not available */ # define NEEDFSYNC 1 /* no fsync in system library */ # define GETSHORT _getshort #endif /* CLIX */ /* ** NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP ** ** From Kevin Darcy . */ #ifdef NCR_MP_RAS2 # include # define __svr4__ # define IP_SRCROUTE 0 /* Something is broken with getsockopt() */ # define SYSLOG_BUFSIZE 1024 # define SPT_TYPE SPT_NONE #endif /* NCR_MP_RAS2 */ /* ** NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP ** ** From Tom Moore */ #ifdef NCR_MP_RAS3 # define __svr4__ # define HASFCHOWN 1 /* has fchown(2) call */ # define SIOCGIFNUM_IS_BROKEN 1 /* SIOCGIFNUM has non-std interface */ # define SO_REUSEADDR_IS_BROKEN 1 /* doesn't work if accept() fails */ # define SYSLOG_BUFSIZE 1024 # define SPT_TYPE SPT_NONE # ifndef _XOPEN_SOURCE # define _XOPEN_SOURCE # define _XOPEN_SOURCE_EXTENDED 1 # include # undef _XOPEN_SOURCE # undef _XOPEN_SOURCE_EXTENDED # endif /* ! _XOPEN_SOURCE */ #endif /* NCR_MP_RAS3 */ /* ** Tandem NonStop-UX SVR4 ** ** From Rick McCarty . */ #ifdef NonStop_UX_BXX # define __svr4__ #endif /* NonStop_UX_BXX */ /* ** Hitachi 3050R/3050RX and 3500 Workstations running HI-UX/WE2. ** ** Tested for 1.04, 1.03 ** From Akihiro Hashimoto ("Hash") . ** ** Tested for 4.02, 6.10 and 7.10 ** From Motonori NAKAMURA . */ #if !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) # define SYSTEM5 1 /* include all the System V defines */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define HASFCHMOD 1 /* has fchmod(2) syscall */ # define setreuid(r, e) setresuid(r, e, -1) # define LA_TYPE LA_FLOAT # define SPT_TYPE SPT_PSTAT # define SFS_TYPE SFS_VFS /* use statfs() implementation */ # ifndef HASSETVBUF # define HASSETVBUF /* HI-UX has no setlinebuf */ # endif /* ! HASSETVBUF */ # ifndef GIDSET_T # define GIDSET_T gid_t # endif /* ! GIDSET_T */ # ifndef _PATH_UNIX # define _PATH_UNIX "/HI-UX" # endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* getusershell(3) causes core dumps */ # endif /* ! HASGETUSERSHELL */ # define FDSET_CAST (int *) /* cast for fd_set parameters to select */ /* ** avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h ** on HIUX 3050 */ # undef m_flags # ifdef __STDC__ extern int syslog(int, char *, ...); # else /* __STDC__ */ extern int syslog(); # endif /* __STDC__ */ #endif /* !defined(__hpux) && (defined(_H3050R) || defined(_HIUX_SOURCE)) */ /* ** Amdahl UTS System V 2.1.5 (SVr3-based) ** ** From: Janet Jackson . */ #ifdef _UTS # include # undef HASLSTAT /* has symlinks, but they cause problems */ # define NEEDFSYNC 1 /* system fsync(2) fails on non-EFS filesys */ # define SYS5SIGNALS 1 /* System V signal semantics */ # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ # define HASUNAME 1 /* use System V uname(2) system call */ # define HASINITGROUPS 1 /* has initgroups(3) function */ # define HASSETVBUF 1 /* has setvbuf(3) function */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* does not have getusershell(3) function */ # endif /* ! HASGETUSERSHELL */ # define GIDSET_T gid_t /* type of 2nd arg to getgroups(2) isn't int */ # define LA_TYPE LA_ZERO /* doesn't have load average */ # define SFS_TYPE SFS_4ARGS /* use 4-arg statfs() */ # define SFS_BAVAIL f_bfree /* alternate field name */ # define _PATH_UNIX "/unix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ #endif /* _UTS */ /* ** Cray Computer Corporation's CSOS ** ** From Scott Bolte . */ #ifdef _CRAYCOM # define SYSTEM5 1 /* include all the System V defines */ # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ # define NEEDFSYNC 1 /* no fsync in system library */ # define MAXPATHLEN PATHSIZE # define LA_TYPE LA_ZERO # define SFS_TYPE SFS_4ARGS /* four argument statfs() call */ # define SFS_BAVAIL f_bfree /* alternate field name */ # define _POSIX_CHOWN_RESTRICTED -1 extern struct group *getgrent(), *getgrnam(), *getgrgid(); #endif /* _CRAYCOM */ /* ** Sony NEWS-OS 4.2.1R and 6.0.3 ** ** From Motonori NAKAMURA . */ #ifdef sony_news # ifndef __svr4 /* NEWS-OS 4.2.1R */ # ifndef BSD # define BSD /* has BSD routines */ # endif /* ! BSD */ # define HASUNSETENV 1 /* has unsetenv(2) call */ # undef HASSETVBUF /* don't actually have setvbuf(3) */ # define WAITUNION 1 /* use "union wait" as wait argument type */ # define LA_TYPE LA_INT # define SFS_TYPE SFS_VFS /* use statfs() implementation */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ # endif /* ! HASFLOCK */ # define setpgid setpgrp # undef WIFEXITED # undef WEXITSTATUS # define MODE_T int /* system include files have no mode_t */ typedef int pid_t; typedef int (*sigfunc_t)(); # define SIGFUNC_DEFINED # define SIGFUNC_RETURN (0) # define SIGFUNC_DECL int # else /* ! __svr4 */ /* NEWS-OS 6.0.3 with /bin/cc */ # ifndef __svr4__ # define __svr4__ /* use all System V Release 4 defines below */ # endif /* ! __svr4__ */ # define HASSETSID 1 /* has Posix setsid(2) call */ # define HASGETUSERSHELL 1 /* DOES have getusershell(3) call in libc */ # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ # ifndef SPT_TYPE # define SPT_TYPE SPT_SYSMIPS /* use sysmips() (OS 6.0.2 or later) */ # endif /* ! SPT_TYPE */ # define GIDSET_T gid_t # undef WIFEXITED # undef WEXITSTATUS # ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 256 # endif /* ! SYSLOG_BUFSIZE */ # define _PATH_UNIX "/stand/unix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ # endif /* ! __svr4 */ #endif /* sony_news */ /* ** Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach ** ** From Motonori NAKAMURA . */ #ifdef luna # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ # define HASUNSETENV 1 /* has unsetenv(2) call */ # define NEEDPUTENV 1 /* need putenv(3) call */ # define NEEDGETOPT 1 /* need a replacement for getopt(3) */ # define NEEDSTRSTR 1 /* need emulation of the strstr(3) call */ # define WAITUNION 1 /* use "union wait" as wait argument type */ # ifdef uniosb # include # define NEEDVPRINTF 1 /* need a replacement for vprintf(3) */ # define LA_TYPE LA_INT # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ # endif /* uniosb */ # ifdef luna2 # define LA_TYPE LA_SUBR # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone */ # endif /* luna2 */ # ifdef luna88k # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define LA_TYPE LA_INT # endif /* luna88k */ # define SFS_TYPE SFS_VFS /* use statfs() implementation */ # define setpgid setpgrp # undef WIFEXITED # undef WEXITSTATUS typedef int pid_t; typedef int (*sigfunc_t)(); # define SIGFUNC_DEFINED # define SIGFUNC_RETURN (0) # define SIGFUNC_DECL int extern char *getenv(); # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/lib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ #endif /* luna */ /* ** NEC EWS-UX/V 4.2 (with /usr/ucb/cc) ** ** From Motonori NAKAMURA . */ #if defined(nec_ews_svr4) || defined(_nec_ews_svr4) # ifndef __svr4__ # define __svr4__ /* use all System V Release 4 defines below */ # endif /* ! __svr4__ */ # define SYS5SIGNALS 1 /* SysV signal semantics -- reset on each sig */ # define HASSETSID 1 /* has Posix setsid(2) call */ # define LA_TYPE LA_READKSYM /* use MIOC_READSYM ioctl */ # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ # define GIDSET_T gid_t # undef WIFEXITED # undef WEXITSTATUS # define NAMELISTMASK 0x7fffffff /* mask for nlist() values */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ # ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 1024 /* allow full size syslog buffer */ # endif /* ! SYSLOG_BUFSIZE */ #endif /* defined(nec_ews_svr4) || defined(_nec_ews_svr4) */ /* ** Fujitsu/ICL UXP/DS (For the DS/90 Series) ** ** From Diego R. Lopez . ** Additional changes from Fumio Moriya and Toshiaki Nomura of the ** Fujitsu Fresoftware group . */ #ifdef __uxp__ # include # include # include # define __svr4__ # define HASGETUSERSHELL 0 # define HASFLOCK 0 # if UXPDS == 10 # define HASSNPRINTF 0 /* no snprintf(3) or vsnprintf(3) */ # else /* UXPDS == 10 */ # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # endif /* UXPDS == 10 */ # define _PATH_UNIX "/stand/unix" # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ #endif /* __uxp__ */ /* ** Pyramid DC/OSx ** ** From Earle Ake . */ #ifdef DCOSx # define GIDSET_T gid_t # ifndef IDENTPROTO # define IDENTPROTO 0 /* TCP/IP implementation is broken */ # endif /* ! IDENTPROTO */ #endif /* DCOSx */ /* ** Concurrent Computer Corporation Maxion ** ** From Donald R. Laster Jr. . */ #ifdef __MAXION__ # include # define __svr4__ 1 /* SVR4.2MP */ # define HASSETREUID 1 /* have setreuid(2) */ # define HASLSTAT 1 /* have lstat(2) */ # define HASSETRLIMIT 1 /* have setrlimit(2) */ # define HASGETDTABLESIZE 1 /* have getdtablesize(2) */ # define HASSNPRINTF 1 /* have snprintf(3) */ # define HASGETUSERSHELL 1 /* have getusershell(3) */ # define NOFTRUNCATE 1 /* do not have ftruncate(2) */ # define SLEEP_T unsigned # define SFS_TYPE SFS_STATVFS # define SFS_BAVAIL f_bavail # ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 256 /* Use 256 bytes */ # endif /* ! SYSLOG_BUFSIZE */ # undef WUNTRACED # undef WIFEXITED # undef WIFSIGNALED # undef WIFSTOPPED # undef WEXITSTATUS # undef WTERMSIG # undef WSTOPSIG #endif /* __MAXION__ */ /* ** Harris Nighthawk PowerUX (nh6000 box) ** ** Contributed by Bob Miorelli, Pratt & Whitney */ #ifdef _PowerUX # ifndef __svr4__ # define __svr4__ # endif /* ! __svr4__ */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/etc/mail/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/etc/mail/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ # define SYSLOG_BUFSIZE 1024 # define HASSNPRINTF 1 /* has snprintf(3) and vsnprintf(3) */ # define LA_TYPE LA_ZERO typedef struct msgb mblk_t; # undef offsetof /* avoid stddefs.h and sys/sysmacros.h conflict */ #endif /* _PowerUX */ /* ** Siemens Nixdorf Informationssysteme AG SINIX ** ** Contributed by Gerald Rinske ** of Siemens Business Services VAS. */ #ifdef sinix # define HASRANDOM 0 /* has random(3) */ # define SYSLOG_BUFSIZE 1024 #endif /* sinix */ /* ** CRAY T3E ** ** Contributed by Manu Mahonen ** of Center for Scientific Computing. */ #ifdef _CRAY # define GET_IPOPT_DST(dst) *(struct in_addr *)&(dst) #endif /* _CRAY */ /* ** Motorola 922, MC88110, UNIX SYSTEM V/88 Release 4.0 Version 4.3 ** ** Contributed by Sergey Rusanov */ #ifdef MOTO # define HASFCHMOD 1 # define HASSETRLIMIT 0 # define HASSETSID 1 # define HASSETREUID 1 # define HASULIMIT 1 # define HASWAITPID 1 # define HASGETDTABLESIZE 1 # define HASGETUSERSHELL 1 # define IP_SRCROUTE 0 # define IDENTPROTO 0 # define RES_DNSRCH_VARIABLE _res_dnsrch # define _PATH_UNIX "/unix" # define _PATH_VENDOR_CF "/etc/sendmail.cf" # define _PATH_SENDMAILPID "/var/run/sendmail.pid" #endif /* MOTO */ /********************************************************************** ** End of Per-Operating System defines **********************************************************************/ /********************************************************************** ** More general defines **********************************************************************/ /* general BSD defines */ #ifdef BSD # define HASGETDTABLESIZE 1 /* has getdtablesize(2) call */ # define HASSETREUID 1 /* has setreuid(2) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # ifndef IP_SRCROUTE # define IP_SRCROUTE 1 /* can check IP source routing */ # endif /* ! IP_SRCROUTE */ # ifndef HASSETRLIMIT # define HASSETRLIMIT 1 /* has setrlimit(2) call */ # endif /* ! HASSETRLIMIT */ # ifndef HASFLOCK # define HASFLOCK 1 /* has flock(2) call */ # endif /* ! HASFLOCK */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TM_ZONE /* use tm->tm_zone variable */ # endif /* ! TZ_TYPE */ #endif /* BSD */ /* general System V Release 4 defines */ #ifdef __svr4__ # define SYSTEM5 1 # define USESETEUID 1 /* has usable seteuid(2) call */ # define HASINITGROUPS 1 /* has initgroups(3) call */ # define BSD_COMP 1 /* get BSD ioctl calls */ # ifndef HASSETRLIMIT # define HASSETRLIMIT 1 /* has setrlimit(2) call */ # endif /* ! HASSETRLIMIT */ # ifndef HASGETUSERSHELL # define HASGETUSERSHELL 0 /* does not have getusershell(3) call */ # endif /* ! HASGETUSERSHELL */ # ifndef HASFCHMOD # define HASFCHMOD 1 /* most (all?) SVr4s seem to have fchmod(2) */ # endif /* ! HASFCHMOD */ # ifndef _PATH_UNIX # define _PATH_UNIX "/unix" # endif /* ! _PATH_UNIX */ # ifndef _PATH_VENDOR_CF # define _PATH_VENDOR_CF "/usr/ucblib/sendmail.cf" # endif /* ! _PATH_VENDOR_CF */ # ifndef _PATH_SENDMAILPID # define _PATH_SENDMAILPID "/usr/ucblib/sendmail.pid" # endif /* ! _PATH_SENDMAILPID */ # ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 128 # endif /* ! SYSLOG_BUFSIZE */ # ifndef SFS_TYPE # define SFS_TYPE SFS_STATVFS # endif /* ! SFS_TYPE */ # define USE_SIGLONGJMP 1 /* sigsetjmp needed for signal handling */ #endif /* __svr4__ */ /* general System V defines */ #ifdef SYSTEM5 # include # define HASUNAME 1 /* use System V uname(2) system call */ # define SYS5SETPGRP 1 /* use System V setpgrp(2) syscall */ # define HASSETVBUF 1 /* we have setvbuf(3) in libc */ # ifndef HASULIMIT # define HASULIMIT 1 /* has the ulimit(2) syscall */ # endif /* ! HASULIMIT */ # ifndef LA_TYPE # ifdef MIOC_READKSYM # define LA_TYPE LA_READKSYM /* use MIOC_READKSYM ioctl */ # else /* MIOC_READKSYM */ # define LA_TYPE LA_INT /* assume integer load average */ # endif /* MIOC_READKSYM */ # endif /* ! LA_TYPE */ # ifndef SFS_TYPE # define SFS_TYPE SFS_USTAT /* use System V ustat(2) syscall */ # endif /* ! SFS_TYPE */ # ifndef TZ_TYPE # define TZ_TYPE TZ_TZNAME /* use tzname[] vector */ # endif /* ! TZ_TYPE */ #endif /* SYSTEM5 */ /* general POSIX defines */ #ifdef _POSIX_VERSION # define HASSETSID 1 /* has Posix setsid(2) call */ # define HASWAITPID 1 /* has Posix waitpid(2) call */ # if _POSIX_VERSION >= 199500 && !defined(USESETEUID) # define USESETEUID 1 /* has usable seteuid(2) call */ # endif /* _POSIX_VERSION >= 199500 && !defined(USESETEUID) */ #endif /* _POSIX_VERSION */ /* ** Tweaking for systems that (for example) claim to be BSD or POSIX ** but don't have all the standard BSD or POSIX routines (boo hiss). */ #ifdef titan # undef HASINITGROUPS /* doesn't have initgroups(3) call */ #endif /* titan */ #ifdef _CRAYCOM # undef HASSETSID /* despite POSIX claim, doesn't have setsid */ #endif /* _CRAYCOM */ #ifdef MOTO # undef USESETEUID #endif /* MOTO */ /* ** Due to a "feature" in some operating systems such as Ultrix 4.3 and ** HPUX 8.0, if you receive a "No route to host" message (ICMP message ** ICMP_UNREACH_HOST) on _any_ connection, all connections to that host ** are closed. Some firewalls return this error if you try to connect ** to the IDENT port (113), so you can't receive email from these hosts ** on these systems. The firewall really should use a more specific ** message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB. If ** not explicitly set to zero above, default it on. */ #ifndef IDENTPROTO # define IDENTPROTO 1 /* use IDENT proto (RFC 1413) */ #endif /* ! IDENTPROTO */ #ifndef IP_SRCROUTE # define IP_SRCROUTE 1 /* Detect IP source routing */ #endif /* ! IP_SRCROUTE */ #ifndef HASGETUSERSHELL # define HASGETUSERSHELL 1 /* libc has getusershell(3) call */ #endif /* ! HASGETUSERSHELL */ #ifndef NETUNIX # define NETUNIX 1 /* include unix domain support */ #endif /* ! NETUNIX */ #ifndef HASRANDOM # define HASRANDOM 1 /* has random(3) support */ #endif /* ! HASRANDOM */ #ifndef HASFLOCK # define HASFLOCK 0 /* assume no flock(2) support */ #endif /* ! HASFLOCK */ #ifndef HASSETREUID # define HASSETREUID 0 /* assume no setreuid(2) call */ #endif /* ! HASSETREUID */ #ifndef HASFCHMOD # define HASFCHMOD 0 /* assume no fchmod(2) syscall */ #endif /* ! HASFCHMOD */ #ifndef USESETEUID # define USESETEUID 0 /* assume no seteuid(2) call or no saved ids */ #endif /* ! USESETEUID */ #ifndef HASSETRLIMIT # define HASSETRLIMIT 0 /* assume no setrlimit(2) support */ #endif /* ! HASSETRLIMIT */ #ifndef HASULIMIT # define HASULIMIT 0 /* assume no ulimit(2) support */ #endif /* ! HASULIMIT */ #ifndef SECUREWARE # define SECUREWARE 0 /* assume no SecureWare C2 auditing hooks */ #endif /* ! SECUREWARE */ #ifndef USE_SIGLONGJMP # define USE_SIGLONGJMP 0 /* assume setjmp handles signals properly */ #endif /* ! USE_SIGLONGJMP */ #ifndef FDSET_CAST # define FDSET_CAST /* (empty) cast for fd_set arg to select */ #endif /* ! FDSET_CAST */ /* ** Pick a mailer setuid method for changing the current uid */ #define USE_SETEUID 0 #define USE_SETREUID 1 #define USE_SETUID 2 #if USESETEUID # define MAILER_SETUID_METHOD USE_SETEUID #else /* USESETEUID */ # if HASSETREUID # define MAILER_SETUID_METHOD USE_SETREUID # else /* HASSETREUID */ # define MAILER_SETUID_METHOD USE_SETUID # endif /* HASSETREUID */ #endif /* USESETEUID */ /* ** If no type for argument two of getgroups call is defined, assume ** it's an integer -- unfortunately, there seem to be several choices ** here. */ #ifndef GIDSET_T # define GIDSET_T int #endif /* ! GIDSET_T */ #ifndef UID_T # define UID_T uid_t #endif /* ! UID_T */ #ifndef GID_T # define GID_T gid_t #endif /* ! GID_T */ #ifndef SIZE_T # define SIZE_T size_t #endif /* ! SIZE_T */ #ifndef MODE_T # define MODE_T mode_t #endif /* ! MODE_T */ #ifndef ARGV_T # define ARGV_T char ** #endif /* ! ARGV_T */ #ifndef SOCKADDR_LEN_T # define SOCKADDR_LEN_T int #endif /* ! SOCKADDR_LEN_T */ #ifndef SOCKOPT_LEN_T # define SOCKOPT_LEN_T int #endif /* ! SOCKOPT_LEN_T */ #ifndef QUAD_T # define QUAD_T unsigned long #endif /* ! QUAD_T */ /********************************************************************** ** Remaining definitions should never have to be changed. They are ** primarily to provide back compatibility for older systems -- for ** example, it includes some POSIX compatibility definitions **********************************************************************/ /* System 5 compatibility */ #ifndef S_ISREG # define S_ISREG(foo) ((foo & S_IFMT) == S_IFREG) #endif /* ! S_ISREG */ #ifndef S_ISDIR # define S_ISDIR(foo) ((foo & S_IFMT) == S_IFDIR) #endif /* ! S_ISDIR */ #if !defined(S_ISLNK) && defined(S_IFLNK) # define S_ISLNK(foo) ((foo & S_IFMT) == S_IFLNK) #endif /* !defined(S_ISLNK) && defined(S_IFLNK) */ #if !defined(S_ISFIFO) # if defined(S_IFIFO) # define S_ISFIFO(foo) ((foo & S_IFMT) == S_IFIFO) # else /* defined(S_IFIFO) */ # define S_ISFIFO(foo) FALSE # endif /* defined(S_IFIFO) */ #endif /* !defined(S_ISFIFO) */ #ifndef S_IRUSR # define S_IRUSR 0400 #endif /* ! S_IRUSR */ #ifndef S_IWUSR # define S_IWUSR 0200 #endif /* ! S_IWUSR */ #ifndef S_IRGRP # define S_IRGRP 0040 #endif /* ! S_IRGRP */ #ifndef S_IWGRP # define S_IWGRP 0020 #endif /* ! S_IWGRP */ #ifndef S_IROTH # define S_IROTH 0004 #endif /* ! S_IROTH */ #ifndef S_IWOTH # define S_IWOTH 0002 #endif /* ! S_IWOTH */ /* close-on-exec flag */ #ifndef FD_CLOEXEC # define FD_CLOEXEC 1 #endif /* ! FD_CLOEXEC */ /* ** Older systems don't have this error code -- it should be in ** /usr/include/sysexits.h. */ #ifndef EX_CONFIG # define EX_CONFIG 78 /* configuration error */ #endif /* ! EX_CONFIG */ /* pseudo-codes */ #define EX_QUIT 22 /* drop out of server immediately */ #define EX_RESTART 23 /* restart sendmail daemon */ #define EX_SHUTDOWN 24 /* shutdown sendmail daemon */ /* pseudo-code used for mci_setstat */ #define EX_NOTSTICKY -5 /* don't save persistent status */ /* ** An "impossible" file mode to indicate that the file does not exist. */ #define ST_MODE_NOFILE 0171147 /* unlikely to occur */ /* type of arbitrary pointer */ #ifndef ARBPTR_T # define ARBPTR_T void * #endif /* ! ARBPTR_T */ #ifndef __P # include "sendmail/cdefs.h" #endif /* ! __P */ #if HESIOD && !defined(NAMED_BIND) # define NAMED_BIND 1 /* not one without the other */ #endif /* HESIOD && !defined(NAMED_BIND) */ # if NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) extern int h_errno; # endif /* NAMED_BIND && !defined( __ksr__ ) && !defined( h_errno ) */ #ifdef LDAPMAP # include # include # include /* Some LDAP constants */ # define LDAPMAP_FALSE 0 # define LDAPMAP_TRUE 1 /* ** ldap_init(3) is broken in Umich 3.x and OpenLDAP 1.0/1.1. ** Use the lack of LDAP_OPT_SIZELIMIT to detect old API implementations ** and assume (falsely) that all old API implementations are broken. ** (OpenLDAP 1.2 and later have a working ldap_init(), add -DUSE_LDAP_INIT) */ # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) # define USE_LDAP_INIT 1 # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_INIT) */ /* ** LDAP_OPT_SIZELIMIT is not defined under Umich 3.x nor OpenLDAP 1.x, ** hence ldap_set_option() must not exist. */ # if defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) # define USE_LDAP_SET_OPTION 1 # endif /* defined(LDAP_OPT_SIZELIMIT) && !defined(USE_LDAP_SET_OPTION) */ #endif /* LDAPMAP */ /* ** Do some required dependencies */ #if NETINET || NETINET6 || NETISO # ifndef SMTP # define SMTP 1 /* enable user and server SMTP */ # endif /* ! SMTP */ # ifndef QUEUE # define QUEUE 1 /* enable queueing */ # endif /* ! QUEUE */ # ifndef DAEMON # define DAEMON 1 /* include the daemon (requires IPC & SMTP) */ # endif /* ! DAEMON */ #endif /* NETINET || NETINET6 || NETISO */ /* ** Arrange to use either varargs or stdargs */ #ifdef __STDC__ # include # define VA_LOCAL_DECL va_list ap; # define VA_START(f) va_start(ap, f) # define VA_END va_end(ap) #else /* __STDC__ */ # include # define VA_LOCAL_DECL va_list ap; # define VA_START(f) va_start(ap) # define VA_END va_end(ap) #endif /* __STDC__ */ #if HASUNAME # include # ifdef newstr # undef newstr # endif /* newstr */ #else /* HASUNAME */ # define NODE_LENGTH 32 struct utsname { char nodename[NODE_LENGTH + 1]; }; #endif /* HASUNAME */ #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) # define MAXHOSTNAMELEN 256 #endif /* !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V) */ #if !defined(SIGCHLD) && defined(SIGCLD) # define SIGCHLD SIGCLD #endif /* !defined(SIGCHLD) && defined(SIGCLD) */ #ifndef STDIN_FILENO # define STDIN_FILENO 0 #endif /* ! STDIN_FILENO */ #ifndef STDOUT_FILENO # define STDOUT_FILENO 1 #endif /* ! STDOUT_FILENO */ #ifndef STDERR_FILENO # define STDERR_FILENO 2 #endif /* ! STDERR_FILENO */ #ifndef LOCK_SH # define LOCK_SH 0x01 /* shared lock */ # define LOCK_EX 0x02 /* exclusive lock */ # define LOCK_NB 0x04 /* non-blocking lock */ # define LOCK_UN 0x08 /* unlock */ #endif /* ! LOCK_SH */ #ifndef S_IXOTH # define S_IXOTH (S_IEXEC >> 6) #endif /* ! S_IXOTH */ #ifndef S_IXGRP # define S_IXGRP (S_IEXEC >> 3) #endif /* ! S_IXGRP */ #ifndef S_IXUSR # define S_IXUSR (S_IEXEC) #endif /* ! S_IXUSR */ #ifndef SEEK_SET # define SEEK_SET 0 # define SEEK_CUR 1 # define SEEK_END 2 #endif /* ! SEEK_SET */ #ifndef SIG_ERR # define SIG_ERR ((void (*)()) -1) #endif /* ! SIG_ERR */ #ifndef WEXITSTATUS # define WEXITSTATUS(st) (((st) >> 8) & 0377) #endif /* ! WEXITSTATUS */ #ifndef WIFEXITED # define WIFEXITED(st) (((st) & 0377) == 0) #endif /* ! WIFEXITED */ #ifndef WIFSTOPPED # define WIFSTOPPED(st) (((st) & 0100) == 0) #endif /* ! WIFSTOPPED */ #ifndef WCOREDUMP # define WCOREDUMP(st) (((st) & 0200) != 0) #endif /* ! WCOREDUMP */ #ifndef WTERMSIG # define WTERMSIG(st) (((st) & 0177)) #endif /* ! WTERMSIG */ #ifndef SIGFUNC_DEFINED typedef void (*sigfunc_t) __P((int)); #endif /* ! SIGFUNC_DEFINED */ #ifndef SIGFUNC_RETURN # define SIGFUNC_RETURN #endif /* ! SIGFUNC_RETURN */ #ifndef SIGFUNC_DECL # define SIGFUNC_DECL void #endif /* ! SIGFUNC_DECL */ /* size of syslog buffer */ #ifndef SYSLOG_BUFSIZE # define SYSLOG_BUFSIZE 1024 #endif /* ! SYSLOG_BUFSIZE */ /* ** Size of prescan buffer. ** Despite comments in the _sendmail_ book, this probably should ** not be changed; there are some hard-to-define dependencies. */ #define PSBUFSIZE (MAXNAME + MAXATOM) /* size of prescan buffer */ /* fork routine -- set above using #ifdef _osname_ or in Makefile */ #ifndef FORK # define FORK fork /* function to call to fork mailer */ #endif /* ! FORK */ /* random routine -- set above using #ifdef _osname_ or in Makefile */ #if HASRANDOM # define get_random() random() #else /* HASRANDOM */ # define get_random() ((long) rand()) # ifndef RANDOMSHIFT # define RANDOMSHIFT 8 # endif /* RANDOMSHIFT */ #endif /* HASRANDOM */ /* ** Default to using scanf in readcf. */ #ifndef SCANF # define SCANF 1 #endif /* ! SCANF */ #if _FFR_MILTER /* 32 bit type */ # ifndef SM_INT32 # define SM_INT32 int32_t # endif /* SM_INT32 */ #endif /* _FFR_MILTER */ /* ** SVr4 and similar systems use different routines for setjmp/longjmp ** with signal support */ #if USE_SIGLONGJMP # ifdef jmp_buf # undef jmp_buf # endif /* jmp_buf */ # define jmp_buf sigjmp_buf # ifdef setjmp # undef setjmp # endif /* setjmp */ # define setjmp(env) sigsetjmp(env, 1) # ifdef longjmp # undef longjmp # endif /* longjmp */ # define longjmp(env, val) siglongjmp(env, val) #endif /* USE_SIGLONGJMP */ #if !defined(NGROUPS_MAX) && defined(NGROUPS) # define NGROUPS_MAX NGROUPS /* POSIX naming convention */ #endif /* !defined(NGROUPS_MAX) && defined(NGROUPS) */ /* ** Some snprintf() implementations are rumored not to NUL terminate. */ #if SNPRINTF_IS_BROKEN # ifdef snprintf # undef snprintf # endif /* snprintf */ # define snprintf sm_snprintf # ifdef vsnprintf # undef vsnprintf # endif /* vsnprintf */ # define vsnprintf sm_vsnprintf #endif /* SNPRINTF_IS_BROKEN */ /* ** If we don't have a system syslog, simulate it. */ #if !LOG # define LOG_EMERG 0 /* system is unusable */ # define LOG_ALERT 1 /* action must be taken immediately */ # define LOG_CRIT 2 /* critical conditions */ # define LOG_ERR 3 /* error conditions */ # define LOG_WARNING 4 /* warning conditions */ # define LOG_NOTICE 5 /* normal but significant condition */ # define LOG_INFO 6 /* informational */ # define LOG_DEBUG 7 /* debug-level messages */ #endif /* !LOG */ #if SFIO && defined(ERRLIST_PREDEFINED) # undef ERRLIST_PREDEFINED #endif /* SFIO && defined(ERRLIST_PREDEFINED) */ #ifndef SFIO_STDIO_COMPAT # define SFIO_STDIO_COMPAT 0 #endif /* ! SFIO_STDIO_COMPAT */ #endif /* CONF_H */ Index: head/include/unistd.h =================================================================== --- head/include/unistd.h (revision 65352) +++ head/include/unistd.h (revision 65353) @@ -1,226 +1,227 @@ /*- * Copyright (c) 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)unistd.h 8.12 (Berkeley) 4/27/95 * $FreeBSD$ */ #ifndef _UNISTD_H_ #define _UNISTD_H_ #include #include #include #define STDIN_FILENO 0 /* standard input file descriptor */ #define STDOUT_FILENO 1 /* standard output file descriptor */ #define STDERR_FILENO 2 /* standard error file descriptor */ #ifndef NULL #define NULL 0 /* null pointer constant */ #endif #ifndef _POSIX_SOURCE #define F_ULOCK 0 /* unlock locked section */ #define F_LOCK 1 /* lock a section for exclusive use */ #define F_TLOCK 2 /* test and lock a section for exclusive use */ #define F_TEST 3 /* test a section for locks by other procs */ #endif __BEGIN_DECLS void _exit __P((int)) __dead2; int access __P((const char *, int)); unsigned int alarm __P((unsigned int)); int chdir __P((const char *)); int chown __P((const char *, uid_t, gid_t)); int close __P((int)); int dup __P((int)); int dup2 __P((int, int)); int execl __P((const char *, const char *, ...)); int execle __P((const char *, const char *, ...)); int execlp __P((const char *, const char *, ...)); int execv __P((const char *, char * const *)); int execve __P((const char *, char * const *, char * const *)); int execvp __P((const char *, char * const *)); pid_t fork __P((void)); long fpathconf __P((int, int)); char *getcwd __P((char *, size_t)); gid_t getegid __P((void)); uid_t geteuid __P((void)); gid_t getgid __P((void)); int getgroups __P((int, gid_t [])); char *getlogin __P((void)); pid_t getpgrp __P((void)); pid_t getpid __P((void)); pid_t getppid __P((void)); uid_t getuid __P((void)); int isatty __P((int)); int link __P((const char *, const char *)); #ifndef _LSEEK_DECLARED #define _LSEEK_DECLARED off_t lseek __P((int, off_t, int)); #endif long pathconf __P((const char *, int)); int pause __P((void)); int pipe __P((int *)); ssize_t read __P((int, void *, size_t)); int rmdir __P((const char *)); int setgid __P((gid_t)); int setpgid __P((pid_t, pid_t)); +void setproctitle __P((const char *_fmt, ...)) __printf0like(1, 2); pid_t setsid __P((void)); int setuid __P((uid_t)); unsigned int sleep __P((unsigned int)); long sysconf __P((int)); pid_t tcgetpgrp __P((int)); int tcsetpgrp __P((int, pid_t)); char *ttyname __P((int)); int unlink __P((const char *)); ssize_t write __P((int, const void *, size_t)); extern char *optarg; /* getopt(3) external variables */ extern int optind, opterr, optopt; int getopt __P((int, char * const [], const char *)); #ifndef _POSIX_SOURCE #ifdef __STDC__ struct timeval; /* select(2) */ #endif int acct __P((const char *)); int async_daemon __P((void)); char *brk __P((const char *)); int chroot __P((const char *)); size_t confstr __P((int, char *, size_t)); char *crypt __P((const char *, const char *)); const char *crypt_get_format __P((void)); int crypt_set_format __P((const char *)); int des_cipher __P((const char *, char *, long, int)); int des_setkey __P((const char *key)); int encrypt __P((char *, int)); void endusershell __P((void)); int exect __P((const char *, char * const *, char * const *)); int fchdir __P((int)); int fchown __P((int, uid_t, gid_t)); char *fflagstostr __P((u_long)); int fsync __P((int)); #ifndef _FTRUNCATE_DECLARED #define _FTRUNCATE_DECLARED int ftruncate __P((int, off_t)); #endif int getdomainname __P((char *, int)); int getdtablesize __P((void)); int getgrouplist __P((const char *, int, int *, int *)); long gethostid __P((void)); int gethostname __P((char *, int)); char *getlogin_r __P((char *, int)); mode_t getmode __P((const void *, mode_t)); int getpagesize __P((void)) __pure2; char *getpass __P((const char *)); int getpgid __P((pid_t _pid)); int getresgid __P((gid_t *, gid_t *, gid_t *)); int getresuid __P((uid_t *, uid_t *, uid_t *)); int getsid __P((pid_t _pid)); char *getusershell __P((void)); char *getwd __P((char *)); /* obsoleted by getcwd() */ int initgroups __P((const char *, int)); int iruserok __P((unsigned long, int, const char *, const char *)); int iruserok_sa __P((const void *, int, int, const char *, const char *)); int issetugid __P((void)); int lchown __P((const char *, uid_t, gid_t)); int lockf __P((int, int, off_t)); char *mkdtemp __P((char *)); int mknod __P((const char *, mode_t, dev_t)); int mkstemp __P((char *)); int mkstemps __P((char *, int)); char *mktemp __P((char *)); int nfssvc __P((int, void *)); int nice __P((int)); ssize_t pread __P((int, void *, size_t, off_t)); int profil __P((char *, size_t, vm_offset_t, int)); ssize_t pwrite __P((int, const void *, size_t, off_t)); int rcmd __P((char **, int, const char *, const char *, const char *, int *)); int rcmd_af __P((char **, int, const char *, const char *, const char *, int *, int)); char *re_comp __P((const char *)); int re_exec __P((const char *)); int readlink __P((const char *, char *, int)); int reboot __P((int)); int revoke __P((const char *)); pid_t rfork __P((int)); pid_t rfork_thread __P((int, void *, int (*) __P((void *)), void *)); int rresvport __P((int *)); int rresvport_af __P((int *, int)); int ruserok __P((const char *, int, const char *, const char *)); char *sbrk __P((int)); int select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); int setdomainname __P((const char *, int)); int setegid __P((gid_t)); int seteuid __P((uid_t)); int setgroups __P((int, const gid_t *)); void sethostid __P((long)); int sethostname __P((const char *, int)); int setkey __P((const char *)); int setlogin __P((const char *)); void *setmode __P((const char *)); int setpgrp __P((pid_t _pid, pid_t _pgrp)); /* obsoleted by setpgid() */ int setregid __P((gid_t, gid_t)); int setresgid __P((gid_t, gid_t, gid_t)); int setresuid __P((uid_t, uid_t, uid_t)); int setreuid __P((uid_t, uid_t)); int setrgid __P((gid_t)); int setruid __P((uid_t)); void setusershell __P((void)); int strtofflags __P((char **, u_long *, u_long *)); int swapon __P((const char *)); int symlink __P((const char *, const char *)); void sync __P((void)); int syscall __P((int, ...)); off_t __syscall __P((quad_t, ...)); #ifndef _TRUNCATE_DECLARED #define _TRUNCATE_DECLARED int truncate __P((const char *, off_t)); #endif int ttyslot __P((void)); unsigned int ualarm __P((unsigned int, unsigned int)); int undelete __P((const char *)); int unwhiteout __P((const char *)); int usleep __P((unsigned int)); void *valloc __P((size_t)); /* obsoleted by malloc() */ pid_t vfork __P((void)); extern char *suboptarg; /* getsubopt(3) external variable */ int getsubopt __P((char **, char * const *, char **)); #endif /* !_POSIX_SOURCE */ extern int optreset; /* getopt(3) external variable */ __END_DECLS #endif /* !_UNISTD_H_ */ Index: head/lib/libc/gen/Makefile.inc =================================================================== --- head/lib/libc/gen/Makefile.inc (revision 65352) +++ head/lib/libc/gen/Makefile.inc (revision 65353) @@ -1,128 +1,128 @@ # @(#)Makefile.inc 8.6 (Berkeley) 5/4/95 # $FreeBSD$ # machine-independent gen sources .PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/gen ${.CURDIR}/../libc/gen SRCS+= _rand48.c _spinlock_stub.c alarm.c arc4random.c assert.c \ basename.c \ clock.c closedir.c confstr.c \ crypt.c ctermid.c daemon.c devname.c dirname.c disklabel.c \ dlfcn.c drand48.c erand48.c err.c errlst.c \ exec.c fnmatch.c fstab.c ftok.c fts.c getbootfile.c getbsize.c \ getcap.c getcwd.c getdomainname.c getgrent.c getgrouplist.c \ gethostname.c getloadavg.c getlogin.c getmntinfo.c getnetgrent.c \ getobjformat.c getosreldate.c getpagesize.c \ getpass.c getpwent.c getttyent.c \ getusershell.c getvfsbyname.c getvfsent.c glob.c \ initgroups.c isatty.c jrand48.c lcong48.c \ lockf.c lrand48.c mrand48.c msgctl.c \ msgget.c msgrcv.c msgsnd.c nice.c \ nlist.c nrand48.c ntp_gettime.c opendir.c \ pause.c popen.c psignal.c pwcache.c raise.c readdir.c rewinddir.c \ posixshm.c \ scandir.c seed48.c seekdir.c semconfig.c semctl.c semget.c semop.c \ - setdomainname.c sethostname.c setjmperr.c setmode.c shmat.c \ - shmctl.c shmdt.c shmget.c siginterrupt.c siglist.c signal.c \ + setdomainname.c sethostname.c setjmperr.c setmode.c setproctitle.c \ + shmat.c shmctl.c shmdt.c shmget.c siginterrupt.c siglist.c signal.c \ sigsetops.c sleep.c srand48.c stringlist.c strtofflags.c \ sysconf.c sysctl.c sysctlbyname.c \ syslog.c telldir.c termios.c time.c times.c timezone.c ttyname.c \ ttyslot.c ualarm.c uname.c unvis.c usleep.c utime.c valloc.c vis.c \ wait.c wait3.c waitpid.c # machine-dependent gen sources .include "${.CURDIR}/../libc/${MACHINE_ARCH}/gen/Makefile.inc" .if ${LIB} == "c" MAN3+= alarm.3 arc4random.3 clock.3 \ basename.3 \ confstr.3 ctermid.3 daemon.3 \ devname.3 directory.3 dirname.3 dladdr.3 dllockinit.3 dlopen.3 \ err.3 exec.3 fnmatch.3 frexp.3 ftok.3 fts.3 \ getbootfile.3 getbsize.3 getcap.3 getcwd.3 \ getdiskbyname.3 getdomainname.3 getfsent.3 \ getgrent.3 getgrouplist.3 gethostname.3 getloadavg.3 \ getmntinfo.3 getnetgrent.3 getobjformat.3 \ getpagesize.3 getpass.3 getpwent.3 \ getttyent.3 getusershell.3 getvfsbyname.3 getvfsent.3 \ glob.3 initgroups.3 isinf.3 \ ldexp.3 lockf.3 modf.3 msgctl.3 msgget.3 msgrcv.3 msgsnd.3 \ nice.3 nlist.3 pause.3 popen.3 psignal.3 pwcache.3 \ raise.3 rand48.3 rfork_thread.3 \ - scandir.3 setjmp.3 setmode.3 shm_open.3 \ + scandir.3 setjmp.3 setmode.3 setproctitle.3 shm_open.3 \ siginterrupt.3 signal.3 sigsetops.3 sleep.3 stringlist.3 \ strtofflags.3 sysconf.3 sysctl.3 syslog.3 tcgetpgrp.3 \ tcsendbreak.3 tcsetattr.3 tcsetpgrp.3 time.3 times.3 timezone.3 \ ttyname.3 tzset.3 ualarm.3 uname.3 unvis.3 usleep.3 utime.3 \ valloc.3 vis.3 MLINKS+=arc4random.3 arc4random_addrandom.3 arc4random.3 arc4random_stir.3 MLINKS+=crypt.3 des_cipher.3 crypt.3 des_setkey.3 crypt.3 encrypt.3 \ crypt.3 setkey.3 MLINKS+=ctermid.3 ctermid_r.3 MLINKS+=directory.3 closedir.3 directory.3 dirfd.3 directory.3 opendir.3 \ directory.3 readdir.3 directory.3 rewinddir.3 directory.3 seekdir.3 \ directory.3 telldir.3 MLINKS+=dlopen.3 dlclose.3 dlopen.3 dlerror.3 dlopen.3 dlsym.3 MLINKS+=err.3 err_set_exit.3 err.3 err_set_file.3 err.3 errc.3 err.3 errx.3 \ err.3 verr.3 err.3 verrc.3 err.3 verrx.3 err.3 vwarn.3 err.3 vwarnc.3 \ err.3 vwarnx.3 err.3 warnc.3 err.3 warn.3 err.3 warnx.3 MLINKS+=exec.3 execl.3 exec.3 execle.3 exec.3 execlp.3 exec.3 exect.3 \ exec.3 execv.3 exec.3 execvp.3 MLINKS+=fts.3 fts_children.3 fts.3 fts_close.3 fts.3 fts_open.3 \ fts.3 fts_read.3 fts.3 fts_set.3 MLINKS+=getcap.3 cgetcap.3 getcap.3 cgetclose.3 getcap.3 cgetent.3 \ getcap.3 cgetfirst.3 getcap.3 cgetmatch.3 getcap.3 cgetnext.3 \ getcap.3 cgetnum.3 getcap.3 cgetset.3 getcap.3 cgetstr.3 \ getcap.3 cgetustr.3 MLINKS+=getcwd.3 getwd.3 MLINKS+=getdomainname.3 setdomainname.3 MLINKS+=getfsent.3 endfsent.3 getfsent.3 getfsfile.3 getfsent.3 getfsspec.3 \ getfsent.3 getfstype.3 getfsent.3 setfsent.3 MLINKS+=getgrent.3 endgrent.3 getgrent.3 getgrgid.3 getgrent.3 getgrnam.3 \ getgrent.3 setgrent.3 getgrent.3 setgroupent.3 MLINKS+=gethostname.3 sethostname.3 MLINKS+=getnetgrent.3 endnetgrent.3 getnetgrent.3 innetgr.3 \ getnetgrent.3 setnetgrent.3 MLINKS+=getpwent.3 endpwent.3 getpwent.3 getpwnam.3 getpwent.3 getpwuid.3 \ getpwent.3 setpassent.3 getpwent.3 setpwent.3 getpwent.3 setpwfile.3 MLINKS+=getttyent.3 endttyent.3 getttyent.3 getttynam.3 \ getttyent.3 isdialuptty.3 getttyent.3 isnettty.3 \ getttyent.3 setttyent.3 MLINKS+=getusershell.3 endusershell.3 getusershell.3 setusershell.3 MLINKS+=getvfsent.3 endvfsent.3 getvfsent.3 getvfsbytype.3 \ getvfsent.3 setvfsent.3 getvfsent.3 vfsisloadable.3 \ getvfsent.3 vfsload.3 MLINKS+=glob.3 globfree.3 MLINKS+=isinf.3 isnan.3 isinf.3 isnanf.3 MLINKS+=popen.3 pclose.3 MLINKS+=psignal.3 sys_siglist.3 psignal.3 sys_signame.3 MLINKS+=psignal.3 strsignal.3 psignal.3 sys_siglist.3 psignal.3 sys_signame.3 MLINKS+=pwcache.3 group_from_gid.3 pwcache.3 user_from_uid.3 MLINKS+=rand48.3 _rand48.3 rand48.3 drand48.3 rand48.3 erand48.3 \ rand48.3 jrand48.3 rand48.3 lcong48.3 rand48.3 lrand48.3 \ rand48.3 mrand48.3 rand48.3 nrand48.3 rand48.3 seed48.3 \ rand48.3 srand48.3 MLINKS+=scandir.3 alphasort.3 MLINKS+=strtofflags.3 fflagstostr.3 MLINKS+=setjmp.3 _longjmp.3 setjmp.3 _setjmp.3 setjmp.3 longjmp.3 \ setjmp.3 longjmperr.3 setjmp.3 longjmperror.3 \ setjmp.3 siglongjmp.3 setjmp.3 sigsetjmp.3 MLINKS+=setmode.3 getmode.3 MLINKS+=shm_open.3 shm_unlink.3 MLINKS+=sigsetops.3 sigaddset.3 sigsetops.3 sigdelset.3 \ sigsetops.3 sigemptyset.3 sigsetops.3 sigfillset.3 \ sigsetops.3 sigismember.3 MLINKS+=sysctl.3 sysctlbyname.3 MLINKS+=syslog.3 closelog.3 syslog.3 openlog.3 syslog.3 setlogmask.3 \ syslog.3 vsyslog.3 MLINKS+=tcsendbreak.3 tcdrain.3 tcsendbreak.3 tcflow.3 tcsendbreak.3 tcflush.3 MLINKS+=tcsetattr.3 cfgetispeed.3 tcsetattr.3 cfgetospeed.3 \ tcsetattr.3 cfmakeraw.3 tcsetattr.3 cfsetispeed.3 \ tcsetattr.3 cfsetospeed.3 tcsetattr.3 cfsetspeed.3 \ tcsetattr.3 tcgetattr.3 MLINKS+=ttyname.3 isatty.3 ttyname.3 ttyslot.3 MLINKS+=tzset.3 tzsetwall.3 MLINKS+=unvis.3 strunvis.3 unvis.3 strunvisx.3 MLINKS+=vis.3 strvis.3 vis.3 strvisx.3 .endif Index: head/lib/libutil/setproctitle.c =================================================================== --- head/lib/libutil/setproctitle.c (revision 65352) +++ head/lib/libutil/setproctitle.c (nonexistent) @@ -1,147 +0,0 @@ -/* - * Copyright (c) 1995 Peter Wemm - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, is permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice immediately at the beginning of the file, without modification, - * this list of conditions, and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Absolutely no warranty of function or purpose is made by the author - * Peter Wemm. - * - * $FreeBSD$ - */ - -#include -#include -#include -#include - -#include -#include -#include - -#include -#include -#include -#include - -/* - * Older FreeBSD 2.0, 2.1 and 2.2 had different ps_strings structures and - * in different locations. - * 1: old_ps_strings at the very top of the stack. - * 2: old_ps_strings at SPARE_USRSPACE below the top of the stack. - * 3: ps_strings at the very top of the stack. - * This attempts to support a kernel built in the #2 and #3 era. - */ - -struct old_ps_strings { - char *old_ps_argvstr; - int old_ps_nargvstr; - char *old_ps_envstr; - int old_ps_nenvstr; -}; -#define OLD_PS_STRINGS ((struct old_ps_strings *) \ - (USRSTACK - SPARE_USRSPACE - sizeof(struct old_ps_strings))) - -#include - -#define SPT_BUFSIZE 2048 /* from other parts of sendmail */ -extern char * __progname; /* is this defined in a .h anywhere? */ - -void -setproctitle(const char *fmt, ...) -{ - static struct ps_strings *ps_strings; - static char buf[SPT_BUFSIZE]; - static char obuf[SPT_BUFSIZE]; - static char **oargv, *kbuf; - static int oargc = -1; - static char *nargv[2] = { buf, NULL }; - char **nargvp; - int nargc; - va_list ap; - size_t len; - unsigned long ul_ps_strings; - int oid[4]; - - va_start(ap, fmt); - - if (fmt) { - buf[sizeof(buf) - 1] = '\0'; - - if (fmt[0] == '-') { - /* skip program name prefix */ - fmt++; - len = 0; - } else { - /* print program name heading for grep */ - (void) snprintf(buf, sizeof(buf), "%s: ", __progname); - len = strlen(buf); - } - - /* print the argument string */ - (void) vsnprintf(buf + len, sizeof(buf) - len, fmt, ap); - - nargvp = nargv; - nargc = 1; - kbuf = buf; - } else if (*obuf != '\0') { - /* Idea from NetBSD - reset the title on fmt == NULL */ - nargvp = oargv; - nargc = oargc; - kbuf = obuf; - } else - /* Nothing to restore */ - return; - - va_end(ap); - - /* Set the title into the kernel cached command line */ - oid[0] = CTL_KERN; - oid[1] = KERN_PROC; - oid[2] = KERN_PROC_ARGS; - oid[3] = getpid(); - sysctl(oid, 4, 0, 0, kbuf, strlen(kbuf) + 1); - - if (ps_strings == NULL) { - len = sizeof(ul_ps_strings); - if (sysctlbyname("kern.ps_strings", &ul_ps_strings, &len, NULL, - 0) == -1) - ul_ps_strings = PS_STRINGS; - ps_strings = (struct ps_strings *)ul_ps_strings; - } - - /* PS_STRINGS points to zeroed memory on a style #2 kernel */ - if (ps_strings->ps_argvstr) { - /* style #3 */ - if (oargc == -1) { - /* Record our original args */ - oargc = ps_strings->ps_nargvstr; - oargv = ps_strings->ps_argvstr; - for (nargc = len = 0; nargc < oargc; nargc++) { - snprintf(obuf + len, sizeof(obuf) - len, "%s%s", - len ? " " : "", oargv[nargc]); - if (len) - len++; - len += strlen(oargv[nargc]); - if (len >= sizeof(obuf)) - break; - } - } - ps_strings->ps_nargvstr = nargc; - ps_strings->ps_argvstr = nargvp; - } else { - /* style #2 - we can only restore our first arg :-( */ - if (*obuf == '\0') - strncpy(obuf, OLD_PS_STRINGS->old_ps_argvstr, - sizeof(obuf) - 1); - OLD_PS_STRINGS->old_ps_nargvstr = 1; - OLD_PS_STRINGS->old_ps_argvstr = nargvp[0]; - } -} Property changes on: head/lib/libutil/setproctitle.c ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libutil/setproctitle.3 =================================================================== --- head/lib/libutil/setproctitle.3 (revision 65352) +++ head/lib/libutil/setproctitle.3 (nonexistent) @@ -1,102 +0,0 @@ -.\" Copyright (c) 1995 Peter Wemm -.\" All rights reserved. -.\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, is permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice immediately at the beginning of the file, without modification, -.\" this list of conditions, and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. This work was done expressly for inclusion into FreeBSD. Other use -.\" is permitted provided this notation is included. -.\" 4. Absolutely no warranty of function or purpose is made by the author -.\" Peter Wemm. -.\" 5. Modifications may be freely made to this file providing the above -.\" conditions are met. -.\" -.\" $FreeBSD$ -.\" -.\" The following requests are required for all man pages. -.Dd December 16, 1995 -.Os FreeBSD -.Dt SETPROCTITLE 3 -.Sh NAME -.Nm setproctitle -.Nd set the process title for -.Xr ps 1 -.Sh LIBRARY -.Lb libutil -.Sh SYNOPSIS -.Fd #include -.Fd #include -.Ft void -.Fn setproctitle "const char *fmt" "..." -.Sh DESCRIPTION -The -.Fn setproctitle -library routine sets the process title that appears on the -.Xr ps 1 -command. -.Pp -The title is set from the executable's name, followed by the -result of a -.Xr printf 3 -style expansion of the arguments as specified by the -.Va fmt -argument. -If the -.Va fmt -argument begins with a -.Dq - -character, the executable's name is skipped. -.Pp -If -.Va fmt -is NULL, the process title is restored. -.Sh EXAMPLES -To set the title on a daemon to indicate its activity: -.Bd -literal -offset indent -setproctitle("talking to %s", inet_ntoa(addr)); -.Ed -.Sh SEE ALSO -.Xr ps 1 , -.Xr w 1 , -.Xr kvm 3 , -.Xr kvm_getargv 3 , -.Xr printf 3 -.Sh STANDARDS -.Fn setproctitle -is implicitly non-standard. Other methods of causing the -.Xr ps 1 -command line to change, including copying over the argv[0] string are -also implicitly non-portable. It is preferable to use an operating system -supplied -.Fn setproctitle -if present. -.Pp -Unfortunately, it is possible that there are other calling conventions -to other versions of -.Fn setproctitle , -although none have been found by the author as yet. This is believed to be -the predominant convention. -.Pp -It is thought that the implementation is compatible with other systems, -including -.Nx -and -.Tn BSD/OS . -.Sh HISTORY -.Fn setproctitle -first appeared in -.Fx 2.2 . -Other operating systems have -similar functions. -.Sh AUTHORS -.An Peter Wemm Aq peter@FreeBSD.org -stole the idea from the -.Sy "Sendmail 8.7.3" -source code by -.An Eric Allman Aq eric@sendmail.org . Property changes on: head/lib/libutil/setproctitle.3 ___________________________________________________________________ Deleted: svn:keywords ## -1 +0,0 ## -FreeBSD=%H \ No newline at end of property Index: head/lib/libutil/Makefile =================================================================== --- head/lib/libutil/Makefile (revision 65352) +++ head/lib/libutil/Makefile (revision 65353) @@ -1,42 +1,42 @@ # @(#)Makefile 8.1 (Berkeley) 6/4/93 # $FreeBSD$ LIB= util SHLIB_MAJOR= 3 SHLIB_MINOR= 0 CFLAGS+=-Wall -DLIBC_SCCS -I${.CURDIR} -I${.CURDIR}/../../sys CFLAGS+=-DINET6 -SRCS= login.c login_tty.c logout.c logwtmp.c pty.c setproctitle.c \ +SRCS= login.c login_tty.c logout.c logwtmp.c pty.c \ login_cap.c login_class.c login_auth.c login_times.c login_ok.c \ login_crypt.c _secure_path.c uucplock.c property.c auth.c \ realhostname.c fparseln.c INCS= libutil.h login_cap.h MAN3+= login.3 login_auth.3 login_tty.3 logout.3 logwtmp.3 pty.3 \ - setproctitle.3 login_cap.3 login_class.3 login_times.3 login_ok.3 \ + login_cap.3 login_class.3 login_times.3 login_ok.3 \ _secure_path.3 uucplock.3 property.3 auth.3 realhostname.3 \ realhostname_sa.3 trimdomain.3 fparseln.3 MAN5+= login.conf.5 auth.conf.5 MLINKS+= property.3 properties_read.3 property.3 properties_free.3 MLINKS+= property.3 property_find.3 MLINKS+= auth.3 auth_getval.3 MLINKS+= pty.3 openpty.3 pty.3 forkpty.3 MLINKS+=login_cap.3 login_getclassbyname.3 login_cap.3 login_close.3 \ login_cap.3 login_getclass.3 login_cap.3 login_getuserclass.3 \ login_cap.3 login_getcapstr.3 login_cap.3 login_getcaplist.3 \ login_cap.3 login_getstyle.3 login_cap.3 login_getcaptime.3 \ login_cap.3 login_getcapnum.3 login_cap.3 login_getcapsize.3 \ login_cap.3 login_getcapbool.3 login_cap.3 login_getpath.3 \ login_cap.3 login_getpwclass.3 login_cap.3 login_setcryptfmt.3 MLINKS+=login_class.3 setusercontext.3 login_class.3 setclasscontext.3 \ login_class.3 setclassenvironment.3 login_class.3 setclassresources.3 MLINKS+=login_times.3 parse_lt.3 login_times.3 in_ltm.3 \ login_times.3 in_lt.3 login_times.3 in_ltms.3 \ login_times.3 in_lts.3 MLINKS+=login_ok.3 auth_ttyok.3 login_ok.3 auth_hostok.3 \ login_ok.3 auth_timeok.3 MLINKS+=login_auth.3 auth_checknologin.3 login_auth.3 auth_cat.3 MLINKS+=uucplock.3 uu_lock.3 uucplock.3 uu_lock_txfr.3 \ uucplock.3 uu_unlock.3 uucplock.3 uu_lockerr.3 .include Index: head/lib/libutil/libutil.h =================================================================== --- head/lib/libutil/libutil.h (revision 65352) +++ head/lib/libutil/libutil.h (revision 65353) @@ -1,99 +1,98 @@ /* * Copyright (c) 1996 Peter Wemm . * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, is permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #ifndef _LIBUTIL_H_ #define _LIBUTIL_H_ #include /* for properties.c */ typedef struct _property { struct _property *next; char *name; char *value; } *properties; /* Avoid pulling in all the include files for no need */ struct termios; struct winsize; struct utmp; struct in_addr; __BEGIN_DECLS -void setproctitle __P((const char *_fmt, ...)) __printf0like(1, 2); void login __P((struct utmp *_ut)); int login_tty __P((int _fd)); int logout __P((char *_line)); void logwtmp __P((const char *_line, const char *_name, const char *_host)); void trimdomain __P((char *_fullhost, int _hostsize)); int openpty __P((int *_amaster, int *_aslave, char *_name, struct termios *_termp, struct winsize *_winp)); int forkpty __P((int *_amaster, char *_name, struct termios *_termp, struct winsize *_winp)); const char *uu_lockerr __P((int _uu_lockresult)); int uu_lock __P((const char *_ttyname)); int uu_unlock __P((const char *_ttyname)); int uu_lock_txfr __P((const char *_ttyname, pid_t _pid)); int _secure_path __P((const char *_path, uid_t _uid, gid_t _gid)); properties properties_read __P((int fd)); void properties_free __P((properties list)); char *property_find __P((properties list, const char *name)); char *auth_getval __P((const char *name)); int realhostname __P((char *host, size_t hsize, const struct in_addr *ip)); struct sockaddr; int realhostname_sa __P((char *host, size_t hsize, struct sockaddr *addr, int addrlen)); #ifdef _STDIO_H_ /* avoid adding new includes */ char *fparseln __P((FILE *, size_t *, size_t *, const char[3], int)); #endif __END_DECLS #define UU_LOCK_INUSE (1) #define UU_LOCK_OK (0) #define UU_LOCK_OPEN_ERR (-1) #define UU_LOCK_READ_ERR (-2) #define UU_LOCK_CREAT_ERR (-3) #define UU_LOCK_WRITE_ERR (-4) #define UU_LOCK_LINK_ERR (-5) #define UU_LOCK_TRY_ERR (-6) #define UU_LOCK_OWNER_ERR (-7) /* return values from realhostname() */ #define HOSTNAME_FOUND (0) #define HOSTNAME_INCORRECTNAME (1) #define HOSTNAME_INVALIDADDR (2) #define HOSTNAME_INVALIDNAME (3) /* fparseln(3) */ #define FPARSELN_UNESCESC 0x01 #define FPARSELN_UNESCCONT 0x02 #define FPARSELN_UNESCCOMM 0x04 #define FPARSELN_UNESCREST 0x08 #define FPARSELN_UNESCALL 0x0f #endif /* !_LIBUTIL_H_ */ Index: head/sys/sys/param.h =================================================================== --- head/sys/sys/param.h (revision 65352) +++ head/sys/sys/param.h (revision 65353) @@ -1,260 +1,260 @@ /*- * Copyright (c) 1982, 1986, 1989, 1993 * The Regents of the University of California. All rights reserved. * (c) UNIX System Laboratories, Inc. * All or some portions of this file are derived from material licensed * to the University of California by American Telephone and Telegraph * Co. or Unix System Laboratories, Inc. and are reproduced herein with * the permission of UNIX System Laboratories, Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by the University of * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * @(#)param.h 8.3 (Berkeley) 4/4/95 * $FreeBSD$ */ #ifndef _SYS_PARAM_H_ #define _SYS_PARAM_H_ #define BSD 199506 /* System version (year & month). */ #define BSD4_3 1 #define BSD4_4 1 #undef __FreeBSD_version -#define __FreeBSD_version 500011 /* Master, propagated to newvers */ +#define __FreeBSD_version 500012 /* Master, propagated to newvers */ #ifndef NULL #define NULL 0 #endif #ifndef LOCORE #include #endif /* * Machine-independent constants (some used in following include files). * Redefined constants are from POSIX 1003.1 limits file. * * MAXCOMLEN should be >= sizeof(ac_comm) (see ) * MAXLOGNAME should be == UT_NAMESIZE+1 (see ) */ #include #define MAXCOMLEN 16 /* max command name remembered */ #define MAXINTERP 32 /* max interpreter file name length */ #define MAXLOGNAME 17 /* max login name length (incl. NUL) */ #define MAXUPRC CHILD_MAX /* max simultaneous processes */ #define NCARGS ARG_MAX /* max bytes for an exec function */ #define NGROUPS NGROUPS_MAX /* max number groups */ #define NOFILE OPEN_MAX /* max open files per process */ #define NOGROUP 65535 /* marker for empty group set member */ #define MAXHOSTNAMELEN 256 /* max hostname size */ /* More types and definitions used throughout the kernel. */ #ifdef _KERNEL #include #include #include #define FALSE 0 #define TRUE 1 #endif #ifndef _KERNEL /* Signals. */ #include #endif /* Machine type dependent parameters. */ #include #ifndef _KERNEL #include #endif /* * Priorities. Note that with 32 run queues, differences less than 4 are * insignificant. */ #define PSWP 0 #define PVM 4 #define PINOD 8 #define PRIBIO 16 #define PVFS 20 #define PZERO 22 /* No longer magic, shouldn't be here. XXX */ #define PSOCK 24 #define PWAIT 32 #define PCONFIG 32 #define PLOCK 36 #define PPAUSE 40 #define PUSER 48 #define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */ #define PRIMASK 0x0ff #define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */ #define NZERO 0 /* default "nice" */ #define NBPW sizeof(int) /* number of bytes per word (integer) */ #define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */ #ifdef _KERNEL #define NODEV (dev_t)(-1) /* non-existent device */ #define NOUDEV (udev_t)(-1) /* non-existent device */ #define NOMAJ 256 /* non-existent device */ #else #define NODEV (dev_t)(-1) /* non-existent device */ #endif /* * Clustering of hardware pages on machines with ridiculously small * page sizes is done here. The paging subsystem deals with units of * CLSIZE pte's describing PAGE_SIZE (from machine/machparam.h) pages each. */ #if 0 #define CLBYTES (CLSIZE*PAGE_SIZE) #endif #define CBLOCK 128 /* Clist block size, must be a power of 2. */ #define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */ /* Data chars/clist. */ #define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE) #define CROUND (CBLOCK - 1) /* Clist rounding. */ /* * File system parameters and macros. * * MAXBSIZE - Filesystems are made out of blocks of at most MAXBSIZE bytes * per block. MAXBSIZE may be made larger without effecting * any existing filesystems as long as it does not exceed MAXPHYS, * and may be made smaller at the risk of not being able to use * filesystems which require a block size exceeding MAXBSIZE. * * BKVASIZE - Nominal buffer space per buffer, in bytes. BKVASIZE is the * minimum KVM memory reservation the kernel is willing to make. * Filesystems can of course request smaller chunks. Actual * backing memory uses a chunk size of a page (PAGE_SIZE). * * If you make BKVASIZE too small you risk seriously fragmenting * the buffer KVM map which may slow things down a bit. If you * make it too big the kernel will not be able to optimally use * the KVM memory reserved for the buffer cache and will wind * up with too-few buffers. * * The default is 16384, roughly 2x the block size used by a * normal UFS filesystem. */ #define MAXBSIZE 65536 /* must be power of 2 */ #define BKVASIZE 16384 /* must be power of 2 */ #define BKVAMASK (BKVASIZE-1) #define MAXFRAG 8 /* * MAXPATHLEN defines the longest permissible path length after expanding * symbolic links. It is used to allocate a temporary buffer from the buffer * pool in which to do the name expansion, hence should be a power of two, * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the * maximum number of symbolic links that may be expanded in a path name. * It should be set high enough to allow all legitimate uses, but halt * infinite loops reasonably quickly. */ #define MAXPATHLEN PATH_MAX #define MAXSYMLINKS 32 /* Bit map related macros. */ #define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY)) #define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY))) #define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY))) #define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0) /* Macros for counting and rounding. */ #ifndef howmany #define howmany(x, y) (((x)+((y)-1))/(y)) #endif #define rounddown(x, y) (((x)/(y))*(y)) #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) /* to any y */ #define roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ #define powerof2(x) ((((x)-1)&(x))==0) /* Macros for min/max. */ #ifndef _KERNEL #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) #endif /* * Constants for setting the parameters of the kernel memory allocator. * * 2 ** MINBUCKET is the smallest unit of memory that will be * allocated. It must be at least large enough to hold a pointer. * * Units of memory less or equal to MAXALLOCSAVE will permanently * allocate physical memory; requests for these size pieces of * memory are quite fast. Allocations greater than MAXALLOCSAVE must * always allocate and free physical memory; requests for these * size allocations should be done infrequently as they will be slow. * * Constraints: PAGE_SIZE <= MAXALLOCSAVE <= 2 ** (MINBUCKET + 14), and * MAXALLOCSIZE must be a power of two. */ #if defined(__alpha__) #define MINBUCKET 5 /* 5 => min allocation of 32 bytes */ #else #define MINBUCKET 4 /* 4 => min allocation of 16 bytes */ #endif #define MAXALLOCSAVE (2 * PAGE_SIZE) /* * Scale factor for scaled integers used to count %cpu time and load avgs. * * The number of CPU `tick's that map to a unique `%age' can be expressed * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that * can be calculated (assuming 32 bits) can be closely approximated using * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15). * * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age', * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024. */ #define FSHIFT 11 /* bits to right of fixed binary point */ #define FSCALE (1<> (PAGE_SHIFT - DEV_BSHIFT)) #define ctodb(db) /* calculates pages to devblks */ \ ((db) << (PAGE_SHIFT - DEV_BSHIFT)) /* * Make this available for most of the kernel. There were too many * things that included sys/systm.h just for panic(). */ #ifdef _KERNEL void panic __P((const char *, ...)) __dead2 __printflike(1, 2); #endif #endif /* _SYS_PARAM_H_ */