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