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