diff options
author | Tuncer Ayaz <[email protected]> | 2011-01-13 12:36:14 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2011-11-29 14:30:35 +0100 |
commit | 195e1f19b06095f39a4fb0da46dfab2ec5b10e9a (patch) | |
tree | 8f4a8c587b72c3a20d18b4cb6ccd7d1d52eb6286 /lib/kernel/doc/src/file.xml | |
parent | 7292c3d9f5285592aa4de996f6f106cd365d7895 (diff) | |
download | otp-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 'lib/kernel/doc/src/file.xml')
-rw-r--r-- | lib/kernel/doc/src/file.xml | 22 |
1 files changed, 22 insertions, 0 deletions
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 @@ -1574,6 +1574,28 @@ </desc> </func> <func> + <name name="sendfile" arity="4"/> + <fsummary>send a file to a socket</fsummary> + <desc> + <p>Sends <c>Bytes</c> in from the file + referenced by <c>IoDevice</c> beginning at <c>Offset</c> to + <c>Socket</c>. + Returns <c>{ok, BytesSent}</c> if successful, + otherwise <c>{error, Reason}</c>.</p> + <p>Available on Linux, FreeBSD, DragonflyBSD, Solaris, Darwin and Windows</p> + </desc> + </func> + <func> + <name name="sendfile" arity="2"/> + <fsummary>send a file to a socket</fsummary> + <desc> + <p>Sends the file <c>Filename</c> to <c>Socket</c>. + Returns <c>{ok, BytesSent}</c> if successful, + otherwise <c>{error, Reason}</c>.</p> + <p>Available on Linux, FreeBSD, DragonflyBSD, Solaris, Darwin and Windows</p> + </desc> + </func> + <func> <name name="write" arity="2"/> <fsummary>Write to a file</fsummary> <desc> |