From 195e1f19b06095f39a4fb0da46dfab2ec5b10e9a Mon Sep 17 00:00:00 2001 From: Tuncer Ayaz Date: Thu, 13 Jan 2011 12:36:14 +0100 Subject: 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." --- lib/kernel/doc/src/file.xml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'lib/kernel/doc/src') diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml index 7db20e6343..78bf0aff45 100644 --- a/lib/kernel/doc/src/file.xml +++ b/lib/kernel/doc/src/file.xml @@ -1573,6 +1573,28 @@ otherwise {error, Reason}.

+ + + send a file to a socket + +

Sends Bytes in from the file + referenced by IoDevice beginning at Offset to + Socket. + Returns {ok, BytesSent} if successful, + otherwise {error, Reason}.

+

Available on Linux, FreeBSD, DragonflyBSD, Solaris, Darwin and Windows

+
+
+ + + send a file to a socket + +

Sends the file Filename to Socket. + Returns {ok, BytesSent} if successful, + otherwise {error, Reason}.

+

Available on Linux, FreeBSD, DragonflyBSD, Solaris, Darwin and Windows

+
+
Write to a file -- cgit v1.2.3