Merge branch 'master' into 4.next
[exim.git] / src / OS / os.h-FreeBSD
CommitLineData
61ec970d 1/* Exim: OS-specific C header file for FreeBSD */
9242a7e8
JH
2/* Copyright (c) University of Cambridge 2017 */
3/* See the file NOTICE for conditions of use and distribution. */
4
61ec970d 5
7d758a6a
JH
6#include <sys/types.h>
7
61ec970d 8#define HAVE_BSD_GETLOADAVG
79378e0f 9#define HAVE_SETCLASSRESOURCES
61ec970d
PH
10#define HAVE_MMAP
11#define HAVE_SYS_MOUNT_H
12#define SIOCGIFCONF_GIVES_ADDR
0eb8eedd
NM
13#define HAVE_SRANDOMDEV
14#define HAVE_ARC4RANDOM
61ec970d
PH
15
16typedef struct flock flock_t;
17
863bd541
PP
18/* iconv arg2 type: libiconv in Ports uses "const char* * inbuf" and was
19 * traditionally the only approach available. The iconv functionality
20 * in libc is "char ** restrict src".
21 *
22 * <https://www.freebsd.org/doc/en/books/porters-handbook/using-iconv.html>
23 * says that libc has iconv since 2013, in 10-CURRENT. FreeBSD man-pages
24 * shows it included in 10.0-RELEASE. Writing this in 2017, 10.3 is the
25 * oldest supported release, so we should assume non-libiconv by default.
852e25c5
PP
26 * (Actually, people still using old releases past EOL; we shouldn't support
27 * them but I don't want to deal with howls of complaints because we dare
28 * to not support the unsupported, so guard this on FreeBSD 10+)
863bd541
PP
29 *
30 * Thus we no longer override iconv.
31 *
32 * However, if libiconv is installed, and anything adds /usr/local/include
33 * to include-path (likely) then we'll get that. So define a variable
34 * which makes the libiconv try to not interfere with OS iconv.
35 */
852e25c5
PP
36#if __FreeBSD__ >= 10
37# define LIBICONV_PLUG
38#endif
39/* for more specific version constraints, include <sys/param.h> and look at
40 * __FreeBSD_version */
9c19b270 41
7d758a6a
JH
42
43/* When using DKIM, setting OS_SENDFILE can increase
44performance on outgoing mail a bit. */
45
46#define OS_SENDFILE
47extern ssize_t os_sendfile(int, int, off_t *, size_t);
48
a2673768
JH
49
50/*******************/
51
52/* TCP_FASTOPEN support. There does not seems to be a
53MSG_FASTOPEN defined yet... */
10ac8d7f 54#define EXIM_TFO_PROBE
a2673768
JH
55
56#include <netinet/tcp.h> /* for TCP_FASTOPEN */
57#include <sys/socket.h> /* for MSG_FASTOPEN */
58#if defined(TCP_FASTOPEN) && !defined(MSG_FASTOPEN)
59# define MSG_FASTOPEN 0x20000000
60#endif
61
62/* for TCP state-variable values, for TFO logging */
63#include <netinet/tcp_fsm.h>
64#define TCP_SYN_RECV TCPS_SYN_RECEIVED
65
66/*******************/
67
61ec970d 68/* End */