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