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