xref: /original-bsd/usr.sbin/sendmail/src/conf.h (revision 4de320d0)
1 /*
2  * Copyright (c) 1983, 1995 Eric P. Allman
3  * Copyright (c) 1988, 1993
4  *	The Regents of the University of California.  All rights reserved.
5  *
6  * %sccs.include.redist.c%
7  *
8  *	@(#)conf.h	8.168 (Berkeley) 05/25/95
9  */
10 
11 /*
12 **  CONF.H -- All user-configurable parameters for sendmail
13 **
14 **	Send updates to sendmail@CS.Berkeley.EDU so they will be
15 **	included in the next release.
16 */
17 
18 struct rusage;	/* forward declaration to get gcc to shut up in wait.h */
19 
20 # include <sys/param.h>
21 # include <sys/types.h>
22 # include <sys/stat.h>
23 # include <sys/file.h>
24 # include <sys/wait.h>
25 # include <fcntl.h>
26 # include <signal.h>
27 # include <netdb.h>
28 # include <pwd.h>
29 
30 /**********************************************************************
31 **  Table sizes, etc....
32 **	There shouldn't be much need to change these....
33 **********************************************************************/
34 
35 # define MAXLINE	2048		/* max line length */
36 # define MAXNAME	256		/* max length of a name */
37 # define MAXPV		40		/* max # of parms to mailers */
38 # define MAXATOM	200		/* max atoms per address */
39 # define MAXMAILERS	25		/* maximum mailers known to system */
40 # define MAXRWSETS	200		/* max # of sets of rewriting rules */
41 # define MAXPRIORITIES	25		/* max values for Precedence: field */
42 # define MAXMXHOSTS	20		/* max # of MX records */
43 # define SMTPLINELIM	990		/* maximum SMTP line length */
44 # define MAXKEY		128		/* maximum size of a database key */
45 # define MEMCHUNKSIZE	1024		/* chunk size for memory allocation */
46 # define MAXUSERENVIRON	100		/* max envars saved, must be >= 3 */
47 # define MAXALIASDB	12		/* max # of alias databases */
48 # define MAXMAPSTACK	12		/* max # of stacked or sequenced maps */
49 # define MAXTOCLASS	8		/* max # of message timeout classes */
50 # define MAXMIMEARGS	20		/* max args in Content-Type: */
51 # define MAXMIMENESTING	20		/* max MIME multipart nesting */
52 
53 # ifndef QUEUESIZE
54 #  define QUEUESIZE	3000		/* max # of jobs per queue run */
55 # endif
56 
57 /**********************************************************************
58 **  Compilation options.
59 **
60 **	#define these if they are available; comment them out otherwise.
61 **********************************************************************/
62 
63 # define LOG		1	/* enable logging */
64 # define UGLYUUCP	1	/* output ugly UUCP From lines */
65 # define NETUNIX	1	/* include unix domain support */
66 # define NETINET	1	/* include internet support */
67 # define MATCHGECOS	1	/* match user names from gecos field */
68 # define XDEBUG		1	/* enable extended debugging */
69 # if (defined(NEWDB) || defined(HESIOD)) && !defined(USERDB)
70 #  define USERDB	1	/* look in user database */
71 # endif
72 
73 /**********************************************************************
74 **  0/1 Compilation options.
75 **	#define these to 1 if they are available;
76 **	#define them to 0 otherwise.
77 **********************************************************************/
78 
79 # ifndef NAMED_BIND
80 #  define NAMED_BIND	1	/* use Berkeley Internet Domain Server */
81 # endif
82 
83 # ifndef DSN
84 #  define DSN		1	/* include delivery status notification code */
85 # endif
86 
87 # ifndef MIME8TO7
88 #  define MIME8TO7	1	/* 8->7 bit MIME conversions */
89 # endif
90 
91 # ifndef MIME7TO8
92 #  define MIME7TO8	1	/* 7->8 bit MIME conversions */
93 # endif
94 
95 /*
96 **  Most systems have symbolic links today, so default them on.  You
97 **  can turn them off by #undef'ing this below.
98 */
99 
100 # define HASLSTAT	1	/* has lstat(2) call */
101 
102 /*
103 **  General "standard C" defines.
104 **
105 **	These may be undone later, to cope with systems that claim to
106 **	be Standard C but aren't.  Gcc is the biggest offender -- it
107 **	doesn't realize that the library is part of the language.
108 **
109 **	Life would be much easier if we could get rid of this sort
110 **	of bozo problems.
111 */
112 
113 #ifdef __STDC__
114 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
115 #endif
116 /**********************************************************************
117 **  Operating system configuration.
118 **
119 **	Unless you are porting to a new OS, you shouldn't have to
120 **	change these.
121 **********************************************************************/
122 
123 
124 /*
125 **  HP-UX -- tested for 8.07, 9.00, and 9.01.
126 **
127 **	If V4FS is defined, compile for HP-UX 10.0.
128 */
129 
130 #ifdef __hpux
131 		/* common definitions for HP-UX 9.x and 10.x */
132 # undef m_flags		/* conflict between db.h & sys/sysmacros.h on HP 300 */
133 # define SYSTEM5	1	/* include all the System V defines */
134 # define HASINITGROUPS	1	/* has initgroups(3) call */
135 # define USESETEUID	1	/* has useable seteuid(2) call */
136 # define seteuid(e)	setresuid(-1, e, -1)
137 # define IP_SRCROUTE	1	/* can check IP source routing */
138 # define LA_TYPE	LA_HPUX
139 # define SPT_TYPE	SPT_PSTAT
140 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
141 # define GIDSET_T	gid_t
142 # ifndef HASGETUSERSHELL
143 #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
144 # endif
145 # define syslog		hard_syslog
146 # ifdef __STDC__
147 extern int	syslog(int, char *, ...);
148 # endif
149 
150 # ifdef V4FS
151 		/* HP-UX 10.x */
152 #  define _PATH_UNIX	"/stand/vmunix"
153 #  ifndef _PATH_SENDMAILCF
154 #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
155 #  endif
156 #  ifndef _PATH_SENDMAILPID
157 #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
158 #  endif
159 #  ifndef IDENTPROTO
160 #   define IDENTPROTO	1	/* TCP/IP implementation fixed in 10.0 */
161 #  endif
162 
163 # else
164 		/* HP-UX 9.x */
165 #  define _PATH_UNIX	"/hp-ux"
166 #  ifndef _PATH_SENDMAILCF
167 #   define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
168 #  endif
169 #  ifndef IDENTPROTO
170 #   define IDENTPROTO	0	/* TCP/IP implementation is broken */
171 #  endif
172 # endif
173 
174 #endif
175 
176 
177 /*
178 **  IBM AIX 3.x -- actually tested for 3.2.3
179 */
180 
181 #ifdef _AIX3
182 # define HASINITGROUPS	1	/* has initgroups(3) call */
183 # define HASUNAME	1	/* use System V uname(2) system call */
184 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
185 # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
186 # define FORK		fork	/* no vfork primitive available */
187 # define GIDSET_T	gid_t
188 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
189 # define SPT_PADCHAR	'\0'	/* pad process title with nulls */
190 # define LA_TYPE	LA_INT
191 #endif
192 
193 
194 /*
195 **  Silicon Graphics IRIX
196 **
197 **	Compiles on 4.0.1.
198 **
199 **	Use IRIX64 instead of IRIX for 64-bit IRIX (6.0).
200 **	Use IRIX5 instead of IRIX for IRIX 5.x.
201 **
202 **	IRIX64 changes from Mark R. Levinson <ml@cvdev.rochester.edu>.
203 **	IRIX5 changes from Kari E. Hurtta <Kari.Hurtta@fmi.fi>.
204 */
205 
206 #if defined(IRIX64) || defined(IRIX5)
207 # define IRIX
208 #endif
209 
210 #ifdef IRIX
211 # define SYSTEM5	1	/* this is a System-V derived system */
212 # define HASSETREUID	1	/* has setreuid(2) call */
213 # define HASINITGROUPS	1	/* has initgroups(3) call */
214 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
215 # define IP_SRCROUTE	1	/* can check IP source routing */
216 # define FORK		fork	/* no vfork primitive available */
217 # if !defined(IRIX64) && !defined(IRIX5)
218 #  define WAITUNION	1	/* use "union wait" as wait argument type */
219 # endif
220 # define setpgid	BSDsetpgrp
221 # define GIDSET_T	gid_t
222 # define ARGV_T		const char **
223 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
224 # define SFS_BAVAIL	f_bfree		/* alternate field name */
225 # define LA_TYPE	LA_INT
226 # ifdef IRIX64
227 #  define NAMELISTMASK	0x7fffffffffffffff	/* mask for nlist() values */
228 # else
229 #  define NAMELISTMASK	0x7fffffff		/* mask for nlist() values */
230 # endif
231 #endif
232 
233 
234 /*
235 **  SunOS and Solaris
236 **
237 **	Tested on SunOS 4.1.x (a.k.a. Solaris 1.1.x) and
238 **	Solaris 2.4 (a.k.a. SunOS 5.4).
239 */
240 
241 #if defined(sun) && !defined(BSD)
242 
243 # define HASINITGROUPS	1	/* has initgroups(3) call */
244 # define HASUNAME	1	/* use System V uname(2) system call */
245 # define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
246 # define IP_SRCROUTE	1	/* can check IP source routing */
247 # define LA_TYPE	LA_INT
248 
249 # ifdef SOLARIS_2_3
250 #  define SOLARIS	203	/* for back compat only -- use -DSOLARIS=203 */
251 # endif
252 
253 # ifdef SOLARIS
254 			/* Solaris 2.x (a.k.a. SunOS 5.x) */
255 #  ifndef __svr4__
256 #   define __svr4__		/* use all System V Releae 4 defines below */
257 #  endif
258 #  define BSD_COMP	1	/* get BSD ioctl calls */
259 #  include <sys/time.h>
260 #  define GIDSET_T	gid_t
261 #  ifndef _PATH_UNIX
262 #   define _PATH_UNIX	"/dev/ksyms"
263 #  endif
264 #  ifndef _PATH_SENDMAILCF
265 #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
266 #  endif
267 #  ifndef _PATH_SENDMAILPID
268 #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
269 #  endif
270 #  ifndef _PATH_HOSTS
271 #   define _PATH_HOSTS		"/etc/inet/hosts"
272 #  endif
273 #  ifndef SYSLOG_BUFSIZE
274 #   define SYSLOG_BUFSIZE	1024	/* allow full size syslog buffer */
275 #  endif
276 
277 # else
278 			/* SunOS 4.0.3 or 4.1.x */
279 #  define HASSETREUID	1	/* has setreuid(2) call */
280 #  ifndef HASFLOCK
281 #   define HASFLOCK	1	/* has flock(2) call */
282 #  endif
283 #  define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
284 #  include <vfork.h>
285 
286 #  ifdef SUNOS403
287 			/* special tweaking for SunOS 4.0.3 */
288 #   include <malloc.h>
289 #   define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
290 #   define NEEDSTRSTR	1	/* need emulation of strstr(3) routine */
291 #   define WAITUNION	1	/* use "union wait" as wait argument type */
292 #   undef WIFEXITED
293 #   undef WEXITSTATUS
294 #   undef HASUNAME
295 #   define setpgid	setpgrp
296 typedef int		pid_t;
297 extern char		*getenv();
298 
299 #  else
300 			/* 4.1.x specifics */
301 #   define HASSETSID	1	/* has Posix setsid(2) call */
302 #   define HASSETVBUF	1	/* we have setvbuf(3) in libc */
303 
304 #  endif
305 # endif
306 #endif
307 
308 /*
309 **  DG/UX
310 **
311 **	Tested on 5.4.2 and 5.4.3.  Use DGUX_5_4_2 to get the
312 **	older support.
313 **	5.4.3 changes from Mark T. Robinson <mtr@ornl.gov>.
314 */
315 
316 #ifdef DGUX_5_4_2
317 # define DGUX		1
318 #endif
319 
320 #ifdef	DGUX
321 # define SYSTEM5	1
322 # define LA_TYPE	LA_DGUX
323 # define HASSETREUID	1	/* has setreuid(2) call */
324 # define HASUNAME	1	/* use System V uname(2) system call */
325 # define HASSETSID	1	/* has Posix setsid(2) call */
326 # define HASINITGROUPS	1	/* has initgroups(3) call */
327 # define HASGETUSERSHELL 0	/* does not have getusershell(3) */
328 # ifndef IDENTPROTO
329 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
330 # endif
331 # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
332 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
333 
334 /* these include files must be included early on DG/UX */
335 # include <netinet/in.h>
336 # include <arpa/inet.h>
337 
338 # ifdef DGUX_5_4_2
339 #  define inet_addr	dgux_inet_addr
340 extern long	dgux_inet_addr();
341 # endif
342 #endif
343 
344 
345 /*
346 **  Digital Ultrix 4.2A or 4.3
347 **
348 **	Apparently, fcntl locking is broken on 4.2A, in that locks are
349 **	not dropped when the process exits.  This causes major problems,
350 **	so flock is the only alternative.
351 */
352 
353 #ifdef ultrix
354 # define HASSETREUID	1	/* has setreuid(2) call */
355 # define HASUNSETENV	1	/* has unsetenv(3) call */
356 # define HASINITGROUPS	1	/* has initgroups(3) call */
357 # define HASUNAME	1	/* use System V uname(2) system call */
358 # ifndef HASFLOCK
359 #  define HASFLOCK	1	/* has flock(2) call */
360 # endif
361 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
362 # ifndef BROKEN_RES_SEARCH
363 #  define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
364 # endif
365 # ifdef vax
366 #  define LA_TYPE	LA_FLOAT
367 # else
368 #  define LA_TYPE	LA_INT
369 #  define LA_AVENRUN	"avenrun"
370 # endif
371 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
372 # ifndef IDENTPROTO
373 #  define IDENTPROTO	0	/* pre-4.4 TCP/IP implementation is broken */
374 # endif
375 #endif
376 
377 
378 /*
379 **  OSF/1 for Intel Paragon.
380 **
381 **	Contributed by Jeff A. Earickson <jeff@ssd.intel.com>
382 **	of Intel Scalable Systems Divison.
383 */
384 
385 #ifdef __PARAGON__
386 # define __osf__	1	/* get OSF/1 defines below */
387 # ifndef _PATH_SENDMAILCF
388 #  define _PATH_SENDMAILCF	"/var/adm/sendmail/sendmail.cf"
389 # endif
390 #endif
391 
392 
393 /*
394 **  OSF/1 (tested on Alpha)
395 */
396 
397 #ifdef __osf__
398 # define HASUNSETENV	1	/* has unsetenv(3) call */
399 # define USESETEUID	1	/* has useable seteuid(2) call */
400 # define HASINITGROUPS	1	/* has initgroups(3) call */
401 # define IP_SRCROUTE	1	/* can check IP source routing */
402 # ifndef HASFLOCK
403 #  define HASFLOCK	1	/* has flock(2) call */
404 # endif
405 # define LA_TYPE	LA_INT
406 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
407 # ifndef _PATH_SENDMAILPID
408 #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
409 # endif
410 #endif
411 
412 
413 /*
414 **  NeXTstep
415 */
416 
417 #ifdef NeXT
418 # define HASINITGROUPS	1	/* has initgroups(3) call */
419 # ifndef HASFLOCK
420 #  define HASFLOCK	1	/* has flock(2) call */
421 # endif
422 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
423 # define WAITUNION	1	/* use "union wait" as wait argument type */
424 # define UID_T		int	/* compiler gripes on uid_t */
425 # define sleep		sleepX
426 # define setpgid	setpgrp
427 # ifndef LA_TYPE
428 #  define LA_TYPE	LA_MACH
429 # endif
430 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
431 # ifndef _POSIX_SOURCE
432 typedef int		pid_t;
433 #  undef WEXITSTATUS
434 #  undef WIFEXITED
435 # endif
436 # ifndef _PATH_SENDMAILCF
437 #  define _PATH_SENDMAILCF	"/etc/sendmail/sendmail.cf"
438 # endif
439 # ifndef _PATH_SENDMAILPID
440 #  define _PATH_SENDMAILPID	"/etc/sendmail/sendmail.pid"
441 # endif
442 #endif
443 
444 
445 /*
446 **  4.4 BSD
447 **
448 **	See also BSD defines.
449 */
450 
451 #ifdef BSD4_4
452 # define HASUNSETENV	1	/* has unsetenv(3) call */
453 # define USESETEUID	1	/* has useable seteuid(2) call */
454 # include <sys/cdefs.h>
455 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
456 # define BSD4_4_SOCKADDR	/* has sa_len */
457 # define NETLINK		/* supports AF_LINK */
458 # ifndef LA_TYPE
459 #  define LA_TYPE	LA_SUBR
460 # endif
461 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
462 # define SPT_TYPE	SPT_PSSTRINGS	/* use PS_STRINGS pointer */
463 #endif
464 
465 
466 /*
467 **  BSD/386 (all versions)
468 **	From Tony Sanders, BSDI
469 */
470 
471 #ifdef __bsdi__
472 # define HASUNSETENV	1	/* has the unsetenv(3) call */
473 # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
474 # define USESETEUID	1	/* has useable seteuid(2) call */
475 # include <sys/cdefs.h>
476 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
477 # define BSD4_4_SOCKADDR	/* has sa_len */
478 # define NETLINK		/* supports AF_LINK */
479 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
480 # ifndef LA_TYPE
481 #  define LA_TYPE	LA_SUBR
482 # endif
483 # define GIDSET_T	gid_t
484 # if defined(_BSDI_VERSION) && _BSDI_VERSION >= 199312
485 			/* version 1.1 or later */
486 #  undef SPT_TYPE
487 #  define SPT_TYPE	SPT_BUILTIN	/* setproctitle is in libc */
488 # else
489 			/* version 1.0 or earlier */
490 #  ifndef OLD_NEWDB
491 #   define OLD_NEWDB	1	/* old version of newdb library */
492 #  endif
493 #  define SPT_PADCHAR	'\0'	/* pad process title with nulls */
494 # endif
495 #endif
496 
497 
498 
499 /*
500 **  386BSD / FreeBSD 1.0E / NetBSD (all architectures, all versions)
501 **
502 **  4.3BSD clone, closer to 4.4BSD
503 **
504 **	See also BSD defines.
505 */
506 
507 #if defined(__386BSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
508 # define HASUNSETENV	1	/* has unsetenv(3) call */
509 # define HASSETSID	1	/* has the setsid(2) POSIX syscall */
510 # define USESETEUID	1	/* has useable seteuid(2) call */
511 # ifdef __NetBSD__
512 #  define HASUNAME	1	/* has uname(2) syscall */
513 # endif
514 # include <sys/cdefs.h>
515 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
516 # define BSD4_4_SOCKADDR	/* has sa_len */
517 # define NETLINK		/* supports AF_LINK */
518 # ifndef LA_TYPE
519 #  define LA_TYPE	LA_SUBR
520 # endif
521 # define SFS_TYPE	SFS_MOUNT	/* use <sys/mount.h> statfs() impl */
522 #endif
523 
524 
525 /*
526 **  Mach386
527 **
528 **	For mt Xinu's Mach386 system.
529 */
530 
531 #if defined(MACH) && defined(i386)
532 # define MACH386	1
533 # define HASUNSETENV	1	/* has unsetenv(3) call */
534 # define HASINITGROUPS	1	/* has initgroups(3) call */
535 # ifndef HASFLOCK
536 #  define HASFLOCK	1	/* has flock(2) call */
537 # endif
538 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
539 # define NEEDSTRTOL	1	/* need the strtol() function */
540 # define setpgid	setpgrp
541 # ifndef LA_TYPE
542 #  define LA_TYPE	LA_FLOAT
543 # endif
544 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
545 # undef HASSETVBUF		/* don't actually have setvbuf(3) */
546 # undef WEXITSTATUS
547 # undef WIFEXITED
548 # ifndef _PATH_SENDMAILCF
549 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
550 # endif
551 # ifndef _PATH_SENDMAILPID
552 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
553 # endif
554 #endif
555 
556 
557 /*
558 **  4.3 BSD -- this is for very old systems
559 **
560 **	Should work for mt Xinu MORE/BSD and Mips UMIPS-BSD 2.1.
561 **
562 **	You'll also have to install a new resolver library.
563 **	I don't guarantee that support for this environment is complete.
564 */
565 
566 #if defined(oldBSD43) || defined(MORE_BSD) || defined(umipsbsd)
567 # define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
568 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
569 # define ARBPTR_T	char *
570 # define setpgid	setpgrp
571 # ifndef LA_TYPE
572 #  define LA_TYPE	LA_FLOAT
573 # endif
574 # ifndef _PATH_SENDMAILCF
575 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
576 # endif
577 # ifndef IDENTPROTO
578 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
579 # endif
580 # undef WEXITSTATUS
581 # undef WIFEXITED
582 typedef short		pid_t;
583 extern int		errno;
584 #endif
585 
586 
587 /*
588 **  SCO Unix
589 **
590 **	This includes two parts -- the first is for SCO Open Server 3.2v4
591 **	(contributed by Philippe Brand <phb@colombo.telesys-innov.fr>).
592 **	The second is, I believe, for an older version.
593 */
594 
595 #ifdef _SCO_unix_4_2
596 # define _SCO_unix_
597 # define HASSETREUID	1	/* has setreuid(2) call */
598 # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
599 # define _PATH_UNIX	"/unix"
600 # ifndef _PATH_SENDMAILCF
601 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
602 # endif
603 # ifndef _PATH_SENDMAILPID
604 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
605 # endif
606 #endif
607 
608 #ifdef _SCO_unix_
609 # define SYSTEM5	1	/* include all the System V defines */
610 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
611 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
612 # define FORK		fork
613 # define MAXPATHLEN	PATHSIZE
614 # define LA_TYPE	LA_SHORT
615 # define SFS_TYPE	SFS_4ARGS	/* use <sys/statfs.h> 4-arg impl */
616 # define SFS_BAVAIL	f_bfree		/* alternate field name */
617 # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
618 # undef NETUNIX			/* no unix domain socket support */
619 #endif
620 
621 
622 /*
623 **  ISC (SunSoft) Unix.
624 **
625 **	Contributed by J.J. Bailey <jjb@jagware.bcc.com>
626 */
627 
628 #ifdef ISC_UNIX
629 # include <net/errno.h>
630 # define SYSTEM5	1	/* include all the System V defines */
631 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
632 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
633 # define HASSETREUID	1	/* has setreuid(2) call */
634 # define NEEDFSYNC	1	/* needs the fsync(2) call stub */
635 # undef NETUNIX			/* no unix domain socket support */
636 # define FORK		fork
637 # define MAXPATHLEN	1024
638 # define LA_TYPE	LA_SHORT
639 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
640 # define SFS_BAVAIL	f_bfree		/* alternate field name */
641 # define _PATH_UNIX	"/unix"
642 # ifndef _PATH_SENDMAILCF
643 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
644 # endif
645 # ifndef _PATH_SENDMAILPID
646 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
647 # endif
648 
649 typedef short		pid_t;
650 
651 #endif
652 
653 
654 /*
655 **  Altos System V.
656 **	Contributed by Tim Rice <timr@crl.com>.
657 */
658 
659 #ifdef ALTOS_SYS_V
660 # include <limits.h>
661 # define SYSTEM5	1	/* include all the System V defines */
662 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
663 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
664 # define WAITUNION	1	/* use "union wait" as wait argument type */
665 # define NEEDFSYNC	1	/* no fsync(2) in system library */
666 # define FORK		fork
667 # define MAXPATHLEN	PATHSIZE
668 # define LA_TYPE	LA_SHORT
669 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
670 # define SFS_BAVAIL	f_bfree		/* alternate field name */
671 # define TZ_TYPE	TZ_TM_NAME	/* use tm->tm_name */
672 # undef NETUNIX			/* no unix domain socket support */
673 # undef WIFEXITED
674 # undef WEXITSTATUS
675 # define strtoul	strtol	/* gcc library bogosity */
676 
677 typedef unsigned short	uid_t;
678 typedef unsigned short	gid_t;
679 typedef short		pid_t;
680 #endif
681 
682 
683 /*
684 **  ConvexOS 11.0 and later
685 **
686 **	"Todd C. Miller" <millert@mroe.cs.colorado.edu> claims this
687 **	works on 9.1 as well.
688 */
689 
690 #ifdef _CONVEX_SOURCE
691 # define BSD		1	/* include all the BSD defines */
692 # define HASUNAME	1	/* use System V uname(2) system call */
693 # define HASSETSID	1	/* has POSIX setsid(2) call */
694 # define NEEDGETOPT	1	/* need replacement for getopt(3) */
695 # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
696 # define LA_TYPE	LA_FLOAT
697 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
698 # ifndef _PATH_SENDMAILCF
699 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
700 # endif
701 # ifndef S_IREAD
702 #  define S_IREAD	_S_IREAD
703 #  define S_IWRITE	_S_IWRITE
704 #  define S_IEXEC	_S_IEXEC
705 #  define S_IFMT	_S_IFMT
706 #  define S_IFCHR	_S_IFCHR
707 #  define S_IFBLK	_S_IFBLK
708 # endif
709 # ifndef IDENTPROTO
710 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
711 # endif
712 #endif
713 
714 
715 /*
716 **  RISC/os 4.52
717 **
718 **	Gives a ton of warning messages, but otherwise compiles.
719 */
720 
721 #ifdef RISCOS
722 
723 # define HASUNSETENV	1	/* has unsetenv(3) call */
724 # ifndef HASFLOCK
725 #  define HASFLOCK	1	/* has flock(2) call */
726 # endif
727 # define WAITUNION	1	/* use "union wait" as wait argument type */
728 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
729 # define LA_TYPE	LA_INT
730 # define LA_AVENRUN	"avenrun"
731 # define _PATH_UNIX	"/unix"
732 # undef WIFEXITED
733 
734 # define setpgid	setpgrp
735 
736 extern int		errno;
737 typedef int		pid_t;
738 #define			SIGFUNC_DEFINED
739 typedef int		(*sigfunc_t)();
740 extern char		*getenv();
741 extern void		*malloc();
742 
743 #endif
744 
745 
746 /*
747 **  Linux 0.99pl10 and above...
748 **
749 **  Thanks to, in reverse order of contact:
750 **
751 **	John Kennedy <warlock@csuchico.edu>
752 **	Andrew Pam <avatar@aus.xanadu.com>
753 **	Florian La Roche <rzsfl@rz.uni-sb.de>
754 **	Karl London <karl@borg.demon.co.uk>
755 **
756 **  Last compiled against:	[12/14/94 @ 11:38:41 PM (Wednesday)]
757 **	sendmail 8.7.a.5	named 4.9.3-beta12-p1	db-1.85
758 **	gcc 2.6.2		libc.so.4.6.20
759 **	slackware 2.1.0		linux 1.1.70
760 */
761 
762 #ifdef __linux__
763 # define BSD		1	/* include BSD defines */
764 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
765 # define HASUNAME	1	/* use System V uname(2) system call */
766 # define HASUNSETENV	1	/* has unsetenv(3) call */
767 # define ERRLIST_PREDEFINED	/* don't declare sys_errlist */
768 # define GIDSET_T	gid_t	/* from <linux/types.h> */
769 # define HASGETUSERSHELL 0	/* getusershell(3) broken in Slackware 2.0 */
770 # ifndef HASFLOCK
771 #  define HASFLOCK	0	/* flock(2) is broken after 0.99.13 */
772 # endif
773 # ifndef LA_TYPE
774 #  define LA_TYPE	LA_PROCSTR
775 # endif
776 # define SFS_TYPE	SFS_VFS		/* use <sys/vfs.h> statfs() impl */
777 # ifndef _PATH_SENDMAILPID
778 #  define _PATH_SENDMAILPID	"/var/run/sendmail.pid"
779 # endif
780 # define TZ_TYPE	TZ_TNAME
781 # include <sys/sysmacros.h>
782 # undef atol			/* wounded in <stdlib.h> */
783 #endif
784 
785 
786 /*
787 **  DELL SVR4 Issue 2.2, and others
788 **	From Kimmo Suominen <kim@grendel.lut.fi>
789 **
790 **	It's on #ifdef DELL_SVR4 because Solaris also gets __svr4__
791 **	defined, and the definitions conflict.
792 **
793 **	Peter Wemm <peter@perth.DIALix.oz.au> claims that the setreuid
794 **	trick works on DELL 2.2 (SVR4.0/386 version 4.0) and ESIX 4.0.3A
795 **	(SVR4.0/386 version 3.0).
796 */
797 
798 #ifdef DELL_SVR4
799 				/* no changes necessary */
800 				/* see general __svr4__ defines below */
801 #endif
802 
803 
804 /*
805 **  Apple A/UX 3.0
806 */
807 
808 #ifdef _AUX_SOURCE
809 # include <sys/sysmacros.h>
810 # define BSD			/* has BSD routines */
811 # define BROKEN_RES_SEARCH 1	/* res_search(unknown) returns h_errno=0 */
812 # define HASUNAME	1	/* use System V uname(2) system call */
813 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
814 # define SIGFUNC_DEFINED	/* sigfunc_t already defined */
815 # ifndef IDENTPROTO
816 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
817 # endif
818 # define FORK		fork
819 # ifndef _PATH_SENDMAILCF
820 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
821 # endif
822 # ifndef LA_TYPE
823 #  define LA_TYPE	LA_ZERO
824 # endif
825 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
826 # undef WIFEXITED
827 # undef WEXITSTATUS
828 #endif
829 
830 
831 /*
832 **  Encore UMAX V
833 **
834 **	Not extensively tested.
835 */
836 
837 #ifdef UMAXV
838 # include <limits.h>
839 # define HASUNAME	1	/* use System V uname(2) system call */
840 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
841 # define HASINITGROUPS	1	/* has initgroups(3) call */
842 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
843 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
844 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
845 # define FORK		fork	/* no vfork(2) primitive available */
846 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
847 # define MAXPATHLEN	PATH_MAX
848 extern struct passwd	*getpwent(), *getpwnam(), *getpwuid();
849 extern struct group	*getgrent(), *getgrnam(), *getgrgid();
850 # undef WIFEXITED
851 # undef WEXITSTATUS
852 #endif
853 
854 
855 /*
856 **  Stardent Titan 3000 running TitanOS 4.2.
857 **
858 **	Must be compiled in "cc -43" mode.
859 **
860 **	From Kate Hedstrom <kate@ahab.rutgers.edu>.
861 **
862 **	Note the tweaking below after the BSD defines are set.
863 */
864 
865 #ifdef titan
866 # define setpgid	setpgrp
867 typedef int		pid_t;
868 # undef WIFEXITED
869 # undef WEXITSTATUS
870 #endif
871 
872 
873 /*
874 **  Sequent DYNIX 3.2.0
875 **
876 **	From Jim Davis <jdavis@cs.arizona.edu>.
877 */
878 
879 #ifdef sequent
880 
881 # define BSD		1
882 # define HASUNSETENV	1
883 # define BSD4_3		1	/* to get signal() in conf.c */
884 # define WAITUNION	1
885 # define LA_TYPE	LA_FLOAT
886 # ifdef	_POSIX_VERSION
887 #  undef _POSIX_VERSION		/* set in <unistd.h> */
888 # endif
889 # undef HASSETVBUF		/* don't actually have setvbuf(3) */
890 # define setpgid	setpgrp
891 
892 /* Have to redefine WIFEXITED to take an int, to work with waitfor() */
893 # undef	WIFEXITED
894 # define WIFEXITED(s)	(((union wait*)&(s))->w_stopval != WSTOPPED && \
895 			 ((union wait*)&(s))->w_termsig == 0)
896 # define WEXITSTATUS(s)	(((union wait*)&(s))->w_retcode)
897 typedef int		pid_t;
898 # define isgraph(c)	(isprint(c) && (c != ' '))
899 
900 # ifndef IDENTPROTO
901 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
902 # endif
903 
904 # ifndef _PATH_UNIX
905 #  define _PATH_UNIX	"/dynix"
906 # endif
907 # ifndef _PATH_SENDMAILCF
908 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
909 # endif
910 
911 #endif
912 
913 
914 /*
915 **  Sequent DYNIX/ptx v2.0 (and higher)
916 **
917 **	For DYNIX/ptx v1.x, undefine HASSETREUID.
918 **
919 **	From Tim Wright <timw@sequent.com>.
920 */
921 
922 #ifdef _SEQUENT_
923 # define SYSTEM5	1	/* include all the System V defines */
924 # define HASSETSID	1	/* has POSIX setsid(2) call */
925 # define HASINITGROUPS	1	/* has initgroups(3) call */
926 # define HASSETREUID	1	/* has setreuid(2) call */
927 # define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
928 # define GIDSET_T	gid_t
929 # define LA_TYPE	LA_INT
930 # define SFS_TYPE	SFS_STATFS	/* use <sys/statfs.h> statfs() impl */
931 # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
932 # ifndef IDENTPROTO
933 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
934 # endif
935 # ifndef _PATH_SENDMAILCF
936 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
937 # endif
938 # ifndef _PATH_SENDMAILPID
939 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
940 # endif
941 #endif
942 
943 
944 /*
945 **  Cray Unicos
946 **
947 **	Ported by David L. Kensiski, Sterling Sofware <kensiski@nas.nasa.gov>
948 */
949 
950 #ifdef UNICOS
951 # define SYSTEM5	1	/* include all the System V defines */
952 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
953 # define MAXPATHLEN	PATHSIZE
954 # define LA_TYPE	LA_ZERO
955 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
956 # define SFS_BAVAIL	f_bfree		/* alternate field name */
957 #endif
958 
959 
960 /*
961 **  Apollo DomainOS
962 **
963 **  From Todd Martin <tmartint@tus.ssi1.com> & Don Lewis <gdonl@gv.ssi1.com>
964 **
965 **  15 Jan 1994
966 **
967 */
968 
969 #ifdef apollo
970 # define HASSETREUID	1	/* has setreuid(2) call */
971 # define HASINITGROUPS	1	/* has initgroups(2) call */
972 # define SPT_TYPE	SPT_NONE	/* don't use setproctitle */
973 # define LA_TYPE	LA_SUBR		/* use getloadavg.c */
974 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
975 # define SFS_BAVAIL	f_bfree		/* alternate field name */
976 # ifndef _PATH_SENDMAILCF
977 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
978 # endif
979 # ifndef _PATH_SENDMAILPID
980 #  define _PATH_SENDMAILPID	"/etc/sendmail.pid"
981 # endif
982 # undef  S_IFSOCK		/* S_IFSOCK and S_IFIFO are the same */
983 # undef  S_IFIFO
984 # define S_IFIFO	0010000
985 # ifndef IDENTPROTO
986 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
987 # endif
988 #endif
989 
990 
991 /*
992 **  UnixWare 1.1.2.
993 **
994 **	From Evan Champion <evanc@spatial.synapse.org>.
995 */
996 
997 #ifdef UNIXWARE
998 # define SYSTEM5		1
999 # define HASGETUSERSHELL	0	/* does not have getusershell(3) call */
1000 # define HASGETDTABLESIZE	1
1001 # define HASSETREUID		1
1002 # define HASSETSID		1
1003 # define HASINITGROUPS		1
1004 # define GIDSET_T		gid_t
1005 # define SLEEP_T		unsigned
1006 # define SFS_TYPE		SFS_STATVFS
1007 # define LA_TYPE		LA_ZERO
1008 # undef WIFEXITED
1009 # undef WEXITSTATUS
1010 # define _PATH_UNIX		"/unix"
1011 # ifndef _PATH_SENDMAILCF
1012 #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
1013 # endif
1014 # ifndef _PATH_SENDMAILPID
1015 #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
1016 # endif
1017 # define SYSLOG_BUFSIZE	128
1018 #endif
1019 
1020 
1021 /*
1022 **  Intergraph CLIX 3.1
1023 **
1024 **	From Paul Southworth <pauls@locust.cic.net>
1025 */
1026 
1027 #ifdef CLIX
1028 # define SYSTEM5	1	/* looks like System V */
1029 # ifndef HASGETUSERSHELL
1030 #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1031 # endif
1032 # define DEV_BSIZE	512	/* device block size not defined */
1033 # define GIDSET_T	gid_t
1034 # undef LOG			/* syslog not available */
1035 # define NEEDFSYNC	1	/* no fsync in system library */
1036 # define GETSHORT	_getshort
1037 #endif
1038 
1039 
1040 /*
1041 **  NCR 3000 Series (SysVr4)
1042 **
1043 **	From Kevin Darcy <kevin@tech.mis.cfc.com>.
1044 */
1045 
1046 #ifdef NCR3000
1047 # define __svr4__
1048 # define IP_SRCROUTE	0	/* Something is broken with getsockopt() */
1049 # undef BSD
1050 # define LA_AVENRUN	"avenrun"
1051 #endif
1052 
1053 
1054 /*
1055 **  Tandem NonStop-UX SVR4
1056 **
1057 **	From Rick McCarty <mccarty@mpd.tandem.com>.
1058 */
1059 
1060 #ifdef NonStop_UX_BXX
1061 # define __svr4__
1062 #endif
1063 
1064 
1065 /*
1066 **  Hitachi 3050R & 3050RX Workstations running HI-UX/WE2.
1067 **
1068 **	Tested for 1.04 and 1.03
1069 **	From Akihiro Hashimoto ("Hash") <hash@dominic.ipc.chiba-u.ac.jp>.
1070 */
1071 
1072 #ifdef __H3050R
1073 # define SYSTEM5	1	/* include all the System V defines */
1074 # define HASINITGROUPS	1	/* has initgroups(3) call */
1075 # define setreuid(r, e)	setresuid(r, e, -1)
1076 # define LA_TYPE	LA_FLOAT
1077 # define SFS_TYPE	SFS_VFS	/* use <sys/vfs.h> statfs() implementation */
1078 # define HASSETVBUF	/* HI-UX has no setlinebuf */
1079 # ifndef GIDSET_T
1080 #  define GIDSET_T	gid_t
1081 # endif
1082 # ifndef _PATH_UNIX
1083 #  define _PATH_UNIX	"/HI-UX"
1084 # endif
1085 # ifndef _PATH_SENDMAILCF
1086 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
1087 # endif
1088 # ifndef IDENTPROTO
1089 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1090 # endif
1091 # ifndef HASGETUSERSHELL
1092 #  define HASGETUSERSHELL 0	/* getusershell(3) causes core dumps */
1093 # endif
1094 
1095 /* avoid m_flags conflict between db.h & sys/sysmacros.h on HIUX 3050 */
1096 # undef m_flags
1097 
1098 # ifdef __STDC__
1099 extern int	syslog(int, char *, ...);
1100 # endif
1101 
1102 #endif
1103 
1104 
1105 /*
1106 **  Amdahl UTS System V 2.1.5 (SVr3-based)
1107 **
1108 **    From: Janet Jackson <janet@dialix.oz.au>.
1109 */
1110 
1111 #ifdef _UTS
1112 # include <sys/sysmacros.h>
1113 # undef HASLSTAT	/* has symlinks, but they cause problems */
1114 # define NEEDFSYNC	1	/* system fsync(2) fails on non-EFS filesys */
1115 # define SYS5SIGNALS	1	/* System V signal semantics */
1116 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
1117 # define HASUNAME	1	/* use System V uname(2) system call */
1118 # define HASINITGROUPS	1	/* has initgroups(3) function */
1119 # define HASSETVBUF	1	/* has setvbuf(3) function */
1120 # define HASSIGSETMASK	0	/* does not have sigsetmask(2) function */
1121 # ifndef HASGETUSERSHELL
1122 #  define HASGETUSERSHELL 0	/* does not have getusershell(3) function */
1123 # endif
1124 # define GIDSET_T	gid_t	/* type of 2nd arg to getgroups(2) isn't int */
1125 # define LA_TYPE	LA_ZERO		/* doesn't have load average */
1126 # define SFS_TYPE	SFS_4ARGS	/* use 4-arg statfs() */
1127 # define SFS_BAVAIL	f_bfree		/* alternate field name */
1128 # define _PATH_UNIX	"/unix"
1129 # ifndef _PATH_SENDMAILCF
1130 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
1131 # endif
1132 #endif
1133 
1134 /*
1135 **  Cray Computer Corporation's CSOS
1136 **
1137 **	From Scott Bolte <scott@craycos.com>.
1138 */
1139 
1140 #ifdef _CRAYCOM
1141 # define SYSTEM5	1	/* include all the System V defines */
1142 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1143 # define NEEDFSYNC	1	/* no fsync in system library */
1144 # define MAXPATHLEN	PATHSIZE
1145 # define LA_TYPE	LA_ZERO
1146 # define SFS_TYPE	SFS_4ARGS	/* four argument statfs() call */
1147 # define SFS_BAVAIL	f_bfree		/* alternate field name */
1148 # define _POSIX_CHOWN_RESTRICTED	-1
1149 extern struct group	*getgrent(), *getgrnam(), *getgrgid();
1150 #endif
1151 
1152 
1153 /*
1154 **  Sony NEWS-OS 4.2.1R and 6.0.3
1155 **
1156 **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
1157 */
1158 
1159 #ifdef sony_news
1160 # ifndef __svr4
1161 			/* NEWS-OS 4.2.1R */
1162 #  ifndef BSD
1163 #   define BSD			/* has BSD routines */
1164 #  endif
1165 #  define HASUNSETENV	1	/* has unsetenv(2) call */
1166 #  undef HASSETVBUF		/* don't actually have setvbuf(3) */
1167 #  define WAITUNION	1	/* use "union wait" as wait argument type */
1168 #  define LA_TYPE	LA_INT
1169 #  define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1170 #  ifndef HASFLOCK
1171 #   define HASFLOCK	1	/* has flock(2) call */
1172 #  endif
1173 #  define setpgid	setpgrp
1174 #  undef WIFEXITED
1175 #  undef WEXITSTATUS
1176 typedef int		pid_t;
1177 typedef int		(*sigfunc_t)();
1178 #  define SIGFUNC_DEFINED
1179 
1180 # else
1181 			/* NEWS-OS 6.0.3 with /bin/cc */
1182 #  define SYSTEM5	1	/* include all the System V defines */
1183 #  define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1184 #  define HASINITGROUPS	1	/* has initgroups(3) call */
1185 #  define USESETEUID	1	/* has useable seteuid(2) call */
1186 #  define HASSETSID	1	/* has Posix setsid(2) call */
1187 #  define HASGETUSERSHELL 1	/* DOES have getusershell(3) call in libc */
1188 #  define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
1189 #  define SFS_TYPE	SFS_STATVFS	/* use <sys/statvfs.h> statvfs() impl */
1190 #  ifndef SPT_TYPE
1191 #   define SPT_TYPE	SPT_SYSMIPS	/* use sysmips() (OS 6.0.2 or later) */
1192 #  endif
1193 #  define GIDSET_T	gid_t
1194 #  undef WIFEXITED
1195 #  undef WEXITSTATUS
1196 #  define _PATH_UNIX  "/stand/unix"
1197 #  ifndef _PATH_SENDMAILCF
1198 #   define _PATH_SENDMAILCF	"/etc/mail/sendmail.cf"
1199 #  endif
1200 #  ifndef _PATH_SENDMAILPID
1201 #   define _PATH_SENDMAILPID	"/etc/mail/sendmail.pid"
1202 #  endif
1203 
1204 # endif
1205 #endif
1206 
1207 
1208 /*
1209 **  Omron LUNA/UNIOS-B 3.0, LUNA2/Mach and LUNA88K Mach
1210 **
1211 **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
1212 */
1213 
1214 #ifdef luna
1215 # ifndef IDENTPROTO
1216 #  define IDENTPROTO	0	/* TCP/IP implementation is broken */
1217 # endif
1218 # ifdef uniosb
1219 #  include <sys/time.h>
1220 #  define NEEDVPRINTF	1	/* need a replacement for vprintf(3) */
1221 # endif
1222 # define HASUNSETENV	1	/* has unsetenv(2) call */
1223 # define NEEDPUTENV	1	/* need putenv(3) call */
1224 # define NEEDGETOPT	1	/* need a replacement for getopt(3) */
1225 # define NEEDSTRSTR	1	/* need emulation of the strstr(3) call */
1226 # define WAITUNION	1	/* use "union wait" as wait argument type */
1227 # ifdef uniosb
1228 #  define LA_TYPE	LA_INT
1229 # endif
1230 # ifdef luna2m
1231 #  define LA_TYPE	LA_SUBR
1232 # endif
1233 # ifdef luna88k
1234 #  define LA_TYPE	LA_INT
1235 # endif
1236 # define SFS_TYPE	SFS_VFS /* use <sys/vfs.h> statfs() implementation */
1237 # define setpgid	setpgrp
1238 # undef WIFEXITED
1239 # undef WEXITSTATUS
1240 typedef int		pid_t;
1241 typedef int		(*sigfunc_t)();
1242 # define SIGFUNC_DEFINED
1243 extern char	*getenv();
1244 extern int	errno;
1245 # ifndef _PATH_SENDMAILCF
1246 #  define _PATH_SENDMAILCF	"/usr/lib/sendmail.cf"
1247 # endif
1248 #endif
1249 
1250 
1251 /*
1252 **  NEC EWS-UX/V 4.2 (with /usr/ucb/cc)
1253 **
1254 **	From Motonori NAKAMURA <motonori@cs.ritsumei.ac.jp>.
1255 */
1256 
1257 #ifdef nec_ews_svr4
1258 # ifndef __svr4__
1259 #  define __svr4__		/* use all System V Releae 4 defines below */
1260 # endif
1261 # define SYS5SIGNALS	1	/* SysV signal semantics -- reset on each sig */
1262 # define HASSETSID	1	/* has Posix setsid(2) call */
1263 # define LA_TYPE	LA_READKSYM	/* use MIOC_READSYM ioctl */
1264 # define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
1265 # define GIDSET_T	gid_t
1266 # undef WIFEXITED
1267 # undef WEXITSTATUS
1268 # define NAMELISTMASK	0x7fffffff	/* mask for nlist() values */
1269 #endif
1270 
1271 
1272 
1273 /**********************************************************************
1274 **  End of Per-Operating System defines
1275 **********************************************************************/
1276 /**********************************************************************
1277 **  More general defines
1278 **********************************************************************/
1279 
1280 /* general BSD defines */
1281 #ifdef BSD
1282 # define HASGETDTABLESIZE 1	/* has getdtablesize(2) call */
1283 # define HASSETREUID	1	/* has setreuid(2) call */
1284 # define HASINITGROUPS	1	/* has initgroups(3) call */
1285 # ifndef IP_SRCROUTE
1286 #  define IP_SRCROUTE	1	/* can check IP source routing */
1287 # endif
1288 # ifndef HASSETRLIMIT
1289 #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
1290 # endif
1291 # ifndef HASFLOCK
1292 #  define HASFLOCK	1	/* has flock(2) call */
1293 # endif
1294 # ifndef TZ_TYPE
1295 #  define TZ_TYPE	TZ_TM_ZONE	/* use tm->tm_zone variable */
1296 # endif
1297 #endif
1298 
1299 /* general System V Release 4 defines */
1300 #ifdef __svr4__
1301 # define SYSTEM5	1
1302 # define USESETEUID	1	/* has useable seteuid(2) call */
1303 # define HASINITGROUPS	1	/* has initgroups(3) call */
1304 # ifndef HASSETRLIMIT
1305 #  define HASSETRLIMIT	1	/* has setrlimit(2) call */
1306 # endif
1307 # ifndef HASGETUSERSHELL
1308 #  define HASGETUSERSHELL 0	/* does not have getusershell(3) call */
1309 # endif
1310 
1311 # ifndef _PATH_UNIX
1312 #  define _PATH_UNIX		"/unix"
1313 # endif
1314 # ifndef _PATH_SENDMAILCF
1315 #  define _PATH_SENDMAILCF	"/usr/ucblib/sendmail.cf"
1316 # endif
1317 # ifndef _PATH_SENDMAILPID
1318 #  define _PATH_SENDMAILPID	"/usr/ucblib/sendmail.pid"
1319 # endif
1320 # ifndef SYSLOG_BUFSIZE
1321 #  define SYSLOG_BUFSIZE	128
1322 # endif
1323 # ifndef SFS_TYPE
1324 #  define SFS_TYPE		SFS_STATVFS
1325 # endif
1326 #endif
1327 
1328 /* general System V defines */
1329 #ifdef SYSTEM5
1330 # include <sys/sysmacros.h>
1331 # define HASUNAME	1	/* use System V uname(2) system call */
1332 # define SYS5SETPGRP	1	/* use System V setpgrp(2) syscall */
1333 # define HASSETVBUF	1	/* we have setvbuf(3) in libc */
1334 # ifndef HASULIMIT
1335 #  define HASULIMIT	1	/* has the ulimit(2) syscall */
1336 # endif
1337 # ifndef LA_TYPE
1338 #  ifdef MIOC_READKSYM
1339 #   define LA_TYPE	LA_READKSYM	/* use MIOC_READKSYM ioctl */
1340 #  else
1341 #   define LA_TYPE	LA_INT		/* assume integer load average */
1342 #  endif
1343 # endif
1344 # ifndef SFS_TYPE
1345 #  define SFS_TYPE	SFS_USTAT	/* use System V ustat(2) syscall */
1346 # endif
1347 # ifndef TZ_TYPE
1348 #  define TZ_TYPE	TZ_TZNAME	/* use tzname[] vector */
1349 # endif
1350 # define bcopy(s, d, l)		(memmove((d), (s), (l)))
1351 # define bzero(d, l)		(memset((d), '\0', (l)))
1352 # define bcmp(s, d, l)		(memcmp((s), (d), (l)))
1353 #endif
1354 
1355 /* general POSIX defines */
1356 #ifdef _POSIX_VERSION
1357 # define HASSETSID	1	/* has Posix setsid(2) call */
1358 # define HASWAITPID	1	/* has Posix waitpid(2) call */
1359 # if _POSIX_VERSION >= 199500 && !defined(USESETEUID)
1360 #  define USESETEUID	1	/* has useable seteuid(2) call */
1361 # endif
1362 #endif
1363 /*
1364 **  Tweaking for systems that (for example) claim to be BSD or POSIX
1365 **  but don't have all the standard BSD or POSIX routines (boo hiss).
1366 */
1367 
1368 #ifdef titan
1369 # undef HASINITGROUPS		/* doesn't have initgroups(3) call */
1370 #endif
1371 
1372 #ifdef _CRAYCOM
1373 # undef HASSETSID		/* despite POSIX claim, doesn't have setsid */
1374 #endif
1375 
1376 #ifdef ISC_UNIX
1377 # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
1378 #endif
1379 
1380 #ifdef ALTOS_SYS_V
1381 # undef bcopy			/* despite SystemV claim, uses BSD bcopy */
1382 # undef bzero			/* despite SystemV claim, uses BSD bzero */
1383 # undef bcmp			/* despite SystemV claim, uses BSD bcmp */
1384 #endif
1385 
1386 
1387 /*
1388 **  Due to a "feature" in some operating systems such as Ultrix 4.3 and
1389 **  HPUX 8.0, if you receive a "No route to host" message (ICMP message
1390 **  ICMP_UNREACH_HOST) on _any_ connection, all connections to that host
1391 **  are closed.  Some firewalls return this error if you try to connect
1392 **  to the IDENT port (113), so you can't receive email from these hosts
1393 **  on these systems.  The firewall really should use a more specific
1394 **  message such as ICMP_UNREACH_PROTOCOL or _PORT or _NET_PROHIB.  If
1395 **  not explicitly set to zero above, default it on.
1396 */
1397 
1398 #ifndef IDENTPROTO
1399 # define IDENTPROTO	1	/* use IDENT proto (RFC 1413) */
1400 #endif
1401 
1402 #ifndef IP_SRCROUTE
1403 # define IP_SRCROUTE	1	/* Detect IP source routing */
1404 #endif
1405 
1406 #ifndef HASGETUSERSHELL
1407 # define HASGETUSERSHELL 1	/* libc has getusershell(3) call */
1408 #endif
1409 
1410 #ifndef HASFLOCK
1411 # define HASFLOCK	0	/* assume no flock(2) support */
1412 #endif
1413 
1414 #ifndef HASSETREUID
1415 # define HASSETREUID	0	/* assume no setreuid(2) call */
1416 #endif
1417 
1418 #ifndef USESETEUID
1419 # define USESETEUID	0	/* assume no seteuid(2) call or no saved ids */
1420 #endif
1421 
1422 #ifndef HASSETRLIMIT
1423 # define HASSETRLIMIT	0	/* assume no setrlimit(2) support */
1424 #endif
1425 
1426 #ifndef HASULIMIT
1427 # define HASULIMIT	0	/* assume no ulimit(2) support */
1428 #endif
1429 
1430 #ifndef OLD_NEWDB
1431 # define OLD_NEWDB	0	/* assume newer version of newdb */
1432 #endif
1433 
1434 /* heuristic setting of HASSETSIGMASK; can override above */
1435 #ifndef HASSIGSETMASK
1436 # ifdef SIGVTALRM
1437 #  define HASSETSIGMASK	1
1438 # else
1439 #  define HASSETSIGMASK	0
1440 # endif
1441 #endif
1442 
1443 /*
1444 **  If no type for argument two of getgroups call is defined, assume
1445 **  it's an integer -- unfortunately, there seem to be several choices
1446 **  here.
1447 */
1448 
1449 #ifndef GIDSET_T
1450 # define GIDSET_T	int
1451 #endif
1452 
1453 #ifndef UID_T
1454 # define UID_T		uid_t
1455 #endif
1456 
1457 #ifndef SIZE_T
1458 # define SIZE_T		size_t
1459 #endif
1460 
1461 #ifndef ARGV_T
1462 # define ARGV_T		char **
1463 #endif
1464 /**********************************************************************
1465 **  Remaining definitions should never have to be changed.  They are
1466 **  primarily to provide back compatibility for older systems -- for
1467 **  example, it includes some POSIX compatibility definitions
1468 **********************************************************************/
1469 
1470 /* System 5 compatibility */
1471 #ifndef S_ISREG
1472 # define S_ISREG(foo)	((foo & S_IFMT) == S_IFREG)
1473 #endif
1474 #if !defined(S_ISLNK) && defined(S_IFLNK)
1475 # define S_ISLNK(foo)	((foo & S_IFMT) == S_IFLNK)
1476 #endif
1477 #ifndef S_IWUSR
1478 # define S_IWUSR		0200
1479 #endif
1480 #ifndef S_IWGRP
1481 # define S_IWGRP		0020
1482 #endif
1483 #ifndef S_IWOTH
1484 # define S_IWOTH		0002
1485 #endif
1486 
1487 /*
1488 **  Older systems don't have this error code -- it should be in
1489 **  /usr/include/sysexits.h.
1490 */
1491 
1492 # ifndef EX_CONFIG
1493 # define EX_CONFIG	78	/* configuration error */
1494 # endif
1495 
1496 /* pseudo-code used in server SMTP */
1497 # define EX_QUIT	22	/* drop out of server immediately */
1498 
1499 
1500 /*
1501 **  These are used in a few cases where we need some special
1502 **  error codes, but where the system doesn't provide something
1503 **  reasonable.  They are printed in errstring.
1504 */
1505 
1506 #ifndef E_PSEUDOBASE
1507 # define E_PSEUDOBASE	256
1508 #endif
1509 
1510 #define EOPENTIMEOUT	(E_PSEUDOBASE + 0)	/* timeout on open */
1511 #define E_DNSBASE	(E_PSEUDOBASE + 20)	/* base for DNS h_errno */
1512 
1513 /* type of arbitrary pointer */
1514 #ifndef ARBPTR_T
1515 # define ARBPTR_T	void *
1516 #endif
1517 
1518 #ifndef __P
1519 # include "cdefs.h"
1520 #endif
1521 
1522 #if NAMED_BIND
1523 # include <arpa/nameser.h>
1524 # ifdef __svr4__
1525 #  ifdef NOERROR
1526 #   undef NOERROR		/* avoid compiler conflict with stream.h */
1527 #  endif
1528 # endif
1529 #endif
1530 
1531 /*
1532 **  The size of an IP address -- can't use sizeof because of problems
1533 **  on Crays, where everything is 64 bits.  This will break if/when
1534 **  IP addresses are expanded to eight bytes.
1535 */
1536 
1537 #ifndef INADDRSZ
1538 # define INADDRSZ	4
1539 #endif
1540 
1541 /*
1542 **  The size of various known types -- for reading network protocols.
1543 **  Again, we can't use sizeof because of compiler randomness.
1544 */
1545 
1546 #ifndef INT16SZ
1547 # define INT16SZ	2
1548 #endif
1549 #ifndef INT32SZ
1550 # define INT32SZ	4
1551 #endif
1552 
1553 /*
1554 **  Do some required dependencies
1555 */
1556 
1557 #if defined(NETINET) || defined(NETISO)
1558 # define SMTP		1	/* enable user and server SMTP */
1559 # define QUEUE		1	/* enable queueing */
1560 # define DAEMON		1	/* include the daemon (requires IPC & SMTP) */
1561 #endif
1562 
1563 
1564 /*
1565 **  Arrange to use either varargs or stdargs
1566 */
1567 
1568 # ifdef __STDC__
1569 
1570 # include <stdarg.h>
1571 
1572 # define VA_LOCAL_DECL	va_list ap;
1573 # define VA_START(f)	va_start(ap, f)
1574 # define VA_END		va_end(ap)
1575 
1576 # else
1577 
1578 # include <varargs.h>
1579 
1580 # define VA_LOCAL_DECL	va_list ap;
1581 # define VA_START(f)	va_start(ap)
1582 # define VA_END		va_end(ap)
1583 
1584 # endif
1585 
1586 #ifdef HASUNAME
1587 # include <sys/utsname.h>
1588 # ifdef newstr
1589 #  undef newstr
1590 # endif
1591 #else /* ! HASUNAME */
1592 # define NODE_LENGTH 32
1593 struct utsname
1594 {
1595 	char nodename[NODE_LENGTH+1];
1596 };
1597 #endif /* HASUNAME */
1598 
1599 #if !defined(MAXHOSTNAMELEN) && !defined(_SCO_unix_) && !defined(NonStop_UX_BXX) && !defined(ALTOS_SYS_V)
1600 # define MAXHOSTNAMELEN	256
1601 #endif
1602 
1603 #if !defined(SIGCHLD) && defined(SIGCLD)
1604 # define SIGCHLD	SIGCLD
1605 #endif
1606 
1607 #ifndef STDIN_FILENO
1608 # define STDIN_FILENO	0
1609 #endif
1610 
1611 #ifndef STDOUT_FILENO
1612 # define STDOUT_FILENO	1
1613 #endif
1614 
1615 #ifndef STDERR_FILENO
1616 # define STDERR_FILENO	2
1617 #endif
1618 
1619 #ifndef LOCK_SH
1620 # define LOCK_SH	0x01	/* shared lock */
1621 # define LOCK_EX	0x02	/* exclusive lock */
1622 # define LOCK_NB	0x04	/* non-blocking lock */
1623 # define LOCK_UN	0x08	/* unlock */
1624 #endif
1625 
1626 #ifndef SEEK_SET
1627 # define SEEK_SET	0
1628 # define SEEK_CUR	1
1629 # define SEEK_END	2
1630 #endif
1631 
1632 #ifndef SIG_ERR
1633 # define SIG_ERR	((void (*)()) -1)
1634 #endif
1635 
1636 #ifndef WEXITSTATUS
1637 # define WEXITSTATUS(st)	(((st) >> 8) & 0377)
1638 #endif
1639 #ifndef WIFEXITED
1640 # define WIFEXITED(st)		(((st) & 0377) == 0)
1641 #endif
1642 
1643 #ifndef SIGFUNC_DEFINED
1644 typedef void		(*sigfunc_t) __P((int));
1645 #endif
1646 
1647 /* size of syslog buffer */
1648 #ifndef SYSLOG_BUFSIZE
1649 # define SYSLOG_BUFSIZE	1024
1650 #endif
1651 
1652 /*
1653 **  Size of tobuf (deliver.c)
1654 **	Tweak this to match your syslog implementation.  It will have to
1655 **	allow for the extra information printed.
1656 */
1657 
1658 #ifndef TOBUFSIZE
1659 # if (SYSLOG_BUFSIZE) > 512
1660 #  define TOBUFSIZE	(SYSLOG_BUFSIZE - 256)
1661 # else
1662 #  define TOBUFSIZE	256
1663 # endif
1664 #endif
1665 
1666 /*
1667 **  Size of prescan buffer.
1668 **	Despite comments in the _sendmail_ book, this probably should
1669 **	not be changed; there are some hard-to-define dependencies.
1670 */
1671 
1672 # define PSBUFSIZE	(MAXNAME + MAXATOM)	/* size of prescan buffer */
1673 /* fork routine -- set above using #ifdef _osname_ or in Makefile */
1674 # ifndef FORK
1675 # define FORK		vfork		/* function to call to fork mailer */
1676 # endif
1677 
1678 /*
1679 **  If we are going to link scanf anyway, use it in readcf
1680 */
1681 
1682 #if !defined(HASUNAME) && !defined(SCANF)
1683 # define SCANF		1
1684 #endif
1685