aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers
diff options
context:
space:
mode:
authorJP <[email protected]>2015-09-21 22:52:46 +0000
committerLukas Larsson <[email protected]>2016-01-27 11:46:09 +0100
commitb721bebe663ca3abc747591b28726a367bdb9758 (patch)
tree5188c70d3a826dce2694a74b47deb8e0ee68884a /erts/emulator/drivers
parent59911612aec5f18b099dbc518089dd3ce48fdd97 (diff)
downloadotp-b721bebe663ca3abc747591b28726a367bdb9758.tar.gz
otp-b721bebe663ca3abc747591b28726a367bdb9758.tar.bz2
otp-b721bebe663ca3abc747591b28726a367bdb9758.zip
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.
Diffstat (limited to 'erts/emulator/drivers')
-rw-r--r--erts/emulator/drivers/unix/unix_efile.c5
1 files changed, 5 insertions, 0 deletions
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 <sys/types.h>
#include <sys/uio.h>
+#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 <sys/socket.h>
+#endif
#endif
#if defined(HAVE_SENDFILE) && (defined(__linux__) || (defined(__sun) && defined(__SVR4)))
#include <sys/sendfile.h>