conf.h revision 38033
1199482Srdivacky/*
2199482Srdivacky * Copyright (c) 1998 Sendmail, Inc.  All rights reserved.
3199482Srdivacky * Copyright (c) 1983, 1995-1997 Eric P. Allman.  All rights reserved.
4199482Srdivacky * Copyright (c) 1988, 1993
5199482Srdivacky *	The Regents of the University of California.  All rights reserved.
6199482Srdivacky *
7199482Srdivacky * By using this file, you agree to the terms and conditions set
8199482Srdivacky * forth in the LICENSE file which can be found at the top level of
9199482Srdivacky * the sendmail distribution.
10199482Srdivacky *
11199482Srdivacky *
12199482Srdivacky *	@(#)conf.h	8.372 (Berkeley) 6/4/98
13199482Srdivacky */
14199482Srdivacky
15199482Srdivacky/*
16199482Srdivacky**  CONF.H -- All user-configurable parameters for sendmail
17288943Sdim**
18199482Srdivacky**	Send updates to sendmail@Sendmail.ORG so they will be
19249423Sdim**	included in the next release.
20249423Sdim*/
21249423Sdim
22249423Sdim#ifdef __GNUC__
23249423Sdimstruct rusage;	/* forward declaration to get gcc to shut up in wait.h */
24212904Sdim#endif
25234353Sdim
26212904Sdim# include <sys/param.h>
27199482Srdivacky# include <sys/types.h>
28276479Sdim# include <sys/stat.h>
29276479Sdim#ifndef __QNX__
30226633Sdim/* in QNX this grabs bogus LOCK_* manifests */
31199482Srdivacky# include <sys/file.h>
32199482Srdivacky#endif
33199482Srdivacky# include <sys/wait.h>
34205408Srdivacky# include <limits.h>
35205408Srdivacky# include <fcntl.h>
36205408Srdivacky# include <signal.h>
37280031Sdim# include <netdb.h>
38280031Sdim# include <pwd.h>
39280031Sdim
40205408Srdivacky/**********************************************************************
41205408Srdivacky**  Table sizes, etc....
42205408Srdivacky**	There shouldn't be much need to change these....
43205408Srdivacky**********************************************************************/
44205408Srdivacky
45205408Srdivacky# define MAXLINE	2048		/* max line length */
46199482Srdivacky# define MAXNAME	256		/* max length of a name */
47199482Srdivacky# define MAXPV		40		/* max # of parms to mailers */
48199482Srdivacky# define MAXATOM	200		/* max atoms per address */
49280031Sdim# define MAXMAILERS	25		/* maximum mailers known to system */
50280031Sdim# define MAXRWSETS	200		/* max # of sets of rewriting rules */
51226633Sdim# define MAXPRIORITIES	25		/* max values for Precedence: field */
52239462Sdim# define MAXMXHOSTS	100		/* max # of MX records for one host */
53276479Sdim# define SMTPLINELIM	990		/* maximum SMTP line length */
54199482Srdivacky# define MAXKEY		128		/* maximum size of a database key */
55199482Srdivacky# define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
56280031Sdim# define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
57280031Sdim# define MAXALIASDB	12		/* max # of alias databases */
58261991Sdim# define MAXMAPSTACK	12		/* max # of stacked or sequenced maps */
59280031Sdim# define MAXTOCLASS	8		/* max # of message timeout classes */
60261991Sdim# define MAXMIMEARGS	20		/* max args in Content-Type: */
61199482Srdivacky# define MAXMIMENESTING	20		/* max MIME multipart nesting */
62199482Srdivacky# define QUEUESEGSIZE	1000		/* increment for queue size */
63280031Sdim# define MAXQFNAME	20		/* max qf file name length */
64280031Sdim# define MACBUFSIZE	4096		/* max expanded macro buffer size */
65239462Sdim# define TOBUFSIZE	512		/* max buffer to hold address list */
66239462Sdim# define MAXSHORTSTR	203		/* max short string length */
67239462Sdim
68280031Sdim/**********************************************************************
69280031Sdim**  Compilation options.
70199482Srdivacky**	#define these to 1 if they are available;
71199482Srdivacky**	#define them to 0 otherwise.
72199482Srdivacky**  All can be overridden from Makefile.
73280031Sdim**********************************************************************/
74280031Sdim
75280031Sdim# ifndef NETINET
76199482Srdivacky#  define NETINET	1	/* include internet support */
77199482Srdivacky# endif
78199482Srdivacky
79280031Sdim# ifndef NETISO
80280031Sdim#  define NETISO	0	/* do not include ISO socket support */
81212904Sdim# endif
82218893Sdim
83288943Sdim# ifndef NAMED_BIND
84288943Sdim#  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
85288943Sdim# endif
86276479Sdim
87212904Sdim# ifndef XDEBUG
88226633Sdim#  define XDEBUG	1	/* enable extended debugging */
89226633Sdim# endif
90288943Sdim
91288943Sdim# ifndef MATCHGECOS
92288943Sdim#  define MATCHGECOS	1	/* match user names from gecos field */
93288943Sdim# endif
94288943Sdim
95288943Sdim# ifndef DSN
96288943Sdim#  define DSN		1	/* include delivery status notification code */
97288943Sdim# endif
98288943Sdim
99288943Sdim# if !defined(USERDB) && (defined(NEWDB) || defined(HESIOD))
100288943Sdim#  define USERDB	1	/* look in user database */
101288943Sdim# endif
102212904Sdim
103212904Sdim# ifndef MIME8TO7
104288943Sdim#  define MIME8TO7	1	/* 8->7 bit MIME conversions */
105288943Sdim# endif
106288943Sdim
107212904Sdim# ifndef MIME7TO8
108212904Sdim#  define MIME7TO8	1	/* 7->8 bit MIME conversions */
109212904Sdim# endif
110288943Sdim
111199482Srdivacky/**********************************************************************
112199482Srdivacky**  "Hard" compilation options.
113218893Sdim**	#define these if they are available; comment them out otherwise.
114218893Sdim**  These cannot be overridden from the Makefile, and should really not
115226633Sdim**  be turned off unless absolutely necessary.
116288943Sdim**********************************************************************/
117288943Sdim
118288943Sdim# define LOG		1	/* enable logging -- don't turn off */
119288943Sdim
120200583Srdivacky/**********************************************************************
121288943Sdim**  End of site-specific configuration.
122200583Srdivacky**********************************************************************/
123218893Sdim/*
124288943Sdim**  General "standard C" defines.
125199482Srdivacky**
126199482Srdivacky**	These may be undone later, to cope with systems that claim to
127280031Sdim**	be Standard C but aren't.  Gcc is the biggest offender -- it
128280031Sdim**	doesn't realize that the library is part of the language.
129280031Sdim**
130234353Sdim**	Life would be much easier if we could get rid of this sort
131234353Sdim**	of bozo problems.
132288943Sdim*/
133288943Sdim
134288943Sdim#ifdef __STDC__
135276479Sdim# define HASSETVBUF	1	/* we have setvbuf(3) in libc */
136276479Sdim#endif
137288943Sdim
138288943Sdim/*
139288943Sdim**  Assume you have standard calls; can be #undefed below if necessary.
140288943Sdim*/
141288943Sdim
142288943Sdim# define HASLSTAT	1	/* has lstat(2) call */
143288943Sdim/**********************************************************************
144288943Sdim**  Operating system configuration.
145288943Sdim**
146288943Sdim**	Unless you are porting to a new OS, you shouldn't have to
147234353Sdim**	change these.
148234353Sdim**********************************************************************/
149243830Sdim
150243830Sdim/*
151243830Sdim**  HP-UX -- tested for 8.07, 9.00, and 9.01.
152243830Sdim**
153243830Sdim**	If V4FS is defined, compile for HP-UX 10.0.
154243830Sdim**	11.x support from Richard Allen <ra@hp.is>.
155276479Sdim*/
156276479Sdim
157276479Sdim#ifdef __hpux
158276479Sdim		/* common definitions for HP-UX 9.x and 10.x */
159276479Sdim# undef m_flags		/* conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h on HP 300 */
160276479Sdim# define SYSTEM5	1	/* include all the System V defines */
161243830Sdim# define HASINITGROUPS	1	/* has initgroups(3) call */
162243830Sdim# define HASFCHMOD	1	/* has fchmod(2) syscall */
163243830Sdim# define USESETEUID	1	/* has useable seteuid(2) call */
164243830Sdim# define BOGUS_O_EXCL	1	/* exclusive open follows symlinks */
165280031Sdim# define seteuid(e)	setresuid(-1, e, -1)
166280031Sdim# define IP_SRCROUTE	1	/* can check IP source routing */
167280031Sdim# define LA_TYPE	LA_HPUX
168243830Sdim# define SPT_TYPE	SPT_PSTAT
169276479Sdim# define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
170276479Sdim# define GIDSET_T	gid_t
171276479Sdim# ifndef HASGETUSERSHELL
172243830Sdim#  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
173243830Sdim# endif
174234353Sdim# ifndef HPUX11
175243830Sdim#  define syslog	hard_syslog
176234353Sdim# endif
177234353Sdim# define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
178234353Sdim
179239462Sdim# ifdef V4FS
180234353Sdim		/* HP-UX 10.x */
181276479Sdim#  define _PATH_UNIX		"/stand/vmunix"
182276479Sdim#  ifndef _PATH_VENDOR_CF
183276479Sdim#   define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
184276479Sdim#  endif
185234353Sdim#  ifndef _PATH_SENDMAILPID
186234353Sdim#   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
187276479Sdim#  endif
188234353Sdim#  ifndef IDENTPROTO
189234353Sdim#   define IDENTPROTO	1	/* TCP/IP implementation fixed in 10.0 */
190280031Sdim#  endif
191280031Sdim
192280031Sdim# else
193280031Sdim		/* HP-UX 9.x */
194280031Sdim#  define _PATH_UNIX		"/hp-ux"
195280031Sdim#  ifndef _PATH_VENDOR_CF
196280031Sdim#   define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
197280031Sdim#  endif
198276479Sdim#  ifndef IDENTPROTO
199234353Sdim#   define IDENTPROTO	0	/* TCP/IP implementation is broken */
200261991Sdim#  endif
201234353Sdim#  ifdef __STDC__
202288943Sdimextern void	hard_syslog(int, char *, ...);
203288943Sdim#  else
204234353Sdimextern void	hard_syslog();
205234353Sdim#  endif
206288943Sdim#  define FDSET_CAST	(int *)	/* cast for fd_set parameters to select */
207288943Sdim# endif
208288943Sdim
209276479Sdim#endif
210234353Sdim
211288943Sdim
212234353Sdim/*
213276479Sdim**  IBM AIX 4.x
214234353Sdim*/
215288943Sdim
216288943Sdim#ifdef _AIX4
217234353Sdim# define _AIX3		1	/* pull in AIX3 stuff */
218234353Sdim# define USESETEUID	1	/* seteuid(2) works */
219234353Sdim# define TZ_TYPE	TZ_NAME	/* use tzname[] vector */
220234353Sdim# define SOCKOPT_LEN_T	size_t	/* arg#5 to getsockopt */
221234353Sdim# if _AIX4 >= 40200
222234353Sdim#  define HASSETREUID	1	/* setreuid(2) works as of AIX 4.2 */
223234353Sdim#  define SOCKADDR_LEN_T	size_t	/* e.g., arg#3 to accept, getsockname */
224234353Sdim# endif
225280031Sdim# if defined(_ILS_MACROS)	/* IBM versions aren't side-effect clean */
226280031Sdim#  undef isascii
227280031Sdim#  define isascii(c)		!(c & ~0177)
228280031Sdim#  undef isdigit
229280031Sdim#  define isdigit(__a)		(_IS(__a,_ISDIGIT))
230280031Sdim#  undef isspace
231280031Sdim#  define isspace(__a)		(_IS(__a,_ISSPACE))
232234353Sdim# endif
233234353Sdim#endif
234280031Sdim
235280031Sdim
236280031Sdim/*
237288943Sdim**  IBM AIX 3.x -- actually tested for 3.2.3
238288943Sdim*/
239288943Sdim
240288943Sdim#ifdef _AIX3
241288943Sdim# include <paths.h>
242288943Sdim# include <sys/machine.h>	/* to get byte order */
243288943Sdim# include <sys/select.h>
244288943Sdim# define HASINITGROUPS	1	/* has initgroups(3) call */
245288943Sdim# define HASUNAME	1	/* use System V uname(2) system call */
246288943Sdim# define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
247276479Sdim# define HASFCHMOD	1	/* has fchmod(2) syscall */
248280031Sdim# define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
249288943Sdim# define GIDSET_T	gid_t
250288943Sdim# define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
251276479Sdim# define SPT_PADCHAR	'\0'	/* pad process title with nulls */
252234353Sdim# define LA_TYPE	LA_INT
253276479Sdim# define FSHIFT		16
254276479Sdim# define LA_AVENRUN	"avenrun"
255276479Sdim#endif
256234353Sdim
257280031Sdim
258234353Sdim/*
259234353Sdim**  IBM AIX 2.2.1 -- actually tested for osupdate level 2706+1773
260234353Sdim**
261234353Sdim**	From Mark Whetzel <markw@wg.waii.com>.
262276479Sdim*/
263276479Sdim
264276479Sdim#ifdef AIX			/* AIX/RT compiler pre-defines this */
265276479Sdim# include <paths.h>
266276479Sdim# include <sys/time.h>		/* AIX/RT resource.h does NOT include this */
267234353Sdim# define HASINITGROUPS	1	/* has initgroups(3) call */
268234353Sdim# define HASUNAME	1	/* use System V uname(2) system call */
269234353Sdim# define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
270234353Sdim# define HASFCHMOD	0	/* does not have fchmod(2) syscall */
271234353Sdim# define HASSETREUID	1	/* use setreuid(2) -lbsd system call */
272234353Sdim# define HASSETVBUF	1	/* use setvbuf(2) system call */
273234353Sdim# define HASSETRLIMIT	0	/* does not have setrlimit call */
274234353Sdim# define HASFLOCK	0	/* does not have flock call - use fcntl */
275234353Sdim# define HASULIMIT	1	/* use ulimit instead of setrlimit call */
276234353Sdim# define NEEDGETOPT	1	/* Do we need theirs or ours */
277234353Sdim# define SYS5SETPGRP	1	/* don't have setpgid on AIX/RT */
278234353Sdim# define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
279234353Sdim# define BSD4_3		1	/* NOT bsd 4.4 or posix signals */
280234353Sdim# define GIDSET_T	int
281261991Sdim# define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
282234353Sdim# define SPT_PADCHAR	'\0'		/* pad process title with nulls */
283234353Sdim# define LA_TYPE	LA_SUBR		/* use our ported loadavgd daemon */
284234353Sdim# define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
285234353Sdim# define ARBPTR_T	int *
286234353Sdim# define void		int
287234353Sdimtypedef int		pid_t;
288234353Sdim/* RTisms for BSD compatibility, specified in the Makefile
289234353Sdim  define BSD		1
290234353Sdim  define BSD_INCLUDES		1
291234353Sdim  define BSD_REMAP_SIGNAL_TO_SIGVEC
292234353Sdim    RTisms needed above */
293276479Sdim/* make this sendmail in a completely different place */
294276479Sdim# ifndef _PATH_VENDOR_CF
295276479Sdim#  define _PATH_VENDOR_CF	"/usr/local/newmail/sendmail.cf"
296276479Sdim# endif
297276479Sdim# ifndef _PATH_SENDMAILPID
298276479Sdim#  define _PATH_SENDMAILPID	"/usr/local/newmail/sendmail.pid"
299276479Sdim# endif
300276479Sdim#endif
301276479Sdim
302234353Sdim
303234353Sdim/*
304234353Sdim**  Silicon Graphics IRIX
305234353Sdim**
306234353Sdim**	Compiles on 4.0.1.
307234353Sdim**
308234353Sdim**	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
309234353Sdim**	Use IRIX5 instead of IRIX for IRIX 5.x.
310234353Sdim**
311234353Sdim**	This version tries to be adaptive using _MIPS_SIM:
312234353Sdim**		_MIPS_SIM == _ABIO32 (= 1)    Abi: -32  on IRIX 6.2
313261991Sdim**		_MIPS_SIM == _ABIN32 (= 2)    Abi: -n32 on IRIX 6.2
314280031Sdim**		_MIPS_SIM == _ABI64  (= 3)    Abi: -64 on IRIX 6.2
315276479Sdim**
316276479Sdim**		_MIPS_SIM is 1 also on IRIX 5.3
317276479Sdim**
318276479Sdim**	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
319276479Sdim**	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
320276479Sdim**	Adaptive changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
321276479Sdim*/
322276479Sdim
323276479Sdim#if defined(__sgi)
324276479Sdim# ifndef IRIX
325276479Sdim#  define IRIX
326234353Sdim# endif
327234353Sdim# if _MIPS_SIM > 0 && !defined(IRIX5)
328234353Sdim#  define IRIX5			/* IRIX5 or IRIX6 */
329234353Sdim# endif
330280031Sdim# if _MIPS_SIM > 1 && !defined(IRIX6) && !defined(IRIX64)
331280031Sdim#  define IRIX6			/* IRIX6 */
332280031Sdim# endif
333280031Sdim
334276479Sdim#endif
335280031Sdim
336276479Sdim#ifdef IRIX
337243830Sdim# define SYSTEM5	1	/* this is a System-V derived system */
338243830Sdim# define HASSETREUID	1	/* has setreuid(2) call */
339234353Sdim# define HASINITGROUPS	1	/* has initgroups(3) call */
340234353Sdim# define HASFCHMOD	1	/* has fchmod(2) syscall */
341276479Sdim# define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
342288943Sdim# define IP_SRCROUTE	1	/* can check IP source routing */
343288943Sdim# define setpgid	BSDsetpgrp
344288943Sdim# define GIDSET_T	gid_t
345276479Sdim# define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
346276479Sdim# define SFS_BAVAIL	f_bfree		/* alternate field name */
347276479Sdim# ifdef IRIX6
348276479Sdim#  define STAT64        1
349276479Sdim#  define QUAD_T	unsigned long long
350234353Sdim#  define LA_TYPE	LA_IRIX6	/* figure out at run time */
351276479Sdim#  define SAFENFSPATHCONF 0	/* pathconf(2) lies on NFS filesystems */
352276479Sdim#  define SYSLOG_BUFSIZE 512
353276479Sdim# else
354276479Sdim#  define LA_TYPE	LA_INT
355276479Sdim
356276479Sdim#  ifdef IRIX64
357280031Sdim#   define STAT64       1
358280031Sdim#   define QUAD_T	unsigned long long
359280031Sdim#   define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
360280031Sdim#  else
361280031Sdim#   define STAT64       0
362249423Sdim#   define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
363249423Sdim#  endif
364276479Sdim# endif
365280031Sdim# if defined(IRIX64) || defined(IRIX5) || defined(IRIX6)
366234353Sdim#  include <sys/cdefs.h>
367234353Sdim#  include <paths.h>
368234353Sdim#  define ARGV_T	char *const *
369234353Sdim#  define HASSETRLIMIT	1	/* has setrlimit(2) syscall */
370288943Sdim#  define HASGETDTABLESIZE 1    /* has getdtablesize(2) syscall */
371288943Sdim#  define HASSTRERROR	1	/* has strerror(3) */
372288943Sdim# else
373234353Sdim#  define ARGV_T	const char **
374234353Sdim#  define WAITUNION	1	/* use "union wait" as wait argument type */
375234353Sdim# endif
376234353Sdim#endif
377276479Sdim
378276479Sdim
379276479Sdim/*
380234353Sdim**  SunOS and Solaris
381288943Sdim**
382234353Sdim**	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
383234353Sdim**	Solaris 2.4 (a.k.a. SunOS 5.4).
384234353Sdim*/
385288943Sdim
386288943Sdim#if defined(sun) && !defined(BSD)
387288943Sdim
388288943Sdim# include <sys/time.h>
389288943Sdim# define HASINITGROUPS	1	/* has initgroups(3) call */
390234353Sdim# define HASUNAME	1	/* use System V uname(2) system call */
391288943Sdim# define HASFCHMOD	1	/* has fchmod(2) syscall */
392288943Sdim# define IP_SRCROUTE	1	/* can check IP source routing */
393234353Sdim# define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
394288943Sdim
395234353Sdim# ifdef SOLARIS_2_3
396234353Sdim#  define SOLARIS	20300	/* for back compat only -- use -DSOLARIS=20300 */
397280031Sdim# endif
398280031Sdim
399280031Sdim# if defined(NOT_SENDMAIL) && !defined(SOLARIS) && defined(sun) && (defined(__svr4__) || defined(__SVR4))
400199482Srdivacky#  define SOLARIS	1	/* unknown Solaris version */
401199482Srdivacky# endif
402280031Sdim
403280031Sdim# ifdef SOLARIS
404280031Sdim			/* Solaris 2.x (a.k.a. SunOS 5.x) */
405280031Sdim#  ifndef __svr4__
406249423Sdim#   define __svr4__		/* use all System V Releae 4 defines below */
407249423Sdim#  endif
408280031Sdim#  define GIDSET_T	gid_t
409280031Sdim#  define USE_SA_SIGACTION	1	/* use sa_sigaction field */
410280031Sdim#  ifndef _PATH_UNIX
411276479Sdim#   define _PATH_UNIX		"/dev/ksyms"
412276479Sdim#  endif
413276479Sdim#  ifndef _PATH_VENDOR_CF
414276479Sdim#   define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
415276479Sdim#  endif
416276479Sdim#  ifndef _PATH_SENDMAILPID
417288943Sdim#   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
418288943Sdim#  endif
419288943Sdim#  ifndef _PATH_HOSTS
420288943Sdim#   define _PATH_HOSTS		"/etc/inet/hosts"
421288943Sdim#  endif
422288943Sdim#  ifndef SYSLOG_BUFSIZE
423288943Sdim#   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
424276479Sdim#  endif
425276479Sdim#  ifndef TZ_TYPE
426276479Sdim#   define TZ_TYPE	TZ_TZNAME
427276479Sdim#  endif
428276479Sdim#  if SOLARIS >= 20300 || (SOLARIS < 10000 && SOLARIS >= 203)
429276479Sdim#   define USESETEUID	1		/* seteuid works as of 2.3 */
430276479Sdim#  endif
431276479Sdim#  if SOLARIS >= 20500 || (SOLARIS < 10000 && SOLARIS >= 205)
432249423Sdim#   define HASSETREUID	1		/* setreuid works as of 2.5 */
433249423Sdim#   if SOLARIS < 207 || (SOLARIS > 10000 && SOLARIS < 20700)
434249423Sdim#    ifndef LA_TYPE
435249423Sdim#     define LA_TYPE	LA_KSTAT	/* use kstat(3k) -- may work in < 2.5 */
436249423Sdim#    endif
437249423Sdim#   endif
438249423Sdim#  endif
439249423Sdim#  if SOLARIS >= 20600 || (SOLARIS < 10000 && SOLARIS >= 206)
440249423Sdim#   define HASSNPRINTF	1		/* has snprintf starting in 2.6 */
441249423Sdim#  endif
442249423Sdim#  if SOLARIS >= 20700 || (SOLARIS < 10000 && SOLARIS >= 207)
443249423Sdim#   ifndef LA_TYPE
444276479Sdim#    define LA_TYPE	LA_SUBR		/* getloadavg(3c) appears in 2.7 */
445249423Sdim#   endif
446249423Sdim#   define HASGETUSERSHELL 1	/* getusershell(3c) bug fixed in 2.7 */
447249423Sdim#  endif
448249423Sdim#  ifndef HASGETUSERSHELL
449249423Sdim#   define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps pre-2.7 */
450249423Sdim#  endif
451249423Sdim
452249423Sdim# else
453276479Sdim			/* SunOS 4.0.3 or 4.1.x */
454276479Sdim#  define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
455276479Sdim#  define HASSETREUID	1	/* has setreuid(2) call */
456276479Sdim#  ifndef HASFLOCK
457276479Sdim#   define HASFLOCK	1	/* has flock(2) call */
458276479Sdim#  endif
459276479Sdim#  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
460280031Sdim#  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
461280031Sdim#  include <memory.h>
462249423Sdim#  include <vfork.h>
463249423Sdim#  ifdef __GNUC__
464249423Sdim#   define strtoul	strtol	/* gcc library bogosity */
465249423Sdim#  endif
466249423Sdim
467249423Sdim#  ifdef SUNOS403
468249423Sdim			/* special tweaking for SunOS 4.0.3 */
469249423Sdim#   include <malloc.h>
470249423Sdim#   define BSD4_3	1	/* 4.3 BSD-based */
471249423Sdim#   define NEEDSTRSTR	1	/* need emulation of strstr(3) routine */
472249423Sdim#   define WAITUNION	1	/* use "union wait" as wait argument type */
473288943Sdim#   undef WIFEXITED
474288943Sdim#   undef WEXITSTATUS
475288943Sdim#   undef HASUNAME
476288943Sdim#   define setpgid	setpgrp
477288943Sdim#   define MODE_T	int
478288943Sdimtypedef int		pid_t;
479288943Sdimextern char		*getenv();
480249423Sdim
481249423Sdim#  else
482249423Sdim			/* 4.1.x specifics */
483288943Sdim#   define HASSETSID	1	/* has Posix setsid(2) call */
484288943Sdim#   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
485249423Sdim
486249423Sdim#  endif
487249423Sdim# endif
488249423Sdim
489249423Sdim# ifndef LA_TYPE
490249423Sdim#  define LA_TYPE	LA_INT
491249423Sdim# endif
492249423Sdim
493249423Sdim#endif /* sun && !BSD */
494249423Sdim
495249423Sdim/*
496249423Sdim**  DG/UX
497249423Sdim**
498249423Sdim**	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
499249423Sdim**	older support.
500249423Sdim**	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
501288943Sdim*/
502288943Sdim
503276479Sdim#ifdef DGUX_5_4_2
504276479Sdim# define DGUX		1
505276479Sdim#endif
506276479Sdim
507276479Sdim#ifdef	DGUX
508276479Sdim# define SYSTEM5	1
509276479Sdim# define LA_TYPE	LA_DGUX
510276479Sdim# define HASSETREUID	1	/* has setreuid(2) call */
511276479Sdim# define HASUNAME	1	/* use System V uname(2) system call */
512276479Sdim# define HASSETSID	1	/* has Posix setsid(2) call */
513276479Sdim# define HASINITGROUPS	1	/* has initgroups(3) call */
514276479Sdim# define IP_SRCROUTE	0	/* does not have <netinet/ip_var.h> */
515276479Sdim# define HASGETUSERSHELL 0	/* does not have getusershell(3) */
516276479Sdim# define HASSNPRINTF	1	/* has snprintf(3) */
517276479Sdim# ifndef IDENTPROTO
518276479Sdim#  define IDENTPROTO	0	/* TCP/IP implementation is broken */
519276479Sdim# endif
520276479Sdim# define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
521288943Sdim# define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
522276479Sdim
523249423Sdim/* these include files must be included early on DG/UX */
524249423Sdim# include <netinet/in.h>
525288943Sdim# include <arpa/inet.h>
526249423Sdim
527249423Sdim/* compiler doesn't understand const? */
528249423Sdim# define const
529249423Sdim
530249423Sdim# ifdef DGUX_5_4_2
531249423Sdim#  define inet_addr	dgux_inet_addr
532249423Sdimextern long	dgux_inet_addr();
533249423Sdim# endif
534249423Sdim#endif
535249423Sdim
536249423Sdim
537276479Sdim/*
538276479Sdim**  Digital Ultrix 4.2A or 4.3
539276479Sdim**
540249423Sdim**	Apparently, fcntl locking is broken on 4.2A, in that locks are
541249423Sdim**	not dropped when the process exits.  This causes major problems,
542249423Sdim**	so flock is the only alternative.
543249423Sdim*/
544249423Sdim
545249423Sdim#ifdef ultrix
546249423Sdim# define HASSETREUID	1	/* has setreuid(2) call */
547249423Sdim# define HASUNSETENV	1	/* has unsetenv(3) call */
548249423Sdim# define HASINITGROUPS	1	/* has initgroups(3) call */
549249423Sdim# define HASUNAME	1	/* use System V uname(2) system call */
550249423Sdim# define HASFCHMOD	1	/* has fchmod(2) syscall */
551249423Sdim# ifndef HASFLOCK
552249423Sdim#  define HASFLOCK	1	/* has flock(2) call */
553249423Sdim# endif
554249423Sdim# define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
555249423Sdim# ifndef BROKEN_RES_SEARCH
556249423Sdim#  define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
557249423Sdim# endif
558249423Sdim# ifdef vax
559249423Sdim#  define LA_TYPE	LA_FLOAT
560249423Sdim# else
561249423Sdim#  define LA_TYPE	LA_INT
562249423Sdim#  define LA_AVENRUN	"avenrun"
563249423Sdim# endif
564249423Sdim# define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
565249423Sdim# ifndef IDENTPROTO
566249423Sdim#  define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
567249423Sdim# endif
568276479Sdim# define SYSLOG_BUFSIZE	256
569249423Sdim#endif
570249423Sdim
571280031Sdim
572280031Sdim/*
573280031Sdim**  OSF/1 for KSR.
574249423Sdim**
575249423Sdim**      Contributed by Todd C. Miller <Todd.Miller@cs.colorado.edu>
576249423Sdim*/
577249423Sdim
578249423Sdim#ifdef __ksr__
579288943Sdim# define __osf__	1       /* get OSF/1 defines below */
580288943Sdim# ifndef TZ_TYPE
581288943Sdim#  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
582249423Sdim# endif
583249423Sdim#endif
584199482Srdivacky
585199482Srdivacky
586199482Srdivacky/*
587199482Srdivacky**  OSF/1 for Intel Paragon.
588199482Srdivacky**
589199482Srdivacky**	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
590199482Srdivacky**	of Intel Scalable Systems Divison.
591199482Srdivacky*/
592199482Srdivacky
593199990Srdivacky#ifdef __PARAGON__
594234353Sdim# define __osf__	1	/* get OSF/1 defines below */
595199482Srdivacky# ifndef TZ_TYPE
596199482Srdivacky#  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
597199482Srdivacky# endif
598199482Srdivacky# define GIDSET_T	gid_t
599199482Srdivacky# define MAXNAMLEN	NAME_MAX
600199482Srdivacky#endif
601199990Srdivacky
602199482Srdivacky
603199482Srdivacky/*
604199482Srdivacky**  OSF/1 (tested on Alpha) -- now known as Digital UNIX.
605199482Srdivacky**
606199482Srdivacky**	Tested for 3.2 and 4.0.
607199482Srdivacky*/
608199482Srdivacky
609199482Srdivacky#ifdef __osf__
610207619Srdivacky# define HASUNSETENV	1	/* has unsetenv(3) call */
611199482Srdivacky# define USESETEUID	1	/* has useable seteuid(2) call */
612199482Srdivacky# define HASINITGROUPS	1	/* has initgroups(3) call */
613199482Srdivacky# define HASFCHMOD	1	/* has fchmod(2) syscall */
614199990Srdivacky# define IP_SRCROUTE	1	/* can check IP source routing */
615199482Srdivacky# define HAS_ST_GEN	1	/* has st_gen field in stat struct */
616199482Srdivacky# ifndef HASFLOCK
617199482Srdivacky#  define HASFLOCK	1	/* has flock(2) call */
618199482Srdivacky# endif
619199482Srdivacky# define LA_TYPE	LA_ALPHAOSF
620288943Sdim# define SFS_TYPE	SFS_STATVFS	/* use <sys/statvfs.h> statfs() impl */
621288943Sdim# ifndef _PATH_VENDOR_CF
622288943Sdim#  define _PATH_VENDOR_CF	"/var/adm/sendmail/sendmail.cf"
623200583Srdivacky# endif
624199482Srdivacky# ifndef _PATH_SENDMAILPID
625199482Srdivacky#  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
626199482Srdivacky# endif
627199482Srdivacky# define bcopy(s, d, l)		(memmove((d), (s), (l)))
628199482Srdivacky# define bzero(d, l)		(memset((d), '\0', (l)))
629199482Srdivacky# define bcmp(s, d, l)		(memcmp((s), (d), (l)))
630210299Sed#endif
631276479Sdim
632210299Sed
633199482Srdivacky/*
634199482Srdivacky**  NeXTstep
635207619Srdivacky*/
636199482Srdivacky
637199482Srdivacky#ifdef NeXT
638199482Srdivacky# define HASINITGROUPS	1	/* has initgroups(3) call */
639199482Srdivacky# define NEEDPUTENV	2	/* need putenv(3) call; no setenv(3) call */
640199482Srdivacky# ifndef HASFLOCK
641199482Srdivacky#  define HASFLOCK	1	/* has flock(2) call */
642199482Srdivacky# endif
643226633Sdim# define NEEDGETOPT	1	/* need a replacement for getopt(3) */
644202379Srdivacky# define WAITUNION	1	/* use "union wait" as wait argument type */
645226633Sdim# define UID_T		int	/* compiler gripes on uid_t */
646226633Sdim# define GID_T		int	/* ditto for gid_t */
647226633Sdim# define MODE_T		int	/* and mode_t */
648226633Sdim# define setpgid	setpgrp
649226633Sdim# ifndef NOT_SENDMAIL
650226633Sdim#  define sleep		sleepX
651226633Sdim# endif
652226633Sdim# ifndef LA_TYPE
653226633Sdim#  define LA_TYPE	LA_MACH
654226633Sdim# endif
655226633Sdim# define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
656226633Sdim# ifndef _POSIX_SOURCE
657226633Sdimtypedef int		pid_t;
658226633Sdim#  undef WEXITSTATUS
659226633Sdim#  undef WIFEXITED
660226633Sdim# endif
661226633Sdim# ifndef _PATH_VENDOR_CF
662226633Sdim#  define _PATH_VENDOR_CF	"/etc/sendmail/sendmail.cf"
663226633Sdim# endif
664226633Sdim# ifndef _PATH_SENDMAILPID
665226633Sdim#  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
666226633Sdim# endif
667226633Sdim
668226633Sdim# ifdef TCPWRAPPERS
669226633Sdim#  ifndef HASUNSETENV
670226633Sdim#   define HASUNSETENV	1
671226633Sdim#  endif
672226633Sdim#  undef NEEDPUTENV
673226633Sdim# endif
674226633Sdim
675226633Sdim#endif
676226633Sdim
677226633Sdim
678226633Sdim/*
679226633Sdim**  4.4 BSD
680226633Sdim**
681226633Sdim**	See also BSD defines.
682226633Sdim*/
683226633Sdim
684226633Sdim#if defined(BSD4_4) && !defined(__bsdi__) && !defined(__GNU__)
685200583Srdivacky# include <paths.h>
686200583Srdivacky# define HASUNSETENV	1	/* has unsetenv(3) call */
687199482Srdivacky# define USESETEUID	1	/* has useable seteuid(2) call */
688199482Srdivacky# define HASFCHMOD	1	/* has fchmod(2) syscall */
689199482Srdivacky# define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
690212904Sdim# define HASSTRERROR	1	/* has strerror(3) */
691212904Sdim# define HAS_ST_GEN	1	/* has st_gen field in stat struct */
692212904Sdim# include <sys/cdefs.h>
693212904Sdim# define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
694212904Sdim# define BSD4_4_SOCKADDR	/* has sa_len */
695212904Sdim# define NEED_PRINTF_PERCENTQ	1	/* doesn't have %lld */
696212904Sdim# define NETLINK	1	/* supports AF_LINK */
697212904Sdim# ifndef LA_TYPE
698218893Sdim#  define LA_TYPE	LA_SUBR
699212904Sdim# endif
700212904Sdim# define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
701212904Sdim# define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
702212904Sdim#endif
703212904Sdim
704288943Sdim
705212904Sdim/*
706212904Sdim**  BSD/OS (was BSD/386) (all versions)
707212904Sdim**	From Tony Sanders, BSDI
708212904Sdim*/
709212904Sdim
710212904Sdim#ifdef __bsdi__
711212904Sdim# include <paths.h>
712212904Sdim# define HASUNSETENV	1	/* has the unsetenv(3) call */
713280031Sdim# define HASSETSID	1	/* has the setsid(2) POSIX syscall */
714218893Sdim# define USESETEUID	1	/* has useable seteuid(2) call */
715280031Sdim# define HASFCHMOD	1	/* has fchmod(2) syscall */
716212904Sdim# define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
717280031Sdim# define HASUNAME	1	/* has uname(2) syscall */
718280031Sdim# define HASSTRERROR	1	/* has strerror(3) */
719280031Sdim# define HAS_ST_GEN	1	/* has st_gen field in stat struct */
720212904Sdim# include <sys/cdefs.h>
721212904Sdim# define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
722# define BSD4_4_SOCKADDR	/* has sa_len */
723# define NETLINK	1	/* supports AF_LINK */
724# define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
725# ifndef LA_TYPE
726#  define LA_TYPE	LA_SUBR
727# endif
728# define GIDSET_T	gid_t
729# define QUAD_T		quad_t
730# if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
731			/* version 1.1 or later */
732#  undef SPT_TYPE
733#  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
734# else
735			/* version 1.0 or earlier */
736#  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
737# endif
738# if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199701	/* on 3.x */
739#  define HASSETUSERCONTEXT 1	/* has setusercontext */
740# endif
741#endif
742
743
744/*
745**  QNX 4.2x
746**	Contributed by Glen McCready <glen@qnx.com>.
747**
748**	Should work with all versions of QNX.
749*/
750
751#if defined(__QNX__)
752# include <unix.h>
753# include <sys/select.h>
754# undef NGROUPS_MAX
755# define HASSETSID      1       /* has the setsid(2) POSIX syscall */
756# define USESETEUID     1       /* has useable seteuid(2) call */
757# define HASFCHMOD      1       /* has fchmod(2) syscall */
758# define HASGETDTABLESIZE 1     /* has getdtablesize(2) call */
759# define HASSETREUID    1       /* has setreuid(2) call */
760# define HASSTRERROR	1	/* has strerror(3) */
761# define HASFLOCK	0
762# undef HASINITGROUPS           /* has initgroups(3) call */
763# define NEEDGETOPT     1       /* use sendmail's getopt */
764# define IP_SRCROUTE    1       /* can check IP source routing */
765# define TZ_TYPE        TZ_TMNAME       /* use tmname variable */
766# define GIDSET_T       gid_t
767# define LA_TYPE        LA_ZERO
768# define SFS_TYPE       SFS_NONE
769# define SPT_TYPE       SPT_REUSEARGV
770# define SPT_PADCHAR    '\0'    /* pad process title with nulls */
771# define HASGETUSERSHELL 0
772# define E_PSEUDOBASE	512
773# define bcopy(s, d, l)		(memmove((d), (s), (l)))
774# define bzero(d, l)		(memset((d), '\0', (l)))
775# define bcmp(s, d, l)		(memcmp((s), (d), (l)))
776# define _FILE_H_INCLUDED
777#endif
778
779
780/*
781**  FreeBSD / NetBSD / OpenBSD (all architectures, all versions)
782**
783**  4.3BSD clone, closer to 4.4BSD	for FreeBSD 1.x and NetBSD 0.9x
784**  4.4BSD-Lite based			for FreeBSD 2.x and NetBSD 1.x
785**
786**	See also BSD defines.
787*/
788
789#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
790# include <paths.h>
791# define HASUNSETENV	1	/* has unsetenv(3) call */
792# define HASSETSID	1	/* has the setsid(2) POSIX syscall */
793# define USESETEUID	1	/* has useable seteuid(2) call */
794# define HASFCHMOD	1	/* has fchmod(2) syscall */
795# define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
796# define HASUNAME	1	/* has uname(2) syscall */
797# define HASSTRERROR	1	/* has strerror(3) */
798# define HAS_ST_GEN	1	/* has st_gen field in stat struct */
799# define NEED_PRINTF_PERCENTQ	1	/* doesn't have %lld */
800# include <sys/cdefs.h>
801# define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
802# define BSD4_4_SOCKADDR	/* has sa_len */
803# define NETLINK	1	/* supports AF_LINK */
804# define SAFENFSPATHCONF 1	/* pathconf(2) pessimizes on NFS filesystems */
805# define GIDSET_T	gid_t
806# define QUAD_T		unsigned long long
807# ifndef LA_TYPE
808#  define LA_TYPE	LA_SUBR
809# endif
810# define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
811# if defined(__NetBSD__) && (NetBSD > 199307 || NetBSD0_9 > 1)
812#  undef SPT_TYPE
813#  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
814# endif
815# if defined(__FreeBSD__)
816#  undef SPT_TYPE
817#  if __FreeBSD__ == 2
818#   include <osreldate.h>		/* and this works */
819#   if __FreeBSD_version >= 199512	/* 2.2-current right now */
820#    include <libutil.h>
821#    define SPT_TYPE	SPT_BUILTIN
822#   endif
823#  endif
824#  ifndef SPT_TYPE
825#   define SPT_TYPE	SPT_REUSEARGV
826#   define SPT_PADCHAR	'\0'		/* pad process title with nulls */
827#  endif
828# endif
829# if defined(__OpenBSD__)
830#  undef SPT_TYPE
831#  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
832# endif
833#endif
834
835
836
837/*
838**  Mach386
839**
840**	For mt Xinu's Mach386 system.
841*/
842
843#if defined(MACH) && defined(i386) && !defined(__GNU__)
844# define MACH386	1
845# define HASUNSETENV	1	/* has unsetenv(3) call */
846# define HASINITGROUPS	1	/* has initgroups(3) call */
847# ifndef HASFLOCK
848#  define HASFLOCK	1	/* has flock(2) call */
849# endif
850# define NEEDGETOPT	1	/* need a replacement for getopt(3) */
851# define NEEDSTRTOL	1	/* need the strtol() function */
852# define setpgid	setpgrp
853# ifndef LA_TYPE
854#  define LA_TYPE	LA_FLOAT
855# endif
856# define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
857# undef HASSETVBUF		/* don't actually have setvbuf(3) */
858# undef WEXITSTATUS
859# undef WIFEXITED
860# ifndef _PATH_VENDOR_CF
861#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
862# endif
863# ifndef _PATH_SENDMAILPID
864#  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
865# endif
866#endif
867
868
869
870/*
871**  GNU OS (hurd)
872**	Largely BSD & posix compatible.
873**	Port contributed by Miles Bader <miles@gnu.ai.mit.edu>.
874*/
875
876#ifdef __GNU_HURD__
877# define SIOCGIFCONF_IS_BROKEN	1
878# define IP_SRCROUTE		0
879# define HASFCHMOD		1
880# define HASFLOCK		1
881# define HASUNAME		1
882# define HASUNSETENV		1
883# define HASSETSID		1
884# define HASINITGROUPS		1
885# define HASSETVBUF		1
886# define HASSETREUID		1
887# define USESETEUID		1
888# define HASLSTAT		1
889# define HASSETRLIMIT		1
890# define HASWAITPID		1
891# define HASGETDTABLESIZE	1
892# define HASSTRERROR		1
893/* # define NEEDGETOPT		1 */
894# define HASGETUSERSHELL	1
895# define ERRLIST_PREDEFINED	1
896# define BSD4_4_SOCKADDR	1
897# define GIDSET_T	gid_t
898# define LA_TYPE	LA_MACH
899
900/* GNU uses mach[34], which renames some rpcs from mach2.x.  */
901# define host_self	mach_host_self
902# define SFS_TYPE	SFS_STATFS
903# define SPT_TYPE	SPT_CHANGEARGV
904
905/* GNU has no MAXPATHLEN; ideally the code should be changed to not use it.  */
906# define MAXPATHLEN	2048
907
908/* Define device num frobbing macros.  */
909# define major(x)	((x)>>8)
910# define minor(x)	((x)&0xFF)
911#endif /* GNU */
912
913/*
914**  4.3 BSD -- this is for very old systems
915**
916**	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
917**
918**	You'll also have to install a new resolver library.
919**	I don't guarantee that support for this environment is complete.
920*/
921
922#if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
923# define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
924# define NEEDGETOPT	1	/* need a replacement for getopt(3) */
925# define ARBPTR_T	char *
926# define setpgid	setpgrp
927# ifndef LA_TYPE
928#  define LA_TYPE	LA_FLOAT
929# endif
930# ifndef _PATH_VENDOR_CF
931#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
932# endif
933# ifndef IDENTPROTO
934#  define IDENTPROTO	0	/* TCP/IP implementation is broken */
935# endif
936# undef WEXITSTATUS
937# undef WIFEXITED
938typedef short		pid_t;
939extern int		errno;
940#endif
941
942
943/*
944**  SCO Unix
945**
946**	This includes three parts:
947**
948**	The first is for SCO OpenServer 5.
949**	(Contributed by Keith Reynolds <keithr@sco.COM>).
950**
951**		SCO OpenServer 5 has a compiler version number macro,
952**		which we can use to figure out what version we're on.
953**		This may have to change in future releases.
954**
955**	The second is for SCO UNIX 3.2v4.2/Open Desktop 3.0.
956**	(Contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
957**
958**	The third is for SCO UNIX 3.2v4.0/Open Desktop 2.0 and earlier.
959*/
960
961/* SCO OpenServer 5 */
962#if _SCO_DS >= 1
963# include <paths.h>
964# define SIOCGIFNUM_IS_BROKEN 1	/* SIOCGIFNUM returns bogus value */
965# define HASSNPRINTF	1	/* has snprintf(3) call */
966# define HASFCHMOD	1	/* has fchmod(2) call */
967# define HASSETRLIMIT	1	/* has setrlimit(2) call */
968# define USESETEUID	1	/* has seteuid(2) call */
969# define HASINITGROUPS	1	/* has initgroups(3) call */
970# define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
971# define RLIMIT_NEEDS_SYS_TIME_H	1
972# ifndef LA_TYPE
973#  define LA_TYPE	LA_DEVSHORT
974# endif
975# define _PATH_AVENRUN	"/dev/table/avenrun"
976# ifndef _SCO_unix_4_2
977#  define _SCO_unix_4_2
978# else
979#  define SOCKADDR_LEN_T	size_t	/* e.g., arg#3 to accept, getsockname */
980#  define SOCKOPT_LEN_T		size_t	/* arg#5 to getsockopt */
981# endif
982#endif
983
984/* SCO UNIX 3.2v4.2/Open Desktop 3.0 */
985#ifdef _SCO_unix_4_2
986# define _SCO_unix_
987# define HASSETREUID	1	/* has setreuid(2) call */
988#endif
989
990/* SCO UNIX 3.2v4.0 Open Desktop 2.0 and earlier */
991#ifdef _SCO_unix_
992# include <sys/stream.h>	/* needed for IP_SRCROUTE */
993# define SYSTEM5	1	/* include all the System V defines */
994# define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
995# define NOFTRUNCATE	0	/* has (simulated) ftruncate call */
996# define USE_SIGLONGJMP	1	/* sigsetjmp needed for signal handling */
997# define MAXPATHLEN	PATHSIZE
998# define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
999# define SFS_BAVAIL	f_bfree		/* alternate field name */
1000# define SPT_TYPE	SPT_SCO		/* write kernel u. area */
1001# define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
1002# define UID_T		uid_t
1003# define GID_T		gid_t
1004# define GIDSET_T	gid_t
1005# define _PATH_UNIX		"/unix"
1006# ifndef _PATH_VENDOR_CF
1007#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1008# endif
1009# ifndef _PATH_SENDMAILPID
1010#  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
1011# endif
1012
1013/* stuff fixed in later releases */
1014# ifndef _SCO_unix_4_2
1015#  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1016# endif
1017
1018# ifndef _SCO_DS
1019#  define ftruncate	chsize	/* use chsize(2) to emulate ftruncate */
1020#  define NEEDFSYNC	1	/* needs the fsync(2) call stub */
1021#  define NETUNIX	0	/* no unix domain socket support */
1022#  define LA_TYPE	LA_SHORT
1023# endif
1024
1025#endif
1026
1027
1028/*
1029**  ISC (SunSoft) Unix.
1030**
1031**	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
1032*/
1033
1034#ifdef ISC_UNIX
1035# include <net/errno.h>
1036# include <sys/stream.h>	/* needed for IP_SRCROUTE */
1037# include <sys/bsdtypes.h>
1038# define SYSTEM5	1	/* include all the System V defines */
1039# define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1040# define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1041# define HASSETREUID	1	/* has setreuid(2) call */
1042# define NEEDFSYNC	1	/* needs the fsync(2) call stub */
1043# define NETUNIX	0	/* no unix domain socket support */
1044# define MAXPATHLEN	1024
1045# define LA_TYPE	LA_SHORT
1046# define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
1047# define SFS_BAVAIL	f_bfree		/* alternate field name */
1048# define _PATH_UNIX		"/unix"
1049# ifndef _PATH_VENDOR_CF
1050#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1051# endif
1052# ifndef _PATH_SENDMAILPID
1053#  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
1054# endif
1055
1056#endif
1057
1058
1059/*
1060**  Altos System V (5.3.1)
1061**	Contributed by Tim Rice <tim@trr.metro.net>.
1062*/
1063
1064#ifdef ALTOS_SYSTEM_V
1065# include <sys/stream.h>
1066# include <limits.h>
1067# define SYSTEM5	1	/* include all the System V defines */
1068# define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1069# define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1070# define WAITUNION	1	/* use "union wait" as wait argument type */
1071# define NEEDFSYNC	1	/* no fsync(2) in system library */
1072# define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
1073# define NOFTRUNCATE	1	/* do not have ftruncate(2) */
1074# define MAXPATHLEN	PATH_MAX
1075# define LA_TYPE	LA_SHORT
1076# define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
1077# define SFS_BAVAIL	f_bfree		/* alternate field name */
1078# define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
1079# define NETUNIX	0	/* no unix domain socket support */
1080# undef WIFEXITED
1081# undef WEXITSTATUS
1082# define strtoul	strtol	/* gcc library bogosity */
1083
1084typedef unsigned short	uid_t;
1085typedef unsigned short	gid_t;
1086typedef short		pid_t;
1087typedef unsigned long	mode_t;
1088
1089/* some stuff that should have been in the include files */
1090# include <grp.h>
1091extern char		*malloc();
1092extern struct passwd	*getpwent();
1093extern struct passwd	*getpwnam();
1094extern struct passwd	*getpwuid();
1095extern char		*getenv();
1096extern struct group	*getgrgid();
1097extern struct group	*getgrnam();
1098
1099#endif
1100
1101
1102/*
1103**  ConvexOS 11.0 and later
1104**
1105**	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
1106**	works on 9.1 as well.
1107**
1108**  ConvexOS 11.5 and later, should work on 11.0 as defined.
1109**  For pre-ConvexOOS 11.0, define NEEDGETOPT, undef IDENTPROTO
1110**
1111**	Eric Schnoebelen (eric@cirr.com) For CONVEX Computer Corp.
1112**		(now the CONVEX Technologies Center of Hewlett Packard)
1113*/
1114
1115#ifdef _CONVEX_SOURCE
1116# define HASGETDTABLESIZE	1	/* has getdtablesize(2) */
1117# define HASINITGROUPS	1	/* has initgroups(3) */
1118# define HASUNAME	1	/* use System V uname(2) system call */
1119# define HASSETSID	1	/* has POSIX setsid(2) call */
1120# define HASUNSETENV	1	/* has unsetenv(3) */
1121# define HASFLOCK	1	/* has flock(2) */
1122# define HASSETRLIMIT	1	/* has setrlimit(2) */
1123# define HASSETREUID	1	/* has setreuid(2) */
1124# define BROKEN_RES_SEARCH	1	/* res_search(unknown) returns h_error=0 */
1125# define NEEDPUTENV	1	/* needs putenv (written in terms of setenv) */
1126# define NEEDGETOPT	0	/* need replacement for getopt(3) */
1127# define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
1128# define LA_TYPE	LA_FLOAT
1129# define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1130# ifndef _PATH_VENDOR_CF
1131#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1132# endif
1133# ifndef S_IREAD
1134#  define S_IREAD	_S_IREAD
1135#  define S_IWRITE	_S_IWRITE
1136#  define S_IEXEC	_S_IEXEC
1137#  define S_IFMT	_S_IFMT
1138#  define S_IFCHR	_S_IFCHR
1139#  define S_IFBLK	_S_IFBLK
1140# endif
1141# ifndef TZ_TYPE
1142#  define TZ_TYPE	TZ_TIMEZONE
1143# endif
1144# ifndef IDENTPROTO
1145#  define IDENTPROTO	1
1146# endif
1147# ifndef SHARE_V1
1148#  define SHARE_V1	1	/* version 1 of the fair share scheduler */
1149# endif
1150# if !defined(__GNUC__ )
1151#  define UID_T	int		/* GNUC gets it right, ConvexC botches */
1152#  define GID_T	int		/* GNUC gets it right, ConvexC botches */
1153# endif
1154# if SECUREWARE
1155#  define FORK	fork		/* SecureWare wants the real fork! */
1156# else
1157#  define FORK	vfork		/* the rest of the OS versions don't care */
1158# endif
1159#endif
1160
1161
1162/*
1163**  RISC/os 4.52
1164**
1165**	Gives a ton of warning messages, but otherwise compiles.
1166*/
1167
1168#ifdef RISCOS
1169
1170# define HASUNSETENV	1	/* has unsetenv(3) call */
1171# ifndef HASFLOCK
1172#  define HASFLOCK	1	/* has flock(2) call */
1173# endif
1174# define WAITUNION	1	/* use "union wait" as wait argument type */
1175# define NEEDGETOPT	1	/* need a replacement for getopt(3) */
1176# define NEEDPUTENV	1	/* need putenv(3) call */
1177# define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
1178# define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1179# define LA_TYPE	LA_INT
1180# define LA_AVENRUN	"avenrun"
1181# define _PATH_UNIX	"/unix"
1182# undef WIFEXITED
1183
1184# define setpgid	setpgrp
1185
1186extern int		errno;
1187typedef int		pid_t;
1188# define SIGFUNC_DEFINED
1189# define SIGFUNC_RETURN	(0)
1190# define SIGFUNC_DECL	int
1191typedef int		(*sigfunc_t)();
1192extern char		*getenv();
1193extern void		*malloc();
1194
1195/* added for RISC/os 4.01...which is dumber than 4.50 */
1196# ifdef RISCOS_4_0
1197#  ifndef ARBPTR_T
1198#   define ARBPTR_T	char *
1199#  endif
1200#  undef HASFLOCK
1201#  define HASFLOCK	0
1202# endif /* RISCOS_4_0 */
1203
1204# include <sys/time.h>
1205
1206#endif
1207
1208
1209/*
1210**  Linux 0.99pl10 and above...
1211**
1212**  Thanks to, in reverse order of contact:
1213**
1214**	John Kennedy <warlock@csuchico.edu>
1215**	Andrew Pam <avatar@aus.xanadu.com>
1216**	Florian La Roche <rzsfl@rz.uni-sb.de>
1217**	Karl London <karl@borg.demon.co.uk>
1218**
1219**  Last compiled against:	[06/10/96 @ 09:21:40 PM (Monday)]
1220**	sendmail 8.8-a4		named bind-4.9.4-T4B	db-1.85
1221**	gcc 2.7.2		libc-5.3.12		linux 2.0.0
1222**
1223**  NOTE: Override HASFLOCK as you will but, as of 1.99.6, mixed-style
1224** 	file locking is no longer allowed.  In particular, make sure
1225**	your DBM library and sendmail are both using either flock(2)
1226**	*or* fcntl(2) file locking, but not both.
1227*/
1228
1229#ifdef __linux__
1230# define BSD		1	/* include BSD defines */
1231# define NEEDGETOPT	1	/* need a replacement for getopt(3) */
1232# define HASUNAME	1	/* use System V uname(2) system call */
1233# define HASUNSETENV	1	/* has unsetenv(3) call */
1234# ifndef HASSNPRINTF
1235#  define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
1236# endif
1237# define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
1238# define GIDSET_T	gid_t	/* from <linux/types.h> */
1239# define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
1240# define IP_SRCROUTE	0	/* linux <= 1.2.8 doesn't support IP_OPTIONS */
1241# define USE_SIGLONGJMP	1	/* sigsetjmp needed for signal handling */
1242# ifndef HASFLOCK
1243#  include <linux/version.h>
1244#  if LINUX_VERSION_CODE < 66399
1245#   define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
1246#  else
1247#   define HASFLOCK	1	/* flock(2) fixed after 1.3.95 */
1248#  endif
1249# endif
1250# ifndef LA_TYPE
1251#  define LA_TYPE	LA_PROCSTR
1252# endif
1253# define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
1254# define SPT_PADCHAR	'\0'		/* pad process title with nulls */
1255# ifndef _PATH_SENDMAILPID
1256#  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
1257# endif
1258# define TZ_TYPE	TZ_TNAME
1259# include <sys/sysmacros.h>
1260# undef atol			/* wounded in <stdlib.h> */
1261#endif
1262
1263
1264/*
1265**  DELL SVR4 Issue 2.2, and others
1266**	From Kimmo Suominen <kim@grendel.lut.fi>
1267**
1268**	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
1269**	defined, and the definitions conflict.
1270**
1271**	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
1272**	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
1273**	(SVR4.0/386 version 3.0).
1274*/
1275
1276#ifdef DELL_SVR4
1277				/* no changes necessary */
1278				/* see general __svr4__ defines below */
1279#endif
1280
1281
1282/*
1283**  Apple A/UX 3.0
1284*/
1285
1286#ifdef _AUX_SOURCE
1287# include <sys/sysmacros.h>
1288# define BSD			/* has BSD routines */
1289# define HASSETRLIMIT	0	/* ... but not setrlimit(2) */
1290# define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
1291# define BOGUS_O_EXCL	1	/* exclusive open follows symlinks */
1292# define HASUNAME	1	/* use System V uname(2) system call */
1293# define HASFCHMOD	1	/* has fchmod(2) syscall */
1294# define HASINITGROUPS	1	/* has initgroups(3) call */
1295# define HASSETVBUF	1	/* has setvbuf(3) in libc */
1296# define HASSTRERROR	1	/* has strerror(3) */
1297# define SIGFUNC_DEFINED	/* sigfunc_t already defined */
1298# define SIGFUNC_RETURN		/* POSIX-mode */
1299# define SIGFUNC_DECL	void	/* POSIX-mode */
1300# define ERRLIST_PREDEFINED	1
1301# ifndef IDENTPROTO
1302#  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1303# endif
1304# ifndef LA_TYPE
1305#  define LA_TYPE	LA_INT
1306#  define FSHIFT	16
1307# endif
1308# define LA_AVENRUN	"avenrun"
1309# define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1310# define TZ_TYPE	TZ_TZNAME
1311# ifndef _PATH_UNIX
1312#  define _PATH_UNIX		"/unix"		/* should be in <paths.h> */
1313# endif
1314# ifndef _PATH_VENDOR_CF
1315#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1316# endif
1317# undef WIFEXITED
1318# undef WEXITSTATUS
1319#endif
1320
1321
1322/*
1323**  Encore UMAX V
1324**
1325**	Not extensively tested.
1326*/
1327
1328#ifdef UMAXV
1329# define HASUNAME	1	/* use System V uname(2) system call */
1330# define HASSETVBUF	1	/* we have setvbuf(3) in libc */
1331# define HASINITGROUPS	1	/* has initgroups(3) call */
1332# define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1333# define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1334# define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
1335# define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
1336# define MAXPATHLEN	PATH_MAX
1337extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
1338extern struct group	*getgrent(), *getgrnam(), *getgrgid();
1339# undef WIFEXITED
1340# undef WEXITSTATUS
1341#endif
1342
1343
1344/*
1345**  Stardent Titan 3000 running TitanOS 4.2.
1346**
1347**	Must be compiled in "cc -43" mode.
1348**
1349**	From Kate Hedstrom <kate@ahab.rutgers.edu>.
1350**
1351**	Note the tweaking below after the BSD defines are set.
1352*/
1353
1354#ifdef titan
1355# define setpgid	setpgrp
1356typedef int		pid_t;
1357# undef WIFEXITED
1358# undef WEXITSTATUS
1359#endif
1360
1361
1362/*
1363**  Sequent DYNIX 3.2.0
1364**
1365**	From Jim Davis <jdavis@cs.arizona.edu>.
1366*/
1367
1368#ifdef sequent
1369
1370# define BSD		1
1371# define HASUNSETENV	1
1372# define BSD4_3		1	/* to get signal() in conf.c */
1373# define WAITUNION	1
1374# define LA_TYPE	LA_FLOAT
1375# ifdef	_POSIX_VERSION
1376#  undef _POSIX_VERSION		/* set in <unistd.h> */
1377# endif
1378# undef HASSETVBUF		/* don't actually have setvbuf(3) */
1379# define setpgid	setpgrp
1380
1381/* Have to redefine WIFEXITED to take an int, to work with waitfor() */
1382# undef	WIFEXITED
1383# define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
1384			 ((union wait*)&(s))->w_termsig == 0)
1385# define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
1386typedef int		pid_t;
1387# define isgraph(c)	(isprint(c) && (c != ' '))
1388
1389# ifndef IDENTPROTO
1390#  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1391# endif
1392
1393# ifndef _PATH_UNIX
1394#  define _PATH_UNIX		"/dynix"
1395# endif
1396# ifndef _PATH_VENDOR_CF
1397#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1398# endif
1399#endif
1400
1401
1402/*
1403**  Sequent DYNIX/ptx v2.0 (and higher)
1404**
1405**	For DYNIX/ptx v1.x, undefine HASSETREUID.
1406**
1407**	From Tim Wright <timw@sequent.com>.
1408**	Update from Jack Woolley <jwoolley@sctcorp.com>, 26 Dec 1995,
1409**		for DYNIX/ptx 4.0.2.
1410*/
1411
1412#ifdef _SEQUENT_
1413# include <sys/stream.h>
1414# define SYSTEM5	1	/* include all the System V defines */
1415# define HASSETSID	1	/* has POSIX setsid(2) call */
1416# define HASINITGROUPS	1	/* has initgroups(3) call */
1417# define HASSETREUID	1	/* has setreuid(2) call */
1418# define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1419# define GIDSET_T	gid_t
1420# define LA_TYPE	LA_INT
1421# define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
1422# define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
1423# ifndef IDENTPROTO
1424#  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1425# endif
1426# ifndef _PATH_VENDOR_CF
1427#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1428# endif
1429# ifndef _PATH_SENDMAILPID
1430#  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
1431# endif
1432#endif
1433
1434
1435/*
1436**  Cray Unicos
1437**
1438**	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
1439*/
1440
1441#ifdef UNICOS
1442# define SYSTEM5	1	/* include all the System V defines */
1443# define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1444# define MAXPATHLEN	PATHSIZE
1445# define LA_TYPE	LA_ZERO
1446# define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
1447# define SFS_BAVAIL	f_bfree		/* alternate field name */
1448#endif
1449
1450
1451/*
1452**  Apollo DomainOS
1453**
1454**  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
1455**
1456**  15 Jan 1994; updated 2 Aug 1995
1457**
1458*/
1459
1460#ifdef apollo
1461# define HASSETREUID	1	/* has setreuid(2) call */
1462# define HASINITGROUPS	1	/* has initgroups(2) call */
1463# define IP_SRCROUTE	0	/* does not have <netinet/ip_var.h> */
1464# define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
1465# define LA_TYPE	LA_SUBR		/* use getloadavg.c */
1466# define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
1467# define SFS_BAVAIL	f_bfree		/* alternate field name */
1468# define TZ_TYPE	TZ_TZNAME
1469# ifndef _PATH_VENDOR_CF
1470#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1471# endif
1472# ifndef _PATH_SENDMAILPID
1473#  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
1474# endif
1475# undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
1476# undef  S_IFIFO
1477# define S_IFIFO	0010000
1478# ifndef IDENTPROTO
1479#  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1480# endif
1481# define RLIMIT_NEEDS_SYS_TIME_H	1
1482# if defined(NGROUPS_MAX) && !NGROUPS_MAX
1483#  undef NGROUPS_MAX
1484# endif
1485#endif
1486
1487
1488/*
1489**  UnixWare 2.x
1490*/
1491
1492#ifdef UNIXWARE2
1493# define UNIXWARE	1
1494# define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
1495# undef offsetof		/* avoid stddefs.h, sys/sysmacros.h conflict */
1496#endif
1497
1498
1499/*
1500**  UnixWare 1.1.2.
1501**
1502**	Updated by Petr Lampa <lampa@fee.vutbr.cz>.
1503**	From Evan Champion <evanc@spatial.synapse.org>.
1504*/
1505
1506#ifdef UNIXWARE
1507# include <sys/mkdev.h>
1508# define SYSTEM5		1
1509# define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
1510# define HASSETREUID		1
1511# define HASSETSID		1
1512# define HASINITGROUPS		1
1513# define GIDSET_T		gid_t
1514# define SLEEP_T		unsigned
1515# define SFS_TYPE		SFS_STATVFS
1516# define LA_TYPE		LA_ZERO
1517# undef WIFEXITED
1518# undef WEXITSTATUS
1519# define _PATH_UNIX		"/unix"
1520# ifndef _PATH_VENDOR_CF
1521#  define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
1522# endif
1523# ifndef _PATH_SENDMAILPID
1524#  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
1525# endif
1526# define SYSLOG_BUFSIZE	128
1527#endif
1528
1529
1530/*
1531**  Intergraph CLIX 3.1
1532**
1533**	From Paul Southworth <pauls@locust.cic.net>
1534*/
1535
1536#ifdef CLIX
1537# define SYSTEM5	1	/* looks like System V */
1538# ifndef HASGETUSERSHELL
1539#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1540# endif
1541# define DEV_BSIZE	512	/* device block size not defined */
1542# define GIDSET_T	gid_t
1543# undef LOG			/* syslog not available */
1544# define NEEDFSYNC	1	/* no fsync in system library */
1545# define GETSHORT	_getshort
1546#endif
1547
1548
1549/*
1550**  NCR MP-RAS 2.x (SysVr4) with Wollongong TCP/IP
1551**
1552**	From Kevin Darcy <kevin@tech.mis.cfc.com>.
1553*/
1554
1555#ifdef NCR_MP_RAS2
1556# include <sys/sockio.h>
1557# define __svr4__
1558# define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
1559# define SYSLOG_BUFSIZE	1024
1560# define SPT_TYPE  SPT_NONE
1561#endif
1562
1563
1564/*
1565**  NCR MP-RAS 3.x (SysVr4) with STREAMware TCP/IP
1566**
1567**	From Tom Moore <Tom.Moore@DaytonOH.NCR.COM>
1568*/
1569
1570#ifdef NCR_MP_RAS3
1571# define __svr4__
1572# define SIOCGIFNUM_IS_BROKEN	1	/* SIOCGIFNUM has non-std interface */
1573# define SYSLOG_BUFSIZE	1024
1574# define SPT_TYPE 	SPT_NONE
1575#endif
1576
1577
1578/*
1579**  Tandem NonStop-UX SVR4
1580**
1581**	From Rick McCarty <mccarty@mpd.tandem.com>.
1582*/
1583
1584#ifdef NonStop_UX_BXX
1585# define __svr4__
1586#endif
1587
1588
1589/*
1590**  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
1591**
1592**	Tested for 1.04 and 1.03
1593**	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
1594*/
1595
1596#ifdef __H3050R
1597# define SYSTEM5	1	/* include all the System V defines */
1598# define HASINITGROUPS	1	/* has initgroups(3) call */
1599# define setreuid(r, e)	setresuid(r, e, -1)
1600# define LA_TYPE	LA_FLOAT
1601# define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1602# define HASSETVBUF	/* HI-UX has no setlinebuf */
1603# ifndef GIDSET_T
1604#  define GIDSET_T	gid_t
1605# endif
1606# ifndef _PATH_UNIX
1607#  define _PATH_UNIX		"/HI-UX"
1608# endif
1609# ifndef _PATH_VENDOR_CF
1610#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1611# endif
1612# ifndef IDENTPROTO
1613#  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1614# endif
1615# ifndef HASGETUSERSHELL
1616#  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
1617# endif
1618
1619/*
1620**  avoid m_flags conflict between Berkeley DB 1.85 db.h & sys/sysmacros.h
1621**  on HIUX 3050
1622*/
1623# undef m_flags
1624
1625# ifdef __STDC__
1626extern int	syslog(int, char *, ...);
1627#else
1628extern int	syslog();
1629# endif
1630
1631#endif
1632
1633
1634/*
1635**  Amdahl UTS System V 2.1.5 (SVr3-based)
1636**
1637**    From: Janet Jackson <janet@dialix.oz.au>.
1638*/
1639
1640#ifdef _UTS
1641# include <sys/sysmacros.h>
1642# undef HASLSTAT		/* has symlinks, but they cause problems */
1643# define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
1644# define SYS5SIGNALS	1	/* System V signal semantics */
1645# define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
1646# define HASUNAME	1	/* use System V uname(2) system call */
1647# define HASINITGROUPS	1	/* has initgroups(3) function */
1648# define HASSETVBUF	1	/* has setvbuf(3) function */
1649# ifndef HASGETUSERSHELL
1650#  define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
1651# endif
1652# define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
1653# define LA_TYPE	LA_ZERO		/* doesn't have load average */
1654# define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
1655# define SFS_BAVAIL	f_bfree		/* alternate field name */
1656# define _PATH_UNIX		"/unix"
1657# ifndef _PATH_VENDOR_CF
1658#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1659# endif
1660#endif
1661
1662/*
1663**  Cray Computer Corporation's CSOS
1664**
1665**	From Scott Bolte <scott@craycos.com>.
1666*/
1667
1668#ifdef _CRAYCOM
1669# define SYSTEM5	1	/* include all the System V defines */
1670# define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1671# define NEEDFSYNC	1	/* no fsync in system library */
1672# define MAXPATHLEN	PATHSIZE
1673# define LA_TYPE	LA_ZERO
1674# define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
1675# define SFS_BAVAIL	f_bfree		/* alternate field name */
1676# define _POSIX_CHOWN_RESTRICTED	-1
1677extern struct group	*getgrent(), *getgrnam(), *getgrgid();
1678#endif
1679
1680
1681/*
1682**  Sony NEWS-OS 4.2.1R and 6.0.3
1683**
1684**	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
1685*/
1686
1687#ifdef sony_news
1688# ifndef __svr4
1689			/* NEWS-OS 4.2.1R */
1690#  ifndef BSD
1691#   define BSD			/* has BSD routines */
1692#  endif
1693#  define HASUNSETENV	1	/* has unsetenv(2) call */
1694#  undef HASSETVBUF		/* don't actually have setvbuf(3) */
1695#  define WAITUNION	1	/* use "union wait" as wait argument type */
1696#  define LA_TYPE	LA_INT
1697#  define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1698#  ifndef HASFLOCK
1699#   define HASFLOCK	1	/* has flock(2) call */
1700#  endif
1701#  define setpgid	setpgrp
1702#  undef WIFEXITED
1703#  undef WEXITSTATUS
1704#  define MODE_T	int	/* system include files have no mode_t */
1705typedef int		pid_t;
1706typedef int		(*sigfunc_t)();
1707#  define SIGFUNC_DEFINED
1708#  define SIGFUNC_RETURN	(0)
1709#  define SIGFUNC_DECL		int
1710
1711# else
1712			/* NEWS-OS 6.0.3 with /bin/cc */
1713#  ifndef __svr4__
1714#   define __svr4__		/* use all System V Releae 4 defines below */
1715#  endif
1716#  define HASSETSID	1	/* has Posix setsid(2) call */
1717#  define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
1718#  define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
1719#  ifndef SPT_TYPE
1720#   define SPT_TYPE	SPT_SYSMIPS	/* use sysmips() (OS 6.0.2 or later) */
1721#  endif
1722#  define GIDSET_T	gid_t
1723#  undef WIFEXITED
1724#  undef WEXITSTATUS
1725#  ifndef SYSLOG_BUFSIZE
1726#   define SYSLOG_BUFSIZE	1024
1727#  endif
1728#  define _PATH_UNIX		"/stand/unix"
1729#  ifndef _PATH_VENDOR_CF
1730#   define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
1731#  endif
1732#  ifndef _PATH_SENDMAILPID
1733#   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
1734#  endif
1735
1736# endif
1737#endif
1738
1739
1740/*
1741**  Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
1742**
1743**	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
1744*/
1745
1746#ifdef luna
1747# ifndef IDENTPROTO
1748#  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1749# endif
1750# define HASUNSETENV	1	/* has unsetenv(2) call */
1751# define NEEDPUTENV	1	/* need putenv(3) call */
1752# define NEEDGETOPT	1	/* need a replacement for getopt(3) */
1753# define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
1754# define WAITUNION	1	/* use "union wait" as wait argument type */
1755# ifdef uniosb
1756#  include <sys/time.h>
1757#  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
1758#  define LA_TYPE	LA_INT
1759#  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
1760# endif
1761# ifdef luna2
1762#  define LA_TYPE	LA_SUBR
1763#  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone */
1764# endif
1765# ifdef luna88k
1766#  define HASSNPRINTF	1	/* has snprintf(3) and vsnprintf(3) */
1767#  define LA_TYPE	LA_INT
1768# endif
1769# define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1770# define setpgid	setpgrp
1771# undef WIFEXITED
1772# undef WEXITSTATUS
1773typedef int		pid_t;
1774typedef int		(*sigfunc_t)();
1775# define SIGFUNC_DEFINED
1776# define SIGFUNC_RETURN	(0)
1777# define SIGFUNC_DECL	int
1778extern char	*getenv();
1779extern int	errno;
1780# ifndef _PATH_VENDOR_CF
1781#  define _PATH_VENDOR_CF	"/usr/lib/sendmail.cf"
1782# endif
1783#endif
1784
1785
1786/*
1787**  NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
1788**
1789**	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
1790*/
1791
1792#if defined(nec_ews_svr4) || defined(_nec_ews_svr4)
1793# ifndef __svr4__
1794#  define __svr4__		/* use all System V Releae 4 defines below */
1795# endif
1796# define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1797# define HASSETSID	1	/* has Posix setsid(2) call */
1798# define LA_TYPE	LA_READKSYM	/* use MIOC_READSYM ioctl */
1799# define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
1800# define GIDSET_T	gid_t
1801# undef WIFEXITED
1802# undef WEXITSTATUS
1803# define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
1804# ifndef SYSLOG_BUFSIZE
1805#  define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
1806# endif
1807#endif
1808
1809
1810/*
1811**  Fujitsu/ICL UXP/DS (For the DS/90 Series)
1812**
1813**	From Diego R. Lopez <drlopez@cica.es>.
1814**	Additional changes from Fumio Moriya and Toshiaki Nomura of the
1815**		Fujitsu Fresoftware gruop <dsfrsoft@oai6.yk.fujitsu.co.jp>.
1816*/
1817
1818#ifdef __uxp__
1819# include <arpa/nameser.h>
1820# include <sys/sysmacros.h>
1821# include <sys/mkdev.h>
1822# define __svr4__
1823# define HASGETUSERSHELL	0
1824# define HASFLOCK		0
1825# if UXPDS == 10
1826#  define HASSNPRINTF		0	/* no snprintf(3) or vsnprintf(3) */
1827# else
1828#  define HASSNPRINTF		1	/* has snprintf(3) and vsnprintf(3) */
1829# endif
1830# define _PATH_UNIX		"/stand/unix"
1831# ifndef _PATH_VENDOR_CF
1832#  define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
1833# endif
1834# ifndef _PATH_SENDMAILPID
1835#  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
1836# endif
1837#endif
1838
1839/*
1840**  Pyramid DC/OSx
1841**
1842**	From Earle Ake <akee@wpdiss1.wpafb.af.mil>.
1843*/
1844
1845#ifdef DCOSx
1846# define GIDSET_T	gid_t
1847# ifndef IDENTPROTO
1848#  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1849# endif
1850#endif
1851
1852/*
1853**  Concurrent Computer Corporation Maxion
1854**
1855**	From Donald R. Laster Jr. <laster@access.digex.net>.
1856*/
1857
1858#ifdef __MAXION__
1859
1860# include <sys/stream.h>
1861# define __svr4__		1	/* SVR4.2MP */
1862# define HASSETREUID		1	/* have setreuid(2) */
1863# define HASLSTAT		1	/* have lstat(2) */
1864# define HASSETRLIMIT		1	/* have setrlimit(2) */
1865# define HASGETDTABLESIZE	1	/* have getdtablesize(2) */
1866# define HASSNPRINTF		1	/* have snprintf(3) */
1867# define HASGETUSERSHELL	1	/* have getusershell(3) */
1868# define NOFTRUNCATE		1	/* do not have ftruncate(2) */
1869# define SLEEP_T		unsigned
1870# define SFS_TYPE		SFS_STATVFS
1871# define SFS_BAVAIL		f_bavail
1872# ifndef SYSLOG_BUFSIZE
1873#  define SYSLOG_BUFSIZE	256	/* Use 256 bytes */
1874# endif
1875
1876# undef WUNTRACED
1877# undef WIFEXITED
1878# undef WIFSIGNALED
1879# undef WIFSTOPPED
1880# undef WEXITSTATUS
1881# undef WTERMSIG
1882# undef WSTOPSIG
1883
1884#endif
1885
1886/*
1887**  Harris Nighthawk PowerUX (nh6000 box)
1888**
1889**  Contributed by Bob Miorelli, Pratt & Whitney <miorelli@pweh.com>
1890*/
1891
1892#ifdef _PowerUX
1893# ifndef __svr4__
1894#  define __svr4__
1895# endif
1896# ifndef _PATH_VENDOR_CF
1897#  define _PATH_VENDOR_CF	"/etc/mail/sendmail.cf"
1898# endif
1899# ifndef _PATH_SENDMAILPID
1900#  define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
1901# endif
1902# define SYSLOG_BUFSIZE		1024
1903# define HASSNPRINTF		1	/* has snprintf(3) and vsnprintf(3) */
1904# define LA_TYPE		LA_ZERO
1905typedef struct msgb		mblk_t;
1906# undef offsetof	/* avoid stddefs.h and sys/sysmacros.h conflict */
1907#endif
1908
1909/*
1910**  Siemens Nixdorf Informationssysteme AG SINIX
1911**
1912**	Contributed by Gerald Rinske <Gerald.Rinske@mch.sni.de>
1913**	of Siemens Business Services VAS.
1914*/
1915#ifdef sinix
1916# define SYSLOG_BUFSIZE		1024
1917#endif
1918
1919/*
1920**  CRAY T3E
1921**
1922**	Contributed by Manu Mahonen <mailadm@csc.fi>
1923**	of Center for Scientific Computing.
1924*/
1925#ifdef _CRAY
1926# define GET_IPOPT_DST(dst)	*(struct in_addr *)&(dst)
1927#endif
1928
1929/**********************************************************************
1930**  End of Per-Operating System defines
1931**********************************************************************/
1932/**********************************************************************
1933**  More general defines
1934**********************************************************************/
1935
1936/* general BSD defines */
1937#ifdef BSD
1938# define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
1939# define HASSETREUID	1	/* has setreuid(2) call */
1940# define HASINITGROUPS	1	/* has initgroups(3) call */
1941# ifndef IP_SRCROUTE
1942#  define IP_SRCROUTE	1	/* can check IP source routing */
1943# endif
1944# ifndef HASSETRLIMIT
1945#  define HASSETRLIMIT	1	/* has setrlimit(2) call */
1946# endif
1947# ifndef HASFLOCK
1948#  define HASFLOCK	1	/* has flock(2) call */
1949# endif
1950# ifndef TZ_TYPE
1951#  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
1952# endif
1953#endif
1954
1955/* general System V Release 4 defines */
1956#ifdef __svr4__
1957# define SYSTEM5	1
1958# define USESETEUID	1	/* has useable seteuid(2) call */
1959# define HASINITGROUPS	1	/* has initgroups(3) call */
1960# define BSD_COMP	1	/* get BSD ioctl calls */
1961# ifndef HASSETRLIMIT
1962#  define HASSETRLIMIT	1	/* has setrlimit(2) call */
1963# endif
1964# ifndef HASGETUSERSHELL
1965#  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1966# endif
1967# ifndef HASFCHMOD
1968#  define HASFCHMOD	1	/* most (all?) SVr4s seem to have fchmod(2) */
1969# endif
1970
1971# ifndef _PATH_UNIX
1972#  define _PATH_UNIX		"/unix"
1973# endif
1974# ifndef _PATH_VENDOR_CF
1975#  define _PATH_VENDOR_CF	"/usr/ucblib/sendmail.cf"
1976# endif
1977# ifndef _PATH_SENDMAILPID
1978#  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
1979# endif
1980# ifndef SYSLOG_BUFSIZE
1981#  define SYSLOG_BUFSIZE	128
1982# endif
1983# ifndef SFS_TYPE
1984#  define SFS_TYPE		SFS_STATVFS
1985# endif
1986
1987# define USE_SIGLONGJMP	1	/* sigsetjmp needed for signal handling */
1988#endif
1989
1990/* general System V defines */
1991#ifdef SYSTEM5
1992# include <sys/sysmacros.h>
1993# define HASUNAME	1	/* use System V uname(2) system call */
1994# define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
1995# define HASSETVBUF	1	/* we have setvbuf(3) in libc */
1996# ifndef HASULIMIT
1997#  define HASULIMIT	1	/* has the ulimit(2) syscall */
1998# endif
1999# ifndef LA_TYPE
2000#  ifdef MIOC_READKSYM
2001#   define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
2002#  else
2003#   define LA_TYPE	LA_INT		/* assume integer load average */
2004#  endif
2005# endif
2006# ifndef SFS_TYPE
2007#  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
2008# endif
2009# ifndef TZ_TYPE
2010#  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
2011# endif
2012# define bcopy(s, d, l)		(memmove((d), (s), (l)))
2013# define bzero(d, l)		(memset((d), '\0', (l)))
2014# define bcmp(s, d, l)		(memcmp((s), (d), (l)))
2015#endif
2016
2017/* general POSIX defines */
2018#ifdef _POSIX_VERSION
2019# define HASSETSID	1	/* has Posix setsid(2) call */
2020# define HASWAITPID	1	/* has Posix waitpid(2) call */
2021# if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
2022#  define USESETEUID	1	/* has useable seteuid(2) call */
2023# endif
2024# ifndef bcopy
2025#  define bcopy(s, d, l)	(memmove((d), (s), (l)))
2026#  define bzero(d, l)		(memset((d), '\0', (l)))
2027#  define bcmp(s, d, l)		(memcmp((s), (d), (l)))
2028# endif
2029#endif
2030/*
2031**  Tweaking for systems that (for example) claim to be BSD or POSIX
2032**  but don't have all the standard BSD or POSIX routines (boo hiss).
2033*/
2034
2035#ifdef titan
2036# undef HASINITGROUPS		/* doesn't have initgroups(3) call */
2037#endif
2038
2039#ifdef _CRAYCOM
2040# undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
2041#endif
2042
2043#ifdef ISC_UNIX
2044# undef bcopy			/* despite SystemV claim, uses BSD bcopy */
2045#endif
2046
2047#ifdef ALTOS_SYSTEM_V
2048# undef bcopy			/* despite SystemV claim, uses BSD bcopy */
2049# undef bzero			/* despite SystemV claim, uses BSD bzero */
2050# undef bcmp			/* despite SystemV claim, uses BSD bcmp */
2051#endif
2052
2053#if defined(sun) && !defined(BSD) && !defined(SOLARIS) && !defined(__svr4__) && !defined(__SVR4)
2054# undef bcopy			/* SunOS 4 doesn't have memmove() */
2055#endif
2056
2057
2058/*
2059**  Due to a "feature" in some operating systems such as Ultrix 4.3 and
2060**  HPUX 8.0, if you receive a "No route to host" message (ICMP message
2061**  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
2062**  are closed.  Some firewalls return this error if you try to connect
2063**  to the IDENT port (113), so you can't receive email from these hosts
2064**  on these systems.  The firewall really should use a more specific
2065**  message such as ICMP_UNREACH_PROTOCOL or _PORT or _FILTER_PROHIB.  If
2066**  not explicitly set to zero above, default it on.
2067*/
2068
2069#ifndef IDENTPROTO
2070# define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
2071#endif
2072
2073#ifndef IP_SRCROUTE
2074# define IP_SRCROUTE	1	/* Detect IP source routing */
2075#endif
2076
2077#ifndef HASGETUSERSHELL
2078# define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
2079#endif
2080
2081#ifndef NETUNIX
2082# define NETUNIX	1	/* include unix domain support */
2083#endif
2084
2085#ifndef HASFLOCK
2086# define HASFLOCK	0	/* assume no flock(2) support */
2087#endif
2088
2089#ifndef HASSETREUID
2090# define HASSETREUID	0	/* assume no setreuid(2) call */
2091#endif
2092
2093#ifndef HASFCHMOD
2094# define HASFCHMOD	0	/* assume no fchmod(2) syscall */
2095#endif
2096
2097#ifndef USESETEUID
2098# define USESETEUID	0	/* assume no seteuid(2) call or no saved ids */
2099#endif
2100
2101#ifndef HASSETRLIMIT
2102# define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
2103#endif
2104
2105#ifndef HASULIMIT
2106# define HASULIMIT	0	/* assume no ulimit(2) support */
2107#endif
2108
2109#ifndef SECUREWARE
2110# define SECUREWARE	0	/* assume no SecureWare C2 auditing hooks */
2111#endif
2112
2113#ifndef USE_SIGLONGJMP
2114# define USE_SIGLONGJMP	0	/* assume setjmp handles signals properly */
2115#endif
2116
2117#ifndef FDSET_CAST
2118# define FDSET_CAST		/* (empty) cast for fd_set arg to select */
2119#endif
2120
2121/*
2122**  If no type for argument two of getgroups call is defined, assume
2123**  it's an integer -- unfortunately, there seem to be several choices
2124**  here.
2125*/
2126
2127#ifndef GIDSET_T
2128# define GIDSET_T	int
2129#endif
2130
2131#ifndef UID_T
2132# define UID_T		uid_t
2133#endif
2134
2135#ifndef GID_T
2136# define GID_T		gid_t
2137#endif
2138
2139#ifndef SIZE_T
2140# define SIZE_T		size_t
2141#endif
2142
2143#ifndef MODE_T
2144# define MODE_T		mode_t
2145#endif
2146
2147#ifndef ARGV_T
2148# define ARGV_T		char **
2149#endif
2150
2151#ifndef SOCKADDR_LEN_T
2152# define SOCKADDR_LEN_T	int
2153#endif
2154
2155#ifndef SOCKOPT_LEN_T
2156# define SOCKOPT_LEN_T	int
2157#endif
2158
2159#ifndef QUAD_T
2160# define QUAD_T	unsigned long
2161#endif
2162/**********************************************************************
2163**  Remaining definitions should never have to be changed.  They are
2164**  primarily to provide back compatibility for older systems -- for
2165**  example, it includes some POSIX compatibility definitions
2166**********************************************************************/
2167
2168/* System 5 compatibility */
2169#ifndef S_ISREG
2170# define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
2171#endif
2172#ifndef S_ISDIR
2173# define S_ISDIR(foo)	((foo & S_IFMT) == S_IFDIR)
2174#endif
2175#if !defined(S_ISLNK) && defined(S_IFLNK)
2176# define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
2177#endif
2178#ifndef S_IRUSR
2179# define S_IRUSR		0400
2180#endif
2181#ifndef S_IWUSR
2182# define S_IWUSR		0200
2183#endif
2184#ifndef S_IRGRP
2185# define S_IRGRP		0040
2186#endif
2187#ifndef S_IWGRP
2188# define S_IWGRP		0020
2189#endif
2190#ifndef S_IROTH
2191# define S_IROTH		0004
2192#endif
2193#ifndef S_IWOTH
2194# define S_IWOTH		0002
2195#endif
2196
2197/*
2198**  Older systems don't have this error code -- it should be in
2199**  /usr/include/sysexits.h.
2200*/
2201
2202# ifndef EX_CONFIG
2203# define EX_CONFIG	78	/* configuration error */
2204# endif
2205
2206/* pseudo-code used in server SMTP */
2207# define EX_QUIT	22	/* drop out of server immediately */
2208
2209/* pseudo-code used for mci_setstat */
2210# define EX_NOTSTICKY	-5	/* don't save persistent status */
2211
2212
2213/*
2214**  An "impossible" file mode to indicate that the file does not exist.
2215*/
2216
2217#define ST_MODE_NOFILE	0171147		/* unlikely to occur */
2218
2219
2220/*
2221**  These are used in a few cases where we need some special
2222**  error codes, but where the system doesn't provide something
2223**  reasonable.  They are printed in errstring.
2224*/
2225
2226#ifndef E_PSEUDOBASE
2227# define E_PSEUDOBASE	256
2228#endif
2229
2230#define E_SM_OPENTIMEOUT (E_PSEUDOBASE + 0)	/* Timeout on file open */
2231#define E_SM_NOSLINK	(E_PSEUDOBASE + 1)	/* Symbolic links not allowed */
2232#define E_SM_NOHLINK	(E_PSEUDOBASE + 2)	/* Hard links not allowed */
2233#define E_SM_REGONLY	(E_PSEUDOBASE + 3)	/* Regular files only */
2234#define E_SM_ISEXEC	(E_PSEUDOBASE + 4)	/* Executable files not allowed */
2235#define E_SM_WWDIR	(E_PSEUDOBASE + 5)	/* World writable directory */
2236#define E_SM_GWDIR	(E_PSEUDOBASE + 6)	/* Group writable directory */
2237#define E_SM_FILECHANGE (E_PSEUDOBASE + 7)	/* File changed after open */
2238#define E_SM_WWFILE	(E_PSEUDOBASE + 8)	/* World writable file */
2239#define E_SM_GWFILE	(E_PSEUDOBASE + 9)	/* Group writable file */
2240#define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
2241
2242/* type of arbitrary pointer */
2243#ifndef ARBPTR_T
2244# define ARBPTR_T	void *
2245#endif
2246
2247#ifndef __P
2248# include "cdefs.h"
2249#endif
2250
2251#if HESIOD && !defined(NAMED_BIND)
2252# define NAMED_BIND	1	/* not one without the other */
2253#endif
2254
2255#if NAMED_BIND && !defined(__ksr__) && !defined(h_errno)
2256extern int	h_errno;
2257#endif
2258
2259/*
2260**  Do some required dependencies
2261*/
2262
2263#if NETINET || NETISO
2264# ifndef SMTP
2265#  define SMTP		1	/* enable user and server SMTP */
2266# endif
2267# ifndef QUEUE
2268#  define QUEUE		1	/* enable queueing */
2269# endif
2270# ifndef DAEMON
2271#  define DAEMON	1	/* include the daemon (requires IPC & SMTP) */
2272# endif
2273#endif
2274
2275
2276/*
2277**  Arrange to use either varargs or stdargs
2278*/
2279
2280# ifdef __STDC__
2281
2282# include <stdarg.h>
2283
2284# define VA_LOCAL_DECL	va_list ap;
2285# define VA_START(f)	va_start(ap, f)
2286# define VA_END		va_end(ap)
2287
2288# else
2289
2290# include <varargs.h>
2291
2292# define VA_LOCAL_DECL	va_list ap;
2293# define VA_START(f)	va_start(ap)
2294# define VA_END		va_end(ap)
2295
2296# endif
2297
2298#ifdef HASUNAME
2299# include <sys/utsname.h>
2300# ifdef newstr
2301#  undef newstr
2302# endif
2303#else /* ! HASUNAME */
2304# define NODE_LENGTH 32
2305struct utsname
2306{
2307	char nodename[NODE_LENGTH+1];
2308};
2309#endif /* HASUNAME */
2310
2311#if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYSTEM_V)
2312# define MAXHOSTNAMELEN	256
2313#endif
2314
2315#if !defined(SIGCHLD) && defined(SIGCLD)
2316# define SIGCHLD	SIGCLD
2317#endif
2318
2319#ifndef STDIN_FILENO
2320# define STDIN_FILENO	0
2321#endif
2322
2323#ifndef STDOUT_FILENO
2324# define STDOUT_FILENO	1
2325#endif
2326
2327#ifndef STDERR_FILENO
2328# define STDERR_FILENO	2
2329#endif
2330
2331#ifndef LOCK_SH
2332# define LOCK_SH	0x01	/* shared lock */
2333# define LOCK_EX	0x02	/* exclusive lock */
2334# define LOCK_NB	0x04	/* non-blocking lock */
2335# define LOCK_UN	0x08	/* unlock */
2336#endif
2337
2338#ifndef S_IXOTH
2339# define S_IXOTH	(S_IEXEC >> 6)
2340#endif
2341
2342#ifndef S_IXGRP
2343# define S_IXGRP	(S_IEXEC >> 3)
2344#endif
2345
2346#ifndef S_IXUSR
2347# define S_IXUSR	(S_IEXEC)
2348#endif
2349
2350#ifndef SEEK_SET
2351# define SEEK_SET	0
2352# define SEEK_CUR	1
2353# define SEEK_END	2
2354#endif
2355
2356#ifndef SIG_ERR
2357# define SIG_ERR	((void (*)()) -1)
2358#endif
2359
2360#ifndef WEXITSTATUS
2361# define WEXITSTATUS(st)	(((st) >> 8) & 0377)
2362#endif
2363#ifndef WIFEXITED
2364# define WIFEXITED(st)		(((st) & 0377) == 0)
2365#endif
2366
2367#ifndef SIGFUNC_DEFINED
2368typedef void		(*sigfunc_t) __P((int));
2369#endif
2370#ifndef SIGFUNC_RETURN
2371# define SIGFUNC_RETURN
2372#endif
2373#ifndef SIGFUNC_DECL
2374# define SIGFUNC_DECL	void
2375#endif
2376
2377/* size of syslog buffer */
2378#ifndef SYSLOG_BUFSIZE
2379# define SYSLOG_BUFSIZE	1024
2380#endif
2381
2382/*
2383**  Size of prescan buffer.
2384**	Despite comments in the _sendmail_ book, this probably should
2385**	not be changed; there are some hard-to-define dependencies.
2386*/
2387
2388# define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
2389
2390/* fork routine -- set above using #ifdef _osname_ or in Makefile */
2391# ifndef FORK
2392# define FORK		fork		/* function to call to fork mailer */
2393# endif
2394
2395/*
2396**  Default to using scanf in readcf.
2397*/
2398
2399#ifndef SCANF
2400# define SCANF		1
2401#endif
2402
2403/*
2404**  SVr4 and similar systems use different routines for setjmp/longjmp
2405**  with signal support
2406*/
2407
2408#if USE_SIGLONGJMP
2409# ifdef jmp_buf
2410#  undef jmp_buf
2411# endif
2412# define jmp_buf		sigjmp_buf
2413# ifdef setjmp
2414#  undef setjmp
2415# endif
2416# define setjmp(env)		sigsetjmp(env, 1)
2417# ifdef longjmp
2418#  undef longjmp
2419# endif
2420# define longjmp(env, val)	siglongjmp(env, val)
2421#endif
2422
2423#if !defined(NGROUPS_MAX) && defined(NGROUPS)
2424# define NGROUPS_MAX	NGROUPS		/* POSIX naming convention */
2425#endif
2426
2427/*
2428**  If we don't have a system syslog, simulate it.
2429*/
2430
2431#if !LOG
2432# define LOG_EMERG	0	/* system is unusable */
2433# define LOG_ALERT	1	/* action must be taken immediately */
2434# define LOG_CRIT	2	/* critical conditions */
2435# define LOG_ERR	3	/* error conditions */
2436# define LOG_WARNING	4	/* warning conditions */
2437# define LOG_NOTICE	5	/* normal but significant condition */
2438# define LOG_INFO	6	/* informational */
2439# define LOG_DEBUG	7	/* debug-level messages */
2440#endif
2441