Postfix3.3.1
全て データ構造 ファイル 関数 変数 型定義 マクロ定義
sys_defs.h
[詳解]
1 #ifndef _SYS_DEFS_H_INCLUDED_
2 #define _SYS_DEFS_H_INCLUDED_
3 
4 /*++
5 /* NAME
6 /* sys_defs 3h
7 /* SUMMARY
8 /* portability header
9 /* SYNOPSIS
10 /* #include <sys_defs.h>
11 /* DESCRIPTION
12 /* .nf
13 
14  /*
15  * Specific platforms. Major release numbers differ for a good reason. So be
16  * a good girl, plan for the future, and at least include the major release
17  * number in the system type (for example, SUNOS5 or FREEBSD2). The system
18  * type is determined by the makedefs shell script in the top-level
19  * directory. Adding support for a new system type means updating the
20  * makedefs script, and adding a section below for the new system.
21  */
22 #ifdef SUNOS5
23 #define _SVID_GETTOD /* Solaris 2.5, XSH4.2 versus SVID */
24 #endif
25 #include <sys/types.h>
26 
27  /*
28  * 4.4BSD and close derivatives.
29  */
30 #if defined(FREEBSD2) || defined(FREEBSD3) || defined(FREEBSD4) \
31  || defined(FREEBSD5) || defined(FREEBSD6) || defined(FREEBSD7) \
32  || defined(FREEBSD8) || defined(FREEBSD9) || defined(FREEBSD10) \
33  || defined(BSDI2) || defined(BSDI3) || defined(BSDI4) \
34  || defined(OPENBSD2) || defined(OPENBSD3) || defined(OPENBSD4) \
35  || defined(OPENBSD5) || defined(OPENBSD6) \
36  || defined(NETBSD1) || defined(NETBSD2) || defined(NETBSD3) \
37  || defined(NETBSD4) || defined(NETBSD5) || defined(NETBSD6) \
38  || defined(NETBSD7) \
39  || defined(EKKOBSD1) || defined(DRAGONFLY)
40 #define SUPPORTED
41 #include <sys/param.h>
42 #define UINT32_TYPE unsigned int
43 #define UINT16_TYPE unsigned short
44 #define USE_PATHS_H
45 #define HAS_FLOCK_LOCK
46 #define HAS_FCNTL_LOCK
47 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
48 #define DEF_MAILBOX_LOCK "flock, dotlock"
49 #define HAS_SUN_LEN
50 #define HAS_FSYNC
51 #define HAS_DB
52 #define HAS_SA_LEN
53 #define NATIVE_DB_TYPE "hash"
54 #if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104250000)
55 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases" /* sendmail 8.10 */
56 #endif
57 #if (defined(OpenBSD) && OpenBSD >= 200006)
58 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases" /* OpenBSD 2.7 */
59 #endif
60 #ifndef ALIAS_DB_MAP
61 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
62 #endif
63 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
64 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin"
65 #if (defined(__NetBSD_Version__) && __NetBSD_Version__ > 299000900)
66 #define USE_STATVFS
67 #define STATVFS_IN_SYS_STATVFS_H
68 #else
69 #define USE_STATFS
70 #define STATFS_IN_SYS_MOUNT_H
71 #endif
72 #define HAS_POSIX_REGEXP
73 #define HAS_ST_GEN /* struct stat contains inode
74  * generation number */
75 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
76 #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
77 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
78 #define NATIVE_COMMAND_DIR "/usr/sbin"
79 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
80 #define HAS_DLOPEN
81 #endif
82 
83 #ifdef FREEBSD2
84 #define getsid(p) getpgrp()
85 #ifndef CMSG_SPACE
86 #define CMSG_SPACE(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len))
87 #endif
88 #ifndef CMSG_LEN
89 #define CMSG_LEN(len) (CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
90 #endif
91 #ifndef CMSG_ALIGN
92 #define CMSG_ALIGN(n) ALIGN(n)
93 #endif
94 #endif /* FREEBSD2 */
95 
96 #ifdef BSDI4
97 /* #define HAS_IPV6 find out interface lookup method */
98 #endif
99 
100 /* __FreeBSD_version version is major+minor */
101 
102 #if __FreeBSD_version >= 220000
103 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom" /* introduced 2.1.5 */
104 #endif
105 
106 #if __FreeBSD_version >= 300000
107 #define HAS_ISSETUGID
108 #define HAS_FUTIMES
109 #endif
110 
111 #if __FreeBSD_version >= 400000
112 #define SOCKADDR_SIZE socklen_t
113 #define SOCKOPT_SIZE socklen_t
114 #endif
115 
116 #if __FreeBSD_version >= 420000
117 #define HAS_DUPLEX_PIPE /* 4.1 breaks with kqueue(2) */
118 #endif
119 
120 #if (__FreeBSD_version >= 702104 && __FreeBSD_version <= 800000) \
121  || __FreeBSD_version >= 800100
122 #define HAS_CLOSEFROM
123 #endif
124 
125 /* OpenBSD version is year+month */
126 
127 #if OpenBSD >= 199805 /* XXX */
128 #define HAS_FUTIMES /* XXX maybe earlier */
129 #endif
130 
131 #if (defined(OpenBSD) && OpenBSD >= 199608)
132 #define PREFERRED_RAND_SOURCE "dev:/dev/arandom" /* XXX earlier */
133 #endif
134 
135 #if OpenBSD >= 200000 /* XXX */
136 #define HAS_ISSETUGID
137 #endif
138 
139 #if OpenBSD >= 200200 /* XXX */
140 #define SOCKADDR_SIZE socklen_t
141 #define SOCKOPT_SIZE socklen_t
142 #endif
143 
144 #if OpenBSD >= 200405 /* 3.5 */
145 #define HAS_CLOSEFROM
146 #endif
147 
148 /* __NetBSD_Version__ is major+minor */
149 
150 #if __NetBSD_Version__ >= 103000000 /* XXX maybe earlier */
151 #undef DEF_MAILBOX_LOCK
152 #define DEF_MAILBOX_LOCK "flock, dotlock"
153 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom" /* XXX maybe earlier */
154 #endif
155 
156 #if __NetBSD_Version__ >= 105000000
157 #define HAS_ISSETUGID /* XXX maybe earlier */
158 #endif
159 
160 #if __NetBSD_Version__ >= 106000000 /* XXX maybe earlier */
161 #define SOCKADDR_SIZE socklen_t
162 #define SOCKOPT_SIZE socklen_t
163 #endif
164 
165 #if __NetBSD_Version__ >= 299000900 /* 2.99.9 */
166 #define HAS_CLOSEFROM
167 #endif
168 
169 #if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 102000000)
170 #define HAS_FUTIMES
171 #endif
172 
173 #if defined(__DragonFly__)
174 #define HAS_DEV_URANDOM
175 #define HAS_ISSETUGID
176 #define HAS_FUTIMES
177 #define SOCKADDR_SIZE socklen_t
178 #define SOCKOPT_SIZE socklen_t
179 #define HAS_DUPLEX_PIPE
180 #endif
181 
182 #if (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 105000000) \
183  || (defined(__FreeBSD__) && __FreeBSD__ >= 4) \
184  || (defined(OpenBSD) && OpenBSD >= 200003) \
185  || defined(__DragonFly__) \
186  || defined(USAGI_LIBINET6)
187 #ifndef NO_IPV6
188 #define HAS_IPV6
189 #define HAVE_GETIFADDRS
190 #endif
191 
192 #if (defined(__FreeBSD_version) && __FreeBSD_version >= 300000) \
193  || (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 103000000) \
194  || (defined(OpenBSD) && OpenBSD >= 199700) /* OpenBSD 2.0?? */ \
195  || defined(__DragonFly__)
196 #define USE_SYSV_POLL
197 #endif
198 
199 #ifndef NO_KQUEUE
200 #if (defined(__FreeBSD_version) && __FreeBSD_version >= 410000) \
201  || (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 200000000) \
202  || (defined(OpenBSD) && OpenBSD >= 200105) /* OpenBSD 2.9 */ \
203  || defined(__DragonFly__)
204 #define EVENTS_STYLE EVENTS_STYLE_KQUEUE
205 #endif
206 #endif
207 
208 #ifndef NO_POSIX_GETPW_R
209 #if (defined(__FreeBSD_version) && __FreeBSD_version >= 510000) \
210  || (defined(__NetBSD_Version__) && __NetBSD_Version__ >= 300000000) \
211  || (defined(OpenBSD) && OpenBSD >= 200811) /* OpenBSD 4.4 */
212 #define HAVE_POSIX_GETPW_R
213 #endif
214 #endif
215 
216 #endif
217 
218  /*
219  * UNIX on MAC.
220  */
221 #if defined(RHAPSODY5) || defined(MACOSX)
222 #define SUPPORTED
223 #define UINT32_TYPE unsigned int
224 #define UINT16_TYPE unsigned short
225 #define USE_PATHS_H
226 #define HAS_FLOCK_LOCK
227 #define HAS_FCNTL_LOCK
228 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
229 #define DEF_MAILBOX_LOCK "flock, dotlock"
230 #define HAS_SUN_LEN
231 #define HAS_FSYNC
232 #define HAS_DB
233 #define HAS_SA_LEN
234 #define NATIVE_DB_TYPE "hash"
235 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
236 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
237 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin"
238 #define USE_STATFS
239 #define STATFS_IN_SYS_MOUNT_H
240 #define HAS_POSIX_REGEXP
241 #ifndef NO_NETINFO
242 #define HAS_NETINFO
243 #endif
244 #ifndef NO_IPV6
245 #define HAS_IPV6
246 #define HAVE_GETIFADDRS
247 #endif
248 #define HAS_FUTIMES /* XXX Guessing */
249 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
250 #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
251 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
252 #define NATIVE_COMMAND_DIR "/usr/sbin"
253 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
254 #define SOCKADDR_SIZE socklen_t
255 #define SOCKOPT_SIZE socklen_t
256 #ifndef NO_KQUEUE
257 #define EVENTS_STYLE EVENTS_STYLE_KQUEUE
258 #define USE_SYSV_POLL_THEN_SELECT
259 #endif
260 #define USE_MAX_FILES_PER_PROC
261 #ifndef NO_POSIX_GETPW_R
262 #define HAVE_POSIX_GETPW_R
263 #endif
264 #define HAS_DLOPEN
265 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom"
266 #endif
267 
268  /*
269  * Ultrix 4.x, a sort of 4.[1-2] BSD system with System V.2 compatibility
270  * and POSIX.
271  */
272 #ifdef ULTRIX4
273 #define SUPPORTED
274 #define UINT32_TYPE unsigned int
275 #define UINT16_TYPE unsigned short
276 /* Ultrix by default has only 64 descriptors per process */
277 #ifndef FD_SETSIZE
278 #define FD_SETSIZE 96
279 #endif
280 #define _PATH_MAILDIR "/var/spool/mail"
281 #define _PATH_BSHELL "/bin/sh"
282 #define _PATH_DEFPATH "/bin:/usr/bin:/usr/ucb"
283 #define _PATH_STDPATH "/bin:/usr/bin:/usr/etc:/usr/ucb"
284 #define HAS_FLOCK_LOCK
285 #define HAS_FCNTL_LOCK
286 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
287 #define DEF_MAILBOX_LOCK "flock, dotlock"
288 #define HAS_FSYNC
289 /* might be set by makedef */
290 #ifdef HAS_DB
291 #define NATIVE_DB_TYPE "hash"
292 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
293 #else
294 #define HAS_DBM
295 #define NATIVE_DB_TYPE "dbm"
296 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
297 #endif
298 extern int optind;
299 extern char *optarg;
300 extern int opterr;
301 extern int h_errno;
302 
303 #define MISSING_STRFTIME_E
304 #ifndef NO_NIS
305 #define HAS_NIS
306 #endif
307 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
308 #define ROOT_PATH "/bin:/usr/bin:/etc:/usr/etc:/usr/ucb"
309 #define USE_STATFS
310 #define USE_STRUCT_FS_DATA
311 #define STATFS_IN_SYS_MOUNT_H
312 /* Ultrix misses just S_ISSOCK, the others are there */
313 #define S_ISSOCK(mode) (((mode) & (S_IFMT)) == (S_IFSOCK))
314 #define DUP2_DUPS_CLOSE_ON_EXEC
315 #define MISSING_USLEEP
316 #define NO_HERRNO
317 #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
318 #define NATIVE_COMMAND_DIR "/usr/etc"
319 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
320 #endif
321 
322  /*
323  * OSF, then Digital UNIX, then Compaq. A BSD-flavored hybrid.
324  */
325 #ifdef OSF1
326 #define SUPPORTED
327 #define UINT32_TYPE unsigned int
328 #define UINT16_TYPE unsigned short
329 #define MISSING_SETENV
330 #define USE_PATHS_H
331 #define _PATH_DEFPATH "/usr/bin:/usr/ucb"
332 #define HAS_FLOCK_LOCK
333 #define HAS_FCNTL_LOCK
334 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
335 #define DEF_MAILBOX_LOCK "flock, dotlock"
336 #define HAS_FSYNC
337 #define HAVE_BASENAME
338 #define HAS_DBM
339 #define NATIVE_DB_TYPE "dbm"
340 #define ALIAS_DB_MAP DEF_DB_TYPE ":/var/adm/sendmail/aliases"
341 extern int optind; /* XXX use <getopt.h> */
342 extern char *optarg; /* XXX use <getopt.h> */
343 extern int opterr; /* XXX use <getopt.h> */
344 
345 #ifndef NO_NIS
346 #define HAS_NIS
347 #endif
348 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
349 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
350 #define USE_STATFS
351 #define STATFS_IN_SYS_MOUNT_H
352 #define HAS_POSIX_REGEXP
353 #define BROKEN_WRITE_SELECT_ON_NON_BLOCKING_PIPE
354 #define NO_MSGHDR_MSG_CONTROL
355 #ifndef NO_IPV6
356 #define HAS_IPV6
357 #endif
358 
359 #endif
360 
361  /*
362  * SunOS 4.x, a mostly 4.[2-3] BSD system with System V.2 compatibility and
363  * POSIX support.
364  */
365 #ifdef SUNOS4
366 #define SUPPORTED
367 #include <memory.h>
368 #define UINT32_TYPE unsigned int
369 #define UINT16_TYPE unsigned short
370 #define UNSAFE_CTYPE
371 #define fpos_t long
372 #define MISSING_SETENV
373 #define MISSING_STRERROR
374 #define MISSING_STRTOUL
375 #define _PATH_MAILDIR "/var/spool/mail"
376 #define _PATH_BSHELL "/bin/sh"
377 #define _PATH_DEFPATH "/usr/bin:/usr/ucb"
378 #define _PATH_STDPATH "/usr/bin:/usr/etc:/usr/ucb"
379 #define HAS_FLOCK_LOCK
380 #define HAS_FCNTL_LOCK
381 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
382 #define DEF_MAILBOX_LOCK "flock, dotlock"
383 #define HAS_FSYNC
384 #define HAS_DBM
385 #define NATIVE_DB_TYPE "dbm"
386 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
387 extern int optind;
388 extern char *optarg;
389 extern int opterr;
390 
391 #ifndef NO_NIS
392 #define HAS_NIS
393 #endif
394 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
395 #define ROOT_PATH "/bin:/usr/bin:/etc:/usr/etc:/usr/ucb"
396 #define USE_STATFS
397 #define STATFS_IN_SYS_VFS_H
398 #define memmove(d,s,l) bcopy(s,d,l)
399 #define NO_HERRNO
400 #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
401 #define NATIVE_MAILQ_PATH "/usr/ucb/mailq"
402 #define NATIVE_NEWALIAS_PATH "/usr/ucb/newaliases"
403 #define NATIVE_COMMAND_DIR "/usr/etc"
404 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
405 #define STRCASECMP_IN_STRINGS_H
406 #define OCTAL_TO_UNSIGNED(res, str) sscanf((str), "%o", &(res))
407 #define size_t unsigned
408 #define ssize_t int
409 #define getsid getpgrp
410 #define NO_SNPRINTF
411 #endif
412 
413  /*
414  * SunOS 5.x, mostly System V Release 4.
415  */
416 #ifdef SUNOS5
417 #define SUPPORTED
418 #define UINT32_TYPE unsigned int
419 #define UINT16_TYPE unsigned short
420 #define _PATH_MAILDIR "/var/mail"
421 #define _PATH_BSHELL "/bin/sh"
422 #define _PATH_DEFPATH "/usr/bin:/usr/ucb"
423 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
424 #define HAS_FCNTL_LOCK
425 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
426 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
427 #define HAS_FSYNC
428 #define HAS_DBM
429 #define NATIVE_DB_TYPE "dbm"
430 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases"
431 #ifndef NO_NIS
432 #define HAS_NIS
433 #ifndef NO_NISPLUS
434 #define HAS_NISPLUS
435 #endif /* NO_NISPLUS */
436 #endif
437 #define USE_SYS_SOCKIO_H /* Solaris 2.5, changed sys/ioctl.h */
438 #define GETTIMEOFDAY(t) gettimeofday(t)
439 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
440 #define FIONREAD_IN_SYS_FILIO_H
441 #define USE_STATVFS
442 #define STATVFS_IN_SYS_STATVFS_H
443 #define INT_MAX_IN_LIMITS_H
444 #ifdef STREAM_CONNECTIONS /* avoid UNIX-domain sockets */
445 #define LOCAL_LISTEN stream_listen
446 #define LOCAL_ACCEPT stream_accept
447 #define LOCAL_CONNECT stream_connect
448 #define LOCAL_TRIGGER stream_trigger
449 #define LOCAL_SEND_FD stream_send_fd
450 #define LOCAL_RECV_FD stream_recv_fd
451 #endif
452 #define HAS_VOLATILE_LOCKS
453 #define BROKEN_READ_SELECT_ON_TCP_SOCKET
454 #define CANT_WRITE_BEFORE_SENDING_FD
455 #ifndef NO_POSIX_REGEXP
456 #define HAS_POSIX_REGEXP
457 #endif
458 #ifndef NO_IPV6
459 #define HAS_IPV6
460 #define HAS_SIOCGLIF
461 #endif
462 #ifndef NO_CLOSEFROM
463 #define HAS_CLOSEFROM
464 #endif
465 #ifndef NO_DEV_URANDOM
466 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom"
467 #endif
468 #ifndef NO_FUTIMESAT
469 #define HAS_FUTIMESAT
470 #endif
471 #define USE_SYSV_POLL
472 #ifndef NO_DEVPOLL
473 #define EVENTS_STYLE EVENTS_STYLE_DEVPOLL
474 #endif
475 #ifndef NO_POSIX_GETPW_R
476 #define HAVE_POSIX_GETPW_R
477 #define GETPW_R_NEEDS_POSIX_PTHREAD_SEMANTICS
478 #endif
479 
480 /*
481  * Allow build environment to override paths.
482  */
483 #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
484 #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
485 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
486 #define NATIVE_COMMAND_DIR "/usr/sbin"
487 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
488 
489 #define HAS_DLOPEN
490 #endif
491 
492  /*
493  * UnixWare, System Release 4.
494  */
495 #ifdef UW7 /* UnixWare 7 */
496 #define SUPPORTED
497 #define UINT32_TYPE unsigned int
498 #define UINT16_TYPE unsigned short
499 #define _PATH_MAILDIR "/var/mail"
500 #define _PATH_BSHELL "/bin/sh"
501 #define _PATH_DEFPATH "/usr/bin:/usr/ucb"
502 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
503 #define MISSING_SETENV
504 #define HAS_FCNTL_LOCK
505 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
506 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
507 #define HAS_FSYNC
508 #define HAS_DBM
509 #define NATIVE_DB_TYPE "dbm"
510 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases"
511 #ifndef NO_NIS
512 #define HAS_NIS
513 #endif
514 #define USE_SYS_SOCKIO_H
515 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
516 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
517 #define FIONREAD_IN_SYS_FILIO_H
518 #define DBM_NO_TRAILING_NULL
519 #define USE_STATVFS
520 #define STATVFS_IN_SYS_STATVFS_H
521 #define STRCASECMP_IN_STRINGS_H
522 #define SET_H_ERRNO(err) (set_h_errno(err))
523 #endif
524 
525 #ifdef UW21 /* UnixWare 2.1.x */
526 #define SUPPORTED
527 #define UINT32_TYPE unsigned int
528 #define UINT16_TYPE unsigned short
529 #define _PATH_MAILDIR "/var/mail"
530 #define _PATH_BSHELL "/bin/sh"
531 #define _PATH_DEFPATH "/usr/bin:/usr/ucb"
532 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
533 #define MISSING_SETENV
534 #define HAS_FCNTL_LOCK
535 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
536 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
537 #define HAS_FSYNC
538 #define HAS_DBM
539 #define NATIVE_DB_TYPE "dbm"
540 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases"
541 #ifndef NO_NIS
542 #define HAS_NIS */
543 #endif
544 #define USE_SYS_SOCKIO_H
545 #define GETTIMEOFDAY(t) gettimeofday(t,NULL)
546 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
547 #define FIONREAD_IN_SYS_FILIO_H
548 #define DBM_NO_TRAILING_NULL
549 #define USE_STATVFS
550 #define STATVFS_IN_SYS_STATVFS_H
551 #endif
552 
553  /*
554  * AIX: a SYSV-flavored hybrid. NB: fcntl() and flock() access the same
555  * underlying locking primitives.
556  */
557 #if defined(AIX5) || defined(AIX6)
558 #define SUPPORTED
559 #define UINT32_TYPE unsigned int
560 #define UINT16_TYPE unsigned short
561 #define MISSING_SETENV
562 #define USE_PATHS_H
563 #ifndef _PATH_BSHELL
564 #define _PATH_BSHELL "/bin/sh"
565 #endif
566 #ifndef _PATH_MAILDIR
567 #define _PATH_MAILDIR "/var/spool/mail" /* paths.h lies */
568 #endif
569 #ifndef _PATH_DEFPATH
570 #define _PATH_DEFPATH "/usr/bin:/usr/ucb"
571 #endif
572 #ifndef _PATH_STDPATH
573 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
574 #endif
575 #define HAS_FCNTL_LOCK
576 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
577 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
578 #define USE_SYS_SELECT_H
579 #define HAS_FSYNC
580 #define HAS_DBM
581 #define NATIVE_DB_TYPE "dbm"
582 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
583 #ifndef NO_NIS
584 #define HAS_NIS
585 #endif
586 #define HAS_SA_LEN
587 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
588 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
589 #define SOCKADDR_SIZE socklen_t
590 #define SOCKOPT_SIZE socklen_t
591 #define USE_STATVFS
592 #define STATVFS_IN_SYS_STATVFS_H
593 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
594 #define NATIVE_MAILQ_PATH "/usr/sbin/mailq"
595 #define NATIVE_NEWALIAS_PATH "/usr/sbin/newaliases"
596 #define NATIVE_COMMAND_DIR "/usr/sbin"
597 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
598 
599  /*
600  * XXX Need CMSG_SPACE() and CMSG_LEN() but don't want to drag in everything
601  * that comes with _LINUX_SOURCE_COMPAT.
602  */
603 #include <sys/socket.h>
604 #ifndef CMSG_SPACE
605 #define CMSG_SPACE(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + _CMSG_ALIGN(len))
606 #endif
607 #ifndef CMSG_LEN
608 #define CMSG_LEN(len) (_CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
609 #endif
610 #ifndef NO_IPV6
611 #define HAS_IPV6
612 #endif
613 #define BROKEN_AI_PASSIVE_NULL_HOST
614 #define BROKEN_AI_NULL_SERVICE
615 #define USE_SYSV_POLL
616 #define MYMALLOC_FUZZ 1
617 #endif
618 
619 #ifdef AIX4
620 #define SUPPORTED
621 #define UINT32_TYPE unsigned int
622 #define UINT16_TYPE unsigned short
623 #define MISSING_SETENV
624 #define _PATH_BSHELL "/bin/sh"
625 #define _PATH_MAILDIR "/var/spool/mail" /* paths.h lies */
626 #define _PATH_DEFPATH "/usr/bin:/usr/ucb"
627 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
628 #define HAS_FCNTL_LOCK
629 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
630 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
631 #define USE_SYS_SELECT_H
632 #define HAS_FSYNC
633 #define HAS_DBM
634 #define NATIVE_DB_TYPE "dbm"
635 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
636 #ifndef NO_NIS
637 #define HAS_NIS
638 #endif
639 #define HAS_SA_LEN
640 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
641 #define RESOLVE_H_NEEDS_STDIO_H
642 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
643 #define SOCKADDR_SIZE size_t
644 #define SOCKOPT_SIZE size_t
645 #define USE_STATVFS
646 #define STATVFS_IN_SYS_STATVFS_H
647 #define STRCASECMP_IN_STRINGS_H
648 #if 0
649 extern time_t time(time_t *);
650 extern int seteuid(uid_t);
651 extern int setegid(gid_t);
652 extern int initgroups(const char *, int);
653 
654 #endif
655 #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
656 #define NATIVE_MAILQ_PATH "/usr/sbin/mailq"
657 #define NATIVE_NEWALIAS_PATH "/usr/sbin/newaliases"
658 #define NATIVE_COMMAND_DIR "/usr/sbin"
659 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
660 
661 #define CANT_USE_SEND_RECV_MSG
662 #endif
663 
664 #ifdef AIX3
665 #define SUPPORTED
666 #define UINT32_TYPE unsigned int
667 #define UINT16_TYPE unsigned short
668 #define MISSING_SETENV
669 #define _PATH_BSHELL "/bin/sh"
670 #define _PATH_MAILDIR "/var/spool/mail" /* paths.h lies */
671 #define _PATH_DEFPATH "/usr/bin:/usr/ucb"
672 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
673 #define HAS_FCNTL_LOCK
674 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
675 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
676 #define USE_SYS_SELECT_H
677 #define HAS_FSYNC
678 #define HAS_DBM
679 #define NATIVE_DB_TYPE "dbm"
680 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
681 #ifndef NO_NIS
682 #define HAS_NIS
683 #endif
684 #define HAS_SA_LEN
685 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
686 #define RESOLVE_H_NEEDS_STDIO_H
687 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
688 #define SOCKADDR_SIZE size_t
689 #define SOCKOPT_SIZE size_t
690 #define USE_STATFS
691 #define STATFS_IN_SYS_STATFS_H
692 #define STRCASECMP_IN_STRINGS_H
693 extern time_t time(time_t *);
694 extern int seteuid(uid_t);
695 extern int setegid(gid_t);
696 extern int initgroups(const char *, int);
697 
698 #define NATIVE_SENDMAIL_PATH "/usr/lib/sendmail"
699 
700 #define CANT_USE_SEND_RECV_MSG
701 #endif
702 
703  /*
704  * IRIX, a mix of System V Releases.
705  */
706 #if defined(IRIX5) || defined(IRIX6)
707 #define SUPPORTED
708 #define UINT32_TYPE unsigned int
709 #define UINT16_TYPE unsigned short
710 #define MISSING_SETENV
711 #define _PATH_MAILDIR "/var/mail"
712 #define _PATH_BSHELL "/bin/sh"
713 #define _PATH_DEFPATH "/usr/bin:/usr/bsd"
714 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/bsd"
715 #define HAS_FCNTL_LOCK
716 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
717 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
718 #define HAS_FSYNC
719 #define HAS_DBM
720 #define NATIVE_DB_TYPE "dbm"
721 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
722 #ifndef NO_NIS
723 #define HAS_NIS
724 #endif
725 #define USE_SYS_SOCKIO_H /* XXX check */
726 #define GETTIMEOFDAY(t) gettimeofday(t)
727 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/bsd"
728 #define FIONREAD_IN_SYS_FILIO_H /* XXX check */
729 #define DBM_NO_TRAILING_NULL /* XXX check */
730 #define USE_STATVFS
731 #define STATVFS_IN_SYS_STATVFS_H
732 #define BROKEN_WRITE_SELECT_ON_NON_BLOCKING_PIPE
733 #define CANT_USE_SEND_RECV_MSG
734 #endif
735 
736 #if defined(IRIX5)
737 #define MISSING_USLEEP
738 #endif
739 
740 #if defined(IRIX6)
741 #ifndef NO_IPV6
742 #define HAS_IPV6
743 #endif
744 #define HAS_POSIX_REGEXP
745 #define PIPES_CANT_FIONREAD
746 #endif
747 
748  /*
749  * LINUX.
750  */
751 #if defined(LINUX2) || defined(LINUX3) || defined(LINUX4)
752 #define SUPPORTED
753 #define UINT32_TYPE unsigned int
754 #define UINT16_TYPE unsigned short
755 #include <features.h>
756 #define USE_PATHS_H
757 #define HAS_FLOCK_LOCK
758 #define HAS_FCNTL_LOCK
759 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
760 #define DEF_MAILBOX_LOCK "fcntl, dotlock" /* RedHat >= 4.x */
761 #define HAS_FSYNC
762 #define HAS_DB
763 #define NATIVE_DB_TYPE "hash"
764 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
765 #ifndef NO_NIS
766 #define HAS_NIS
767 #endif
768 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
769 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin"
770 #define FIONREAD_IN_TERMIOS_H
771 #define USE_STATFS
772 #define STATFS_IN_SYS_VFS_H
773 #define PREPEND_PLUS_TO_OPTSTRING
774 #define HAS_POSIX_REGEXP
775 #define HAS_DLOPEN
776 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
777 #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
778 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
779 #define NATIVE_COMMAND_DIR "/usr/sbin"
780 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
781 #ifdef __GLIBC_PREREQ
782 #define HAVE_GLIBC_API_VERSION_SUPPORT(maj, min) __GLIBC_PREREQ(maj, min)
783 #else
784 #define HAVE_GLIBC_API_VERSION_SUPPORT(maj, min) \
785  (defined(__GLIBC__) && \
786  ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)))
787 #endif
788 #if HAVE_GLIBC_API_VERSION_SUPPORT(2, 1)
789 #define SOCKADDR_SIZE socklen_t
790 #define SOCKOPT_SIZE socklen_t
791 #else
792 #define NO_SNPRINTF
793 #endif
794 #ifndef NO_IPV6
795 #define HAS_IPV6
796 #if HAVE_GLIBC_API_VERSION_SUPPORT(2, 4)
797 /* Really 2.3.3 or later, but there's no __GLIBC_MICRO version macro. */
798 #define HAVE_GETIFADDRS
799 #else
800 #define HAS_PROCNET_IFINET6
801 #define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6"
802 #endif
803 #endif
804 #include <linux/version.h>
805 #if !defined(KERNEL_VERSION)
806 #define KERNEL_VERSION(a,b,c) (LINUX_VERSION_CODE + 1)
807 #endif
808 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) \
809  || (defined(__GLIBC__) && __GLIBC__ < 2)
810 #define CANT_USE_SEND_RECV_MSG
811 #define DEF_SMTP_CACHE_DEMAND 0
812 #else
813 #define CANT_WRITE_BEFORE_SENDING_FD
814 #endif
815 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom" /* introduced in 1.1 */
816 #ifndef NO_EPOLL
817 #define EVENTS_STYLE EVENTS_STYLE_EPOLL /* introduced in 2.5 */
818 #endif
819 #define USE_SYSV_POLL
820 #ifndef NO_POSIX_GETPW_R
821 #if (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 1) \
822  || (defined(_XOPEN_SOURCE) && _XOPEN_SOURCE >= 1) \
823  || (defined(_BSD_SOURCE) && _BSD_SOURCE >= 1) \
824  || (defined(_SVID_SOURCE) && _SVID_SOURCE >= 1) \
825  || (defined(_POSIX_SOURCE) && _POSIX_SOURCE >= 1)
826 #define HAVE_POSIX_GETPW_R
827 #endif
828 #endif
829 
830 #endif
831 
832 #ifdef LINUX1
833 #define SUPPORTED
834 #define UINT32_TYPE unsigned int
835 #define UINT16_TYPE unsigned short
836 #define USE_PATHS_H
837 #define HAS_FLOCK_LOCK
838 #define HAS_FCNTL_LOCK
839 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
840 #define DEF_MAILBOX_LOCK "dotlock" /* verified RedHat 3.03 */
841 #define HAS_FSYNC
842 #define HAS_DB
843 #define NATIVE_DB_TYPE "hash"
844 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
845 #ifndef NO_NIS
846 #define HAS_NIS
847 #endif
848 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
849 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin"
850 #define FIONREAD_IN_TERMIOS_H /* maybe unnecessary */
851 #define USE_STATFS
852 #define STATFS_IN_SYS_VFS_H
853 #define PREPEND_PLUS_TO_OPTSTRING
854 #define HAS_POSIX_REGEXP
855 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
856 #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
857 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
858 #define NATIVE_COMMAND_DIR "/usr/sbin"
859 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
860 #define CANT_USE_SEND_RECV_MSG
861 #define DEF_SMTP_CACHE_DEMAND 0
862 #endif
863 
864  /*
865  * GNU.
866  */
867 #ifdef GNU0
868 #define SUPPORTED
869 #include <features.h>
870 #define USE_PATHS_H
871 #define HAS_FCNTL_LOCK
872 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
873 #define DEF_MAILBOX_LOCK "fcntl, dotlock" /* RedHat >= 4.x */
874 #define HAS_FSYNC
875 #define HAS_DB
876 #define NATIVE_DB_TYPE "hash"
877 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
878 #ifndef NO_NIS
879 #define HAS_NIS
880 #endif
881 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
882 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin"
883 #define FIONREAD_IN_TERMIOS_H
884 #define USE_STATFS
885 #define STATFS_IN_SYS_VFS_H
886 #define UNIX_DOMAIN_CONNECT_BLOCKS_FOR_ACCEPT
887 #define PREPEND_PLUS_TO_OPTSTRING
888 #define HAS_POSIX_REGEXP
889 #define HAS_DLOPEN
890 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
891 #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
892 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
893 #define NATIVE_COMMAND_DIR "/usr/sbin"
894 #ifdef DEBIAN
895 #define NATIVE_DAEMON_DIR "/usr/lib/postfix"
896 #ifndef DEF_MANPAGE_DIR
897 #define DEF_MANPAGE_DIR "/usr/share/man"
898 #endif
899 #ifndef DEF_SAMPLE_DIR
900 #define DEF_SAMPLE_DIR "/usr/share/doc/postfix/examples"
901 #endif
902 #ifndef DEF_README_DIR
903 #define DEF_README_DIR "/usr/share/doc/postfix"
904 #endif
905 #else
906 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
907 #endif
908 #define SOCKADDR_SIZE socklen_t
909 #define SOCKOPT_SIZE socklen_t
910 #ifdef __FreeBSD_kernel__
911 #define HAS_DUPLEX_PIPE
912 #define HAS_ISSETUGID
913 #endif
914 #ifndef NO_IPV6
915 #define HAS_IPV6
916 #ifdef __FreeBSD_kernel__
917 #define HAVE_GETIFADDRS
918 #else
919 #define HAS_PROCNET_IFINET6
920 #define _PATH_PROCNET_IFINET6 "/proc/net/if_inet6"
921 #endif
922 #endif
923 #define CANT_USE_SEND_RECV_MSG
924 #define DEF_SMTP_CACHE_DEMAND 0
925 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom"
926 #endif
927 
928  /*
929  * HPUX11 was copied from HPUX10, but can perhaps be trimmed down a bit.
930  */
931 #ifdef HPUX11
932 #define SUPPORTED
933 #define USE_SIG_RETURN
934 #define UINT32_TYPE unsigned int
935 #define UINT16_TYPE unsigned short
936 #define HAS_DBM
937 #define HAS_FCNTL_LOCK
938 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
939 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
940 #define HAS_FSYNC
941 #define NATIVE_DB_TYPE "dbm"
942 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases"
943 #define ROOT_PATH "/usr/bin:/sbin:/usr/sbin"
944 #define MISSING_SETENV
945 #ifndef NO_NIS
946 #define HAS_NIS
947 #endif
948 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
949 #define _PATH_BSHELL "/bin/sh"
950 #define _PATH_MAILDIR "/var/mail"
951 #define _PATH_DEFPATH "/usr/bin"
952 #define _PATH_STDPATH "/usr/bin:/sbin:/usr/sbin"
953 #define MISSING_SETEUID
954 #define HAVE_SETRESUID
955 #define MISSING_SETEGID
956 #define HAVE_SETRESGID
957 extern int h_errno; /* <netdb.h> imports too much stuff */
958 
959 #define USE_STATFS
960 #define STATFS_IN_SYS_VFS_H
961 #define HAS_POSIX_REGEXP
962 #define HAS_DLOPEN
963 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
964 #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
965 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
966 #define NATIVE_COMMAND_DIR "/usr/sbin"
967 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
968 #endif
969 
970 #ifdef HPUX10
971 #define SUPPORTED
972 #define USE_SIG_RETURN
973 #define UINT32_TYPE unsigned int
974 #define UINT16_TYPE unsigned short
975 #define HAS_DBM
976 #define HAS_FCNTL_LOCK
977 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
978 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
979 #define HAS_FSYNC
980 #define NATIVE_DB_TYPE "dbm"
981 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases"
982 #define ROOT_PATH "/usr/bin:/sbin:/usr/sbin"
983 #define MISSING_SETENV
984 #ifndef NO_NIS
985 #define HAS_NIS
986 #endif
987 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
988 #define _PATH_BSHELL "/bin/sh"
989 #define _PATH_MAILDIR "/var/mail"
990 #define _PATH_DEFPATH "/usr/bin"
991 #define _PATH_STDPATH "/usr/bin:/sbin:/usr/sbin"
992 #define MISSING_SETEUID
993 #define HAVE_SETRESUID
994 #define MISSING_SETEGID
995 #define HAVE_SETRESGID
996 extern int h_errno; /* <netdb.h> imports too much stuff */
997 
998 #define USE_STATFS
999 #define STATFS_IN_SYS_VFS_H
1000 #define HAS_POSIX_REGEXP
1001 #define HAS_SHL_LOAD
1002 #define NATIVE_SENDMAIL_PATH "/usr/sbin/sendmail"
1003 #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
1004 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
1005 #define NATIVE_COMMAND_DIR "/usr/sbin"
1006 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
1007 #endif
1008 
1009 #ifdef HPUX9
1010 #define SUPPORTED
1011 #define USE_SIG_RETURN
1012 #define UINT32_TYPE unsigned int
1013 #define UINT16_TYPE unsigned short
1014 #define HAS_DBM
1015 #define HAS_FCNTL_LOCK
1016 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
1017 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
1018 #define HAS_FSYNC
1019 #ifndef NO_NIS
1020 #define HAS_NIS
1021 #endif
1022 #define MISSING_SETENV
1023 #define MISSING_RLIMIT_FSIZE
1024 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
1025 #define NATIVE_DB_TYPE "dbm"
1026 #define ALIAS_DB_MAP DEF_DB_TYPE ":/usr/lib/aliases"
1027 #define ROOT_PATH "/bin:/usr/bin:/etc"
1028 #define _PATH_BSHELL "/bin/sh"
1029 #define _PATH_MAILDIR "/usr/mail"
1030 #define _PATH_DEFPATH "/bin:/usr/bin"
1031 #define _PATH_STDPATH "/bin:/usr/bin:/etc"
1032 #define MISSING_SETEUID
1033 #define HAVE_SETRESUID
1034 #define MISSING_SETEGID
1035 #define HAVE_SETRESGID
1036 extern int h_errno;
1037 
1038 #define USE_ULIMIT /* no setrlimit() */
1039 #define USE_STATFS
1040 #define STATFS_IN_SYS_VFS_H
1041 #define HAS_POSIX_REGEXP
1042 #define HAS_SHL_LOAD
1043 #define NATIVE_SENDMAIL_PATH "/usr/bin/sendmail"
1044 #define NATIVE_MAILQ_PATH "/usr/bin/mailq"
1045 #define NATIVE_NEWALIAS_PATH "/usr/bin/newaliases"
1046 #define NATIVE_DAEMON_DIR "/usr/libexec/postfix"
1047 #endif
1048 
1049  /*
1050  * NEXTSTEP3, without -lposix, because its naming service is broken.
1051  */
1052 #ifdef NEXTSTEP3
1053 #define SUPPORTED
1054 #define UINT32_TYPE unsigned int
1055 #define UINT16_TYPE unsigned short
1056 #define HAS_DBM
1057 #define HAS_FLOCK_LOCK
1058 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
1059 #define DEF_MAILBOX_LOCK "flock, dotlock"
1060 #define USE_STATFS
1061 #define HAVE_SYS_DIR_H
1062 #define STATFS_IN_SYS_VFS_H
1063 #define HAS_FSYNC
1064 #ifndef NO_NIS
1065 #define HAS_NIS
1066 #endif
1067 #define HAS_NETINFO
1068 #define MISSING_SETENV_PUTENV
1069 #define MISSING_MKFIFO
1070 #define MISSING_SIGSET_T
1071 #define MISSING_SIGACTION
1072 #define MISSING_STD_FILENOS
1073 #define MISSING_SETSID
1074 #define MISSING_WAITPID
1075 #define MISSING_UTIMBUF
1076 #define HAS_WAIT4
1077 #define WAIT_STATUS_T union wait
1078 #define NORMAL_EXIT_STATUS(x) (WIFEXITED(x) && !WEXITSTATUS (x))
1079 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
1080 #define _PATH_MAILDIR "/usr/spool/mail"
1081 #define _PATH_BSHELL "/bin/sh"
1082 #define _PATH_DEFPATH "/bin:/usr/bin:/usr/ucb"
1083 #define _PATH_STDPATH "/bin:/usr/bin:/usr/ucb"
1084 #define ROOT_PATH "/bin:/usr/bin:/usr/etc:/usr/ucb"
1085 #define NATIVE_DB_TYPE "dbm"
1086 #define ALIAS_DB_MAP "netinfo:/aliases"
1087 #include <libc.h>
1088 #define MISSING_POSIX_S_IS
1089 #define MISSING_POSIX_S_MODES
1090 /* It's amazing what is all missing... */
1091 #define isascii(c) ((unsigned)(c)<=0177)
1092 extern int opterr;
1093 typedef unsigned short mode_t;
1094 
1095 #define MISSING_PID_T
1096 #define MISSING_STRFTIME_E
1097 #define FD_CLOEXEC 1
1098 #define O_NONBLOCK O_NDELAY
1099 #define WEXITSTATUS(x) ((x).w_retcode)
1100 #define WTERMSIG(x) ((x).w_termsig)
1101 #endif
1102 
1103  /*
1104  * OPENSTEP does not have posix (some fix...)
1105  */
1106 #ifdef OPENSTEP4
1107 #define SUPPORTED
1108 #define UINT32_TYPE unsigned int
1109 #define UINT16_TYPE unsigned short
1110 #define HAS_DBM
1111 #define HAS_FLOCK_LOCK
1112 #define INTERNAL_LOCK MYFLOCK_STYLE_FLOCK
1113 #define DEF_MAILBOX_LOCK "flock, dotlock"
1114 #define USE_STATFS
1115 #define HAVE_SYS_DIR_H
1116 #define STATFS_IN_SYS_VFS_H
1117 #define HAS_FSYNC
1118 #ifndef NO_NIS
1119 #define HAS_NIS
1120 #endif
1121 #define HAS_NETINFO
1122 #define MISSING_SETENV_PUTENV
1123 #define MISSING_MKFIFO
1124 #define MISSING_SIGSET_T
1125 #define MISSING_SIGACTION
1126 #define MISSING_STD_FILENOS
1127 #define MISSING_SETSID
1128 #define MISSING_WAITPID
1129 #define MISSING_UTIMBUF
1130 #define HAS_WAIT4
1131 #define WAIT_STATUS_T union wait
1132 #define NORMAL_EXIT_STATUS(x) (WIFEXITED(x) && !WEXITSTATUS (x))
1133 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
1134 #define _PATH_MAILDIR "/usr/spool/mail"
1135 #define _PATH_BSHELL "/bin/sh"
1136 #define _PATH_DEFPATH "/bin:/usr/bin:/usr/ucb"
1137 #define _PATH_STDPATH "/bin:/usr/bin:/usr/ucb"
1138 #define ROOT_PATH "/bin:/usr/bin:/usr/etc:/usr/ucb"
1139 #define NATIVE_DB_TYPE "dbm"
1140 #define ALIAS_DB_MAP "netinfo:/aliases"
1141 #include <libc.h>
1142 #define MISSING_POSIX_S_IS
1143 #define MISSING_POSIX_S_MODES
1144 /* It's amazing what is all missing... */
1145 #define isascii(c) ((unsigned)(c)<=0177)
1146 extern int opterr;
1147 typedef unsigned short mode_t;
1148 
1149 #define MISSING_PID_T
1150 #define MISSING_STRFTIME_E
1151 #define FD_CLOEXEC 1
1152 #define O_NONBLOCK O_NDELAY
1153 #define WEXITSTATUS(x) ((x).w_retcode)
1154 #define WTERMSIG(x) ((x).w_termsig)
1155 #endif
1156 
1157 #ifdef ReliantUnix543
1158 #define SUPPORTED
1159 #define UINT32_TYPE unsigned int
1160 #define UINT16_TYPE unsigned short
1161 #define MISSING_SETENV
1162 #define _PATH_DEFPATH "/usr/bin:/usr/ucb"
1163 #define _PATH_BSHELL "/bin/sh"
1164 #define _PATH_MAILDIR "/var/spool/mail"
1165 #define HAS_FCNTL_LOCK
1166 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
1167 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
1168 #define HAS_FSYNC
1169 #define FIONREAD_IN_SYS_FILIO_H
1170 #define USE_SYS_SOCKIO_H
1171 #define HAS_DBM
1172 #define NATIVE_DB_TYPE "dbm"
1173 #define ALIAS_DB_MAP DEF_DB_TYPE ":/var/adm/sendmail/aliases"
1174 extern int optind; /* XXX use <getopt.h> */
1175 extern char *optarg; /* XXX use <getopt.h> */
1176 extern int opterr; /* XXX use <getopt.h> */
1177 
1178 #ifndef NO_NIS
1179 #define HAS_NIS
1180 #endif
1181 #define GETTIMEOFDAY(t) gettimeofday(t)
1182 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
1183 #define USE_STATVFS
1184 #define STATVFS_IN_SYS_STATVFS_H
1185 #define MISSING_USLEEP
1186 #endif
1187 
1188 #ifdef DCOSX1 /* Siemens Pyramid */
1189 #define SUPPORTED
1190 #define UINT32_TYPE unsigned int
1191 #define UINT16_TYPE unsigned short
1192 #define _PATH_MAILDIR "/var/mail"
1193 #define _PATH_BSHELL "/bin/sh"
1194 #define _PATH_DEFPATH "/usr/bin:/usr/ucb"
1195 #define _PATH_STDPATH "/usr/bin:/usr/sbin:/usr/ucb"
1196 #define MISSING_SETENV
1197 #define HAS_FCNTL_LOCK
1198 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
1199 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
1200 #define HAS_FSYNC
1201 #define NATIVE_DB_TYPE "hash"
1202 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/aliases"
1203 /* Uncomment the following line if you have NIS package installed */
1204 /* #define HAS_NIS */
1205 #define USE_SYS_SOCKIO_H
1206 #define GETTIMEOFDAY(t) gettimeofday(t,NULL)
1207 #define ROOT_PATH "/bin:/usr/bin:/sbin:/usr/sbin:/usr/ucb"
1208 #define FIONREAD_IN_SYS_FILIO_H
1209 #define DBM_NO_TRAILING_NULL
1210 #define USE_STATVFS
1211 #define STATVFS_IN_SYS_STATVFS_H
1212 #ifndef S_ISSOCK
1213 #define S_ISSOCK(mode) ((mode&0xF000) == 0xC000)
1214 #endif
1215 #endif
1216 
1217 #ifdef SCO5
1218 #define SUPPORTED
1219 #include <sys/socket.h>
1220 extern int h_errno;
1221 
1222 #define UINT32_TYPE unsigned int
1223 #define UINT16_TYPE unsigned short
1224 #define _PATH_MAILDIR "/usr/spool/mail"
1225 #define _PATH_BSHELL "/bin/sh"
1226 #define _PATH_DEFPATH "/bin:/usr/bin"
1227 #define USE_PATHS_H
1228 #define HAS_FCNTL_LOCK
1229 #define INTERNAL_LOCK MYFLOCK_STYLE_FCNTL
1230 #define DEF_MAILBOX_LOCK "fcntl, dotlock"
1231 #define HAS_FSYNC
1232 #define HAS_DBM
1233 #define NATIVE_DB_TYPE "dbm"
1234 #define ALIAS_DB_MAP DEF_DB_TYPE ":/etc/mail/aliases"
1235 #define DBM_NO_TRAILING_NULL
1236 #ifndef NO_NIS
1237 #define HAS_NIS
1238 #endif
1239 #define GETTIMEOFDAY(t) gettimeofday(t,(struct timezone *) 0)
1240 #define ROOT_PATH "/bin:/etc:/usr/bin:/tcb/bin"
1241 #define USE_STATVFS
1242 #define STATVFS_IN_SYS_STATVFS_H
1243 #define MISSING_SETENV
1244 #define STRCASECMP_IN_STRINGS_H
1245 /* SCO5 misses just S_ISSOCK, the others are there
1246  * Use C_ISSOCK definition from cpio.h.
1247  */
1248 #include <cpio.h>
1249 #define S_ISSOCK(mode) (((mode) & (S_IFMT)) == (C_ISSOCK))
1250 #define CANT_USE_SEND_RECV_MSG
1251 #define DEF_SMTP_CACHE_DEMAND 0
1252 #endif
1253 
1254  /*
1255  * We're not going to try to guess like configure does.
1256  */
1257 #ifndef SUPPORTED
1258 #error "unsupported platform"
1259 #endif
1260 
1261  /*
1262  * Allow command line flags to override native settings
1263  */
1264 #ifndef DEF_COMMAND_DIR
1265 #ifdef NATIVE_COMMAND_DIR
1266 #define DEF_COMMAND_DIR NATIVE_COMMAND_DIR
1267 #endif
1268 #endif
1269 
1270 #ifndef DEF_DAEMON_DIR
1271 #ifdef NATIVE_DAEMON_DIR
1272 #define DEF_DAEMON_DIR NATIVE_DAEMON_DIR
1273 #endif
1274 #endif
1275 
1276 #ifndef DEF_SENDMAIL_PATH
1277 #ifdef NATIVE_SENDMAIL_PATH
1278 #define DEF_SENDMAIL_PATH NATIVE_SENDMAIL_PATH
1279 #endif
1280 #endif
1281 
1282 #ifndef DEF_MAILQ_PATH
1283 #ifdef NATIVE_MAILQ_PATH
1284 #define DEF_MAILQ_PATH NATIVE_MAILQ_PATH
1285 #endif
1286 #endif
1287 
1288 #ifndef DEF_NEWALIAS_PATH
1289 #ifdef NATIVE_NEWALIAS_PATH
1290 #define DEF_NEWALIAS_PATH NATIVE_NEWALIAS_PATH
1291 #endif
1292 #endif
1293 
1294 #ifndef DEF_DB_TYPE
1295 #define DEF_DB_TYPE NATIVE_DB_TYPE
1296 #endif
1297 
1298 #define CAST_ANY_PTR_TO_INT(cptr) ((int) (long) (cptr))
1299 #define CAST_INT_TO_VOID_PTR(ival) ((void *) (long) (ival))
1300 
1301 #ifdef DUP2_DUPS_CLOSE_ON_EXEC
1302 /* dup2_pass_on_exec() can be found in util/sys_compat.c */
1303 extern int dup2_pass_on_exec(int oldd, int newd);
1304 
1305 #define DUP2 dup2_pass_on_exec
1306 #else
1307 #define DUP2 dup2
1308 #endif
1309 
1310 #ifdef PREPEND_PLUS_TO_OPTSTRING
1311 #define GETOPT(argc, argv, str) getopt((argc), (argv), "+" str)
1312 #else
1313 #define GETOPT(argc, argv, str) getopt((argc), (argv), (str))
1314 #endif
1315 #define OPTIND (optind > 0 ? optind : 1)
1316 
1317  /*
1318  * Check for required but missing definitions.
1319  */
1320 #if !defined(HAS_FCNTL_LOCK) && !defined(HAS_FLOCK_LOCK)
1321 #error "define HAS_FCNTL_LOCK and/or HAS_FLOCK_LOCK"
1322 #endif
1323 
1324 #if !defined(DEF_MAILBOX_LOCK)
1325 #error "define DEF_MAILBOX_LOCK"
1326 #endif
1327 
1328 #if !defined(INTERNAL_LOCK)
1329 #error "define INTERNAL_LOCK"
1330 #endif
1331 
1332 #if defined(USE_STATFS) && defined(USE_STATVFS)
1333 #error "define USE_STATFS or USE_STATVFS, not both"
1334 #endif
1335 
1336 #if !defined(USE_STATFS) && !defined(USE_STATVFS)
1337 #error "define USE_STATFS or USE_STATVFS"
1338 #endif
1339 
1340  /*
1341  * Defaults for systems that pre-date IPv6 support.
1342  */
1343 #ifndef HAS_IPV6
1344 #include <sys/socket.h>
1345 #define EMULATE_IPV4_ADDRINFO
1346 #define MISSING_INET_PTON
1347 #define MISSING_INET_NTOP
1348 extern const char *inet_ntop(int, const void *, char *, SOCKADDR_SIZE);
1349 extern int inet_pton(int, const char *, void *);
1350 
1351 #endif
1352 
1353  /*
1354  * Workaround: after a watchdog alarm signal, wake up from select/poll/etc.
1355  * by writing to a pipe. Solaris needs this, and HP-UX apparently, too. The
1356  * run-time cost is negligible so we just turn it on for all systems. As a
1357  * side benefit, making this code system-independent will simplify the
1358  * detection of bit-rot problems.
1359  */
1360 #ifndef NO_WATCHDOG_PIPE
1361 #define USE_WATCHDOG_PIPE
1362 #endif
1363 
1364  /*
1365  * If we don't have defined a preferred random device above, but the system
1366  * has /dev/urandom, then we use that.
1367  */
1368 #if !defined(PREFERRED_RAND_SOURCE) && defined(HAS_DEV_URANDOM)
1369 #define PREFERRED_RAND_SOURCE "dev:/dev/urandom"
1370 #endif
1371 
1372  /*
1373  * Defaults for systems without kqueue, /dev/poll or epoll support.
1374  * master/multi-server.c and *qmgr/qmgr_transport.c depend on this.
1375  */
1376 #if !defined(EVENTS_STYLE)
1377 #define EVENTS_STYLE EVENTS_STYLE_SELECT
1378 #endif
1379 
1380 #define EVENTS_STYLE_SELECT 1 /* Traditional BSD select */
1381 #define EVENTS_STYLE_KQUEUE 2 /* FreeBSD kqueue */
1382 #define EVENTS_STYLE_DEVPOLL 3 /* Solaris /dev/poll */
1383 #define EVENTS_STYLE_EPOLL 4 /* Linux epoll */
1384 
1385  /*
1386  * We use poll() for read/write time limit enforcement on modern systems. We
1387  * use select() on historical systems without poll() support. And on systems
1388  * where poll() is not implemented for some file handle types, we try to use
1389  * select() as a fall-back solution (MacOS X needs this).
1390  */
1391 #if !defined(USE_SYSV_POLL) && !defined(USE_SYSV_POLL_THEN_SELECT)
1392 #define USE_BSD_SELECT
1393 #endif
1394 
1395  /*
1396  * The Postfix 2.9 post-install workaround assumes that the inet_protocols
1397  * default value is "ipv4" when Postfix is compiled without IPv6 support.
1398  */
1399 #ifndef DEF_INET_PROTOCOLS
1400 #ifdef HAS_IPV6
1401 #define DEF_INET_PROTOCOLS INET_PROTO_NAME_ALL
1402 #else
1403 #define DEF_INET_PROTOCOLS INET_PROTO_NAME_IPV4
1404 #endif
1405 #endif
1406 
1407  /*
1408  * Defaults for systems that pre-date POSIX socklen_t.
1409  */
1410 #ifndef SOCKADDR_SIZE
1411 #define SOCKADDR_SIZE int
1412 #endif
1413 
1414 #ifndef SOCKOPT_SIZE
1415 #define SOCKOPT_SIZE int
1416 #endif
1417 
1418  /*
1419  * Defaults for normal systems.
1420  */
1421 #ifndef LOCAL_LISTEN
1422 #define LOCAL_LISTEN unix_listen
1423 #define LOCAL_ACCEPT unix_accept
1424 #define LOCAL_CONNECT unix_connect
1425 #define LOCAL_TRIGGER unix_trigger
1426 #define LOCAL_SEND_FD unix_send_fd
1427 #define LOCAL_RECV_FD unix_recv_fd
1428 #endif
1429 
1430 #if !defined (HAVE_SYS_NDIR_H) && !defined (HAVE_SYS_DIR_H) \
1431  && !defined (HAVE_NDIR_H)
1432 #define HAVE_DIRENT_H
1433 #endif
1434 
1435 #ifndef WAIT_STATUS_T
1436 typedef int WAIT_STATUS_T;
1437 
1438 #define NORMAL_EXIT_STATUS(status) ((status) == 0)
1439 #endif
1440 
1441 #ifdef NO_POSIX_GETPW_R
1442 #undef HAVE_POSIX_GETPW_R
1443 #endif
1444 
1445 #ifdef NO_DB
1446 #undef HAS_DB
1447 #endif
1448 
1449 #ifndef OCTAL_TO_UNSIGNED
1450 #define OCTAL_TO_UNSIGNED(res, str) ((res) = strtoul((str), (char **) 0, 8))
1451 #endif
1452 
1453  /*
1454  * Avoid useless type mis-matches when using sizeof in an integer context.
1455  */
1456 #define INT_SIZEOF(foo) ((int) sizeof(foo))
1457 
1458  /*
1459  * Turn on the compatibility stuff.
1460  */
1461 #ifdef MISSING_UTIMBUF
1462 struct utimbuf {
1463  time_t actime;
1464  time_t modtime;
1465 };
1466 
1467 #endif
1468 
1469 #ifdef MISSING_STRERROR
1470 extern const char *strerror(int);
1471 
1472 #endif
1473 
1474 #if defined (MISSING_SETENV) || defined (MISSING_SETENV_PUTENV)
1475 extern int setenv(const char *, const char *, int);
1476 
1477 #endif
1478 
1479 #ifdef MISSING_SETEUID
1480 extern int seteuid(uid_t euid);
1481 
1482 #endif
1483 
1484 #ifdef MISSING_SETEGID
1485 extern int setegid(gid_t egid);
1486 
1487 #endif
1488 
1489 #ifdef MISSING_MKFIFO
1490 extern int mkfifo(char *, int);
1491 
1492 #endif
1493 
1494 #ifdef MISSING_WAITPID
1495 extern int waitpid(int, WAIT_STATUS_T *status, int options);
1496 
1497 #endif
1498 
1499 #ifdef MISSING_SETSID
1500 extern int setsid(void);
1501 
1502 #endif
1503 
1504 #ifndef HAS_CLOSEFROM
1505 extern int closefrom(int);
1506 
1507 #endif
1508 
1509 #ifdef MISSING_STD_FILENOS
1510 #define STDIN_FILENO 0
1511 #define STDOUT_FILENO 1
1512 #define STDERR_FILENO 2
1513 #endif
1514 
1515 #ifdef MISSING_PID_T
1516 typedef int pid_t;
1517 
1518 #endif
1519 
1520 #ifdef MISSING_POSIX_S_IS
1521 #define S_ISBLK(mode) (((mode) & (_S_IFMT)) == (_S_IFBLK))
1522 #define S_ISCHR(mode) (((mode) & (_S_IFMT)) == (_S_IFCHR))
1523 #define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR))
1524 #define S_ISSOCK(mode) (((mode) & (_S_IFMT)) == (_S_IFSOCK))
1525 #define S_ISFIFO(mode) (((mode) & (_S_IFMT)) == (_S_IFIFO))
1526 #define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG))
1527 #define S_ISLNK(mode) (((mode) & (_S_IFMT)) == (_S_IFLNK))
1528 #endif
1529 
1530 #ifdef MISSING_POSIX_S_MODES
1531 #define S_IRUSR _S_IRUSR
1532 #define S_IRGRP 0000040
1533 #define S_IROTH 0000004
1534 #define S_IWUSR _S_IWUSR
1535 #define S_IWGRP 0000020
1536 #define S_IWOTH 0000002
1537 #define S_IXUSR _S_IXUSR
1538 #define S_IXGRP 0000010
1539 #define S_IXOTH 0000001
1540 #define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR)
1541 #endif
1542 
1543  /*
1544  * Memory alignment of memory allocator results. By default we align for
1545  * doubles.
1546  */
1547 #ifndef ALIGN_TYPE
1548 #if defined(__hpux) && defined(__ia64)
1549 #define ALIGN_TYPE __float80
1550 #elif defined(__ia64__)
1551 #define ALIGN_TYPE long double
1552 #else
1553 #define ALIGN_TYPE double
1554 #endif
1555 #endif
1556 
1557  /*
1558  * Clang-style attribute tests.
1559  *
1560  * XXX Without the unconditional test below, gcc 4.6 will barf on ``elif
1561  * defined(__clang__) && __has_attribute(__whatever__)'' with error message
1562  * ``missing binary operator before token "("''.
1563  */
1564 #ifndef __has_attribute
1565 #define __has_attribute(x) 0
1566 #endif /* __has_attribute */
1567 
1568  /*
1569  * Need to specify what functions never return, so that the compiler can
1570  * warn for missing initializations and other trouble. However, OPENSTEP4
1571  * gcc 2.7.x cannot handle this so we define this only if NORETURN isn't
1572  * already defined above.
1573  *
1574  * Data point: gcc 2.7.2 has __attribute__ (Wietse Venema) but gcc 2.6.3 does
1575  * not (Clive Jones). So we'll set the threshold at 2.7.
1576  */
1577 #ifndef NORETURN
1578 #if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ >= 3
1579 #define NORETURN void __attribute__((__noreturn__))
1580 #elif defined(__clang__) && __has_attribute(__noreturn__)
1581 #define NORETURN void __attribute__((__noreturn__))
1582 #else
1583 #define NORETURN void
1584 #endif
1585 #endif /* NORETURN */
1586 
1587  /*
1588  * Turn on format string argument checking. This is more accurate than
1589  * printfck, but it misses #ifdef-ed code. XXX I am just guessing at what
1590  * gcc versions support this. In order to turn this off for some platforms,
1591  * specify #define PRINTFLIKE and #define SCANFLIKE in the system-dependent
1592  * sections above.
1593  */
1594 #ifndef PRINTFLIKE
1595 #if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ >= 3
1596 #define PRINTFLIKE(x,y) __attribute__ ((format (printf, (x), (y))))
1597 #elif defined(__clang__) && __has_attribute(__format__)
1598 #define PRINTFLIKE(x,y) __attribute__ ((__format__ (__printf__, (x), (y))))
1599 #else
1600 #define PRINTFLIKE(x,y)
1601 #endif
1602 #endif /* PRINTFLIKE */
1603 
1604 #ifndef SCANFLIKE
1605 #if (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || __GNUC__ >= 3
1606 #define SCANFLIKE(x,y) __attribute__ ((format (scanf, (x), (y))))
1607 #elif defined(__clang__) && __has_attribute(__format__)
1608 #define SCANFLIKE(x,y) __attribute__ ((__format__ (__scanf__, (x), (y))))
1609 #else
1610 #define SCANFLIKE(x,y)
1611 #endif
1612 #endif /* SCANFLIKE */
1613 
1614  /*
1615  * Some gcc implementations don't grok these attributes with pointer to
1616  * function. Again, wild guess of what is supported. To override, specify
1617  * #define PRINTFPTRLIKE in the system-dependent sections above.
1618  */
1619 #ifndef PRINTFPTRLIKE
1620 #if (__GNUC__ >= 3) /* XXX Rough estimate */
1621 #define PRINTFPTRLIKE(x,y) PRINTFLIKE(x,y)
1622 #elif defined(__clang__) && __has_attribute(__format__)
1623 #define PRINTFPTRLIKE(x,y) __attribute__ ((__format__ (__printf__, (x), (y))))
1624 #else
1625 #define PRINTFPTRLIKE(x,y)
1626 #endif
1627 #endif
1628 
1629  /*
1630  * Compiler optimization hint. This makes sense only for code in a
1631  * performance-critical loop.
1632  */
1633 #ifndef EXPECTED
1634 #if defined(__GNUC__) && (__GNUC__ > 2)
1635 #define EXPECTED(x) __builtin_expect(!!(x), 1)
1636 #define UNEXPECTED(x) __builtin_expect(!!(x), 0)
1637 #else
1638 #define EXPECTED(x) (x)
1639 #define UNEXPECTED(x) (x)
1640 #endif
1641 #endif
1642 
1643  /*
1644  * Warn about ignored function result values that must never be ignored.
1645  * Typically, this is for error results from "read" functions that normally
1646  * write to output parameters (for example, stat- or scanf-like functions)
1647  * or from functions that have other useful side effects (for example,
1648  * fseek- or rename-like functions).
1649  *
1650  * DO NOT use this for functions that write to a stream; it is entirely
1651  * legitimate to detect write errors with fflush() or fclose() only. On the
1652  * other hand most (but not all) functions that read from a stream must
1653  * never ignore result values.
1654  *
1655  * XXX Prepending "(void)" won't shut up GCC. Clang behaves as expected.
1656  */
1657 #if ((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ > 3)
1658 #define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
1659 #elif defined(__clang__) && __has_attribute(warn_unused_result)
1660 #define WARN_UNUSED_RESULT __attribute__((warn_unused_result))
1661 #else
1662 #define WARN_UNUSED_RESULT
1663 #endif
1664 
1665  /*
1666  * ISO C says that the "volatile" qualifier protects against optimizations
1667  * that cause longjmp() to clobber local variables.
1668  */
1669 #ifndef NOCLOBBER
1670 #define NOCLOBBER volatile
1671 #endif
1672 
1673  /*
1674  * Bit banging!! There is no official constant that defines the INT_MAX
1675  * equivalent for off_t, ssize_t, etc. Wietse came up with the following
1676  * macro that works as long as off_t, ssize_t, etc. use one's or two's
1677  * complement logic (that is, the maximum value is binary 01...1). Don't
1678  * use right-shift for signed types: the result is implementation-defined.
1679  */
1680 #include <limits.h>
1681 #define __MAXINT__(T) ((T) ~(((T) 1) << ((sizeof(T) * CHAR_BIT) - 1)))
1682 #ifndef OFF_T_MAX
1683 #define OFF_T_MAX __MAXINT__(off_t)
1684 #endif
1685 
1686 #ifndef SSIZE_T_MAX
1687 #define SSIZE_T_MAX __MAXINT__(ssize_t)
1688 #endif
1689 
1690  /*
1691  * Setting globals like h_errno can be problematic when Postfix is linked
1692  * with multi-threaded libraries.
1693  */
1694 #ifndef SET_H_ERRNO
1695 #define SET_H_ERRNO(err) (h_errno = (err))
1696 #endif
1697 
1698  /*
1699  * Don't mix socket message send/receive calls with socket stream read/write
1700  * calls. The fact that you can get away with it only on some stacks implies
1701  * that there is no long-term guarantee.
1702  */
1703 #ifndef CAN_WRITE_BEFORE_SENDING_FD
1704 #define CANT_WRITE_BEFORE_SENDING_FD
1705 #endif
1706 
1707  /*
1708  * FreeBSD sendmsg(2) says that after sending a file descriptor, the sender
1709  * must not immediately close the descriptor, otherwise it may close the
1710  * descriptor before it is actually sent.
1711  */
1712 #ifndef DONT_WAIT_AFTER_SENDING_FD
1713 #define MUST_READ_AFTER_SENDING_FD
1714 #endif
1715 
1716  /*
1717  * Hope for the best.
1718  */
1719 #ifndef UINT32_TYPE
1720 #define UINT32_TYPE uint32_t
1721 #define UINT16_TYPE uint16_t
1722 #endif
1723 #define UINT32_SIZE 4
1724 #define UINT16_SIZE 2
1725 
1726  /*
1727  * For the sake of clarity.
1728  */
1729 #ifndef HAVE_CONST_CHAR_STAR
1730 typedef const char *CONST_CHAR_STAR;
1731 
1732 #endif
1733 
1734  /*
1735  * Safety. On some systems, ctype.h misbehaves with non-ASCII or negative
1736  * characters. More importantly, Postfix uses the ISXXX() macros to ensure
1737  * protocol compliance, so we have to rule out non-ASCII characters.
1738  *
1739  * XXX The (unsigned char) casts in isalnum() etc arguments are unnecessary
1740  * because the ISASCII() guard already ensures that the values are
1741  * non-negative; the casts are done anyway to shut up chatty compilers.
1742  */
1743 #define ISASCII(c) isascii(_UCHAR_(c))
1744 #define _UCHAR_(c) ((unsigned char)(c))
1745 #define ISALNUM(c) (ISASCII(c) && isalnum((unsigned char)(c)))
1746 #define ISALPHA(c) (ISASCII(c) && isalpha((unsigned char)(c)))
1747 #define ISCNTRL(c) (ISASCII(c) && iscntrl((unsigned char)(c)))
1748 #define ISDIGIT(c) (ISASCII(c) && isdigit((unsigned char)(c)))
1749 #define ISGRAPH(c) (ISASCII(c) && isgraph((unsigned char)(c)))
1750 #define ISLOWER(c) (ISASCII(c) && islower((unsigned char)(c)))
1751 #define ISPRINT(c) (ISASCII(c) && isprint((unsigned char)(c)))
1752 #define ISPUNCT(c) (ISASCII(c) && ispunct((unsigned char)(c)))
1753 #define ISSPACE(c) (ISASCII(c) && isspace((unsigned char)(c)))
1754 #define ISUPPER(c) (ISASCII(c) && isupper((unsigned char)(c)))
1755 #define TOLOWER(c) (ISUPPER(c) ? tolower((unsigned char)(c)) : (c))
1756 #define TOUPPER(c) (ISLOWER(c) ? toupper((unsigned char)(c)) : (c))
1757 
1758  /*
1759  * Character sets for parsing.
1760  */
1761 #define CHARS_COMMA_SP ", \t\r\n" /* list separator */
1762 #define CHARS_SPACE " \t\r\n" /* word separator */
1763 #define CHARS_BRACE "{}" /* grouping */
1764 
1765  /*
1766  * Scaffolding. I don't want to lose messages while the program is under
1767  * development.
1768  */
1769 extern int REMOVE(const char *);
1770 
1771 /* LICENSE
1772 /* .ad
1773 /* .fi
1774 /* The Secure Mailer license must be distributed with this software.
1775 /* AUTHOR(S)
1776 /* Wietse Venema
1777 /* IBM T.J. Watson Research
1778 /* P.O. Box 704
1779 /* Yorktown Heights, NY 10598, USA
1780 /*
1781 /* Wietse Venema
1782 /* Google, Inc.
1783 /* 111 8th Avenue
1784 /* New York, NY 10011, USA
1785 /*--*/
1786 
1787 #endif
#define SOCKADDR_SIZE
Definition: sys_defs.h:1411
int REMOVE(const char *)
Definition: remove.c:52
int inet_pton(int, const char *, void *)
Definition: sys_compat.c:368
int closefrom(int)
Definition: sys_compat.c:289
const char * inet_ntop(int, const void *, char *, SOCKADDR_SIZE)
Definition: sys_compat.c:325
const char * CONST_CHAR_STAR
Definition: sys_defs.h:1730
int WAIT_STATUS_T
Definition: sys_defs.h:1436