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