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