1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) Jeremy Harris 1995 - 2020 */
6 /* Copyright (c) The Exim Maintainers 2021 */
7 /* See the file NOTICE for conditions of use and distribution. */
9 /* FreeBSD-specific code. This is concatenated onto the generic
18 os_sendfile(int out, int in, off_t * offp, size_t cnt)
20 off_t loff = offp ? *offp : 0;
23 if (sendfile(in, out, loff, cnt, NULL, &written, 0) < 0) return (ssize_t)-1;
24 if (offp) *offp = loff + written;
25 return (ssize_t)written;
28 /*************************************************
29 TCP Fast Open: check that the ioctl is accepted
30 *************************************************/
32 #ifndef COMPILE_UTILITY
39 if ( (sock = socket(AF_INET, SOCK_STREAM, 0)) >= 0
40 && setsockopt(sock, IPPROTO_TCP, TCP_FASTOPEN, &on, sizeof(on) >= 0)
42 f.tcp_fastopen_ok = TRUE;
49 /* End of os.c-Linux */