From b721bebe663ca3abc747591b28726a367bdb9758 Mon Sep 17 00:00:00 2001 From: JP Date: Mon, 21 Sep 2015 22:52:46 +0000 Subject: erts: Fix sendfile:ing of large files on FreeBSD If the file was larger than the OS send buffer the call would fail before this patch. --- erts/emulator/drivers/unix/unix_efile.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'erts/emulator/drivers/unix/unix_efile.c') diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c index 06ba986044..61148dd58d 100644 --- a/erts/emulator/drivers/unix/unix_efile.c +++ b/erts/emulator/drivers/unix/unix_efile.c @@ -39,6 +39,11 @@ #ifdef HAVE_SYS_UIO_H #include #include +#if defined(HAVE_SENDFILE) && (defined(__FreeBSD__) || defined(__DragonFly__)) +/* Need to define __BSD_VISIBLE in order to expose prototype of sendfile */ +#define __BSD_VISIBLE 1 +#include +#endif #endif #if defined(HAVE_SENDFILE) && (defined(__linux__) || (defined(__sun) && defined(__SVR4))) #include -- cgit v1.2.3