aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/unix
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-11-29 11:05:37 +0100
committerLukas Larsson <[email protected]>2011-12-02 10:39:38 +0100
commit1bbf8cee44b8836d66d289cc0b5b314ed83de821 (patch)
tree6d7ab44fd0d11c33f885816ddb12dfbc785f4540 /erts/emulator/drivers/unix
parent27faa34693f35b6aa41fa67cbfe365bd082a5757 (diff)
downloadotp-1bbf8cee44b8836d66d289cc0b5b314ed83de821.tar.gz
otp-1bbf8cee44b8836d66d289cc0b5b314ed83de821.tar.bz2
otp-1bbf8cee44b8836d66d289cc0b5b314ed83de821.zip
Remove header/trailer support
Since the API for headers/trailers seem to be very awkward to work with when using non-blocking io the feature is dropped for now. See unix_efile.c for more details.
Diffstat (limited to 'erts/emulator/drivers/unix')
-rw-r--r--erts/emulator/drivers/unix/unix_efile.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c
index 138c550fdd..72911641d3 100644
--- a/erts/emulator/drivers/unix/unix_efile.c
+++ b/erts/emulator/drivers/unix/unix_efile.c
@@ -1471,9 +1471,21 @@ efile_fadvise(Efile_error* errInfo, int fd, Sint64 offset,
#ifdef HAVE_SENDFILE
#define SENDFILE_CHUNK_SIZE ((1 << 30) -1)
+/*
+ * sendfile: The implementation of the sendfile system call varies
+ * a lot on different *nix platforms so to make the api similar in all
+ * we have to emulate some things in linux and play with variables on
+ * bsd/darwin.
+ *
+ * It could be possible to implement header/trailer in sendfile, though
+ * you would have to emulate it in linux and on BSD/Darwin some complex
+ * calculations have to be made when using a non blocking socket to figure
+ * out how much of the header/file/trailer was sent in each command.
+ */
+
int
efile_sendfile(Efile_error* errInfo, int in_fd, int out_fd,
- off_t *offset, Uint64 *nbytes, struct t_sendfile_hdtl** hdtl)
+ off_t *offset, Uint64 *nbytes, struct t_sendfile_hdtl* hdtl)
{
Uint64 written = 0;
#if defined(__linux__) || (defined(__sun) && defined(__SVR4))