Use compressed form of ipv6 in $sender_host_address under -bh. Bug 3027
[exim.git] / src / OS / os.h-FreeBSD
1 /* Exim: OS-specific C header file for FreeBSD */
2 /* Copyright (c) University of Cambridge 1995 - 2018 */
3 /* Copyright (c) The Exim Maintainers 2020 - 2021 */
4 /* SPDX-License-Identifier: GPL-2.0-or-later */
5 /* See the file NOTICE for conditions of use and distribution. */
6
7
8 #include <sys/types.h>
9 #include <sys/param.h>
10
11 #define HAVE_BSD_GETLOADAVG
12 #define HAVE_SETCLASSRESOURCES
13 #define HAVE_MMAP
14 #define HAVE_SYS_MOUNT_H
15 #define HAVE_GETIFADDRS
16 #define SIOCGIFCONF_GIVES_ADDR
17 #define HAVE_SRANDOMDEV
18 #define HAVE_ARC4RANDOM
19 #define EXIM_HAVE_OPENAT
20 #define EXIM_HAVE_FUTIMENS
21
22 /* Applications should not call arc4random_stir() explicitly after
23  * FreeBSD r227520 (approximately 1000002).
24  * Set NOT_HAVE_ARC4RANDOM_STIR if the version released is past
25  * that point. */
26 #if __FreeBSD_version >= 1000002
27 # define NOT_HAVE_ARC4RANDOM_STIR
28 #endif
29
30 typedef struct flock flock_t;
31
32 /* iconv arg2 type: libiconv in Ports uses "const char* * inbuf" and was
33  * traditionally the only approach available.  The iconv functionality
34  * in libc is "char ** restrict src".
35  *
36  * <https://www.freebsd.org/doc/en/books/porters-handbook/using-iconv.html>
37  * says that libc has iconv since 2013, in 10-CURRENT.  FreeBSD man-pages
38  * shows it included in 10.0-RELEASE.  Writing this in 2017, 10.3 is the
39  * oldest supported release, so we should assume non-libiconv by default.
40  * (Actually, people still using old releases past EOL; we shouldn't support
41  * them but I don't want to deal with howls of complaints because we dare
42  * to not support the unsupported, so guard this on FreeBSD 10+)
43  *
44  * Thus we no longer override iconv.
45  *
46  * However, if libiconv is installed, and anything adds /usr/local/include
47  * to include-path (likely) then we'll get that.  So define a variable
48  * which makes the libiconv try to not interfere with OS iconv.
49  */
50 #if __FreeBSD__ >= 10
51 # define LIBICONV_PLUG
52 #endif
53 /* for more specific version constraints, look at __FreeBSD_version
54  * from <sys/param.h> */
55
56 /* When using DKIM, setting OS_SENDFILE can increase
57 performance on outgoing mail a bit. */
58
59 #define OS_SENDFILE
60 extern ssize_t os_sendfile(int, int, off_t *, size_t);
61
62 #ifdef PID_T_FMT
63 # undef PID_T_FMT
64 #endif
65 #define PID_T_FMT "%d"
66
67
68 /*******************/
69
70 #define EXIM_TFO_PROBE
71 #define EXIM_TFO_FREEBSD
72
73
74 /* for TCP state-variable values, for TFO logging */
75 #include <netinet/tcp_fsm.h>
76 #define TCP_SYN_RECV TCPS_SYN_RECEIVED
77
78 /*******************/
79
80 #define EXIM_HAVE_KEVENT
81 #define EXIM_HAVE_STRCHRNUL
82
83
84 /* End */