aboutsummaryrefslogtreecommitdiffstats
path: root/erts/configure.in
diff options
context:
space:
mode:
authorTuncer Ayaz <[email protected]>2011-01-13 12:36:14 +0100
committerLukas Larsson <[email protected]>2011-11-29 14:30:35 +0100
commit195e1f19b06095f39a4fb0da46dfab2ec5b10e9a (patch)
tree8f4a8c587b72c3a20d18b4cb6ccd7d1d52eb6286 /erts/configure.in
parent7292c3d9f5285592aa4de996f6f106cd365d7895 (diff)
downloadotp-195e1f19b06095f39a4fb0da46dfab2ec5b10e9a.tar.gz
otp-195e1f19b06095f39a4fb0da46dfab2ec5b10e9a.tar.bz2
otp-195e1f19b06095f39a4fb0da46dfab2ec5b10e9a.zip
Implement file:sendfile
Allow Erlang code to use sendfile() where available by wrapping it as file:sendfile/4 and file:sendfile/2. sendfile(2) - Linux man page: "sendfile() copies data between one file descriptor and another. Because this copying is done within the kernel, sendfile() is more efficient than the combination of read(2) and write(2), which would require transferring data to and from user space."
Diffstat (limited to 'erts/configure.in')
-rw-r--r--erts/configure.in16
1 files changed, 16 insertions, 0 deletions
diff --git a/erts/configure.in b/erts/configure.in
index e3eb6034e6..548e4cc9d5 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -1690,6 +1690,22 @@ dnl fdatasync requires linking against -lrt on SunOS <= 5.10.
dnl OpenSolaris 2009.06 is SunOS 5.11 and does not require -lrt.
AC_SEARCH_LIBS(fdatasync, [rt])
+
+dnl sendfile syscall
+case $host_os in
+ linux*|freebsd*|dragonfly*|darwin*)
+ AC_CHECK_FUNCS([sendfile])
+ ;;
+ solaris*)
+ AC_SEARCH_LIBS(sendfile, sendfile, AC_DEFINE(HAVE_SENDFILE, 1))
+ ;;
+ win32)
+ LIBS="$LIBS -lmswsock"
+ ;;
+ *)
+ ;;
+esac
+
dnl ----------------------------------------------------------------------
dnl Checks for library functions.
dnl ----------------------------------------------------------------------