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