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