aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/common
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2012-01-18 11:14:14 +0100
committerErlang/OTP <[email protected]>2012-01-18 11:14:14 +0100
commit5edf4b3ffa73874c9f612f2d919df9a21fc140c1 (patch)
treefb5982d66371f2b0cc7397abe8104c69863bd9d0 /erts/emulator/drivers/common
parentf8815dc88bd86d6508d2a3dad031ea939fb2b443 (diff)
parent77b157e42a7fd1a6f325276bdd88fd1a7f6bbea4 (diff)
downloadotp-5edf4b3ffa73874c9f612f2d919df9a21fc140c1.tar.gz
otp-5edf4b3ffa73874c9f612f2d919df9a21fc140c1.tar.bz2
otp-5edf4b3ffa73874c9f612f2d919df9a21fc140c1.zip
Merge branch 'raimo/64-bit-efile_drv/OTP-9820' into maint
* raimo/64-bit-efile_drv/OTP-9820: file_SUITE: Assume 64-bit windows has enough memory erts: Badarg if port output overflows iov_len prim_file_SUITE: large_file success depends on wordsize file_SUITE: Increase timeout for large_file file_SITE,prim_file_SUITE: Accept old OpenBSD pecularity prim_file_SUITE: large_write - meaner test data and check result content file_SUITE: large_write - check mem size before creating huge binary erts: rewrite efile_writev to handle partial writes correctly erts: Bugfix - driver_deq freed wrong length due to short type (int) prim_file_SUITE: Add large_write/1 file_SUITE: Add large_write/1 file_SUITE: Refactor large_file/1 file_SUITE: Fix unix_free/1
Diffstat (limited to 'erts/emulator/drivers/common')
-rw-r--r--erts/emulator/drivers/common/efile_drv.c8
-rw-r--r--erts/emulator/drivers/common/erl_efile.h2
2 files changed, 7 insertions, 3 deletions
diff --git a/erts/emulator/drivers/common/efile_drv.c b/erts/emulator/drivers/common/efile_drv.c
index b132991a3b..36ed108b76 100644
--- a/erts/emulator/drivers/common/efile_drv.c
+++ b/erts/emulator/drivers/common/efile_drv.c
@@ -1385,7 +1385,11 @@ static void invoke_writev(void *data) {
size = d->c.writev.size;
}
- /* Copy the io vector to avoid locking the port que while writing */
+ /* Copy the io vector to avoid locking the port que while writing,
+ * also, both we and efile_writev might/will change the SysIOVec
+ * when segmenting or due to partial write and we do not want to
+ * tamper with the actual queue that we get from driver_peekq
+ */
MUTEX_LOCK(d->c.writev.q_mtx); /* Lock before accessing the port queue */
iov0 = driver_peekq(d->c.writev.port, &iovlen);
@@ -1424,7 +1428,7 @@ static void invoke_writev(void *data) {
} else {
d->result_ok = efile_writev(&d->errInfo,
d->flags, (int) d->fd,
- iov, iovcnt, size);
+ iov, iovcnt);
}
} else if (iovlen == 0) {
d->result_ok = 1;
diff --git a/erts/emulator/drivers/common/erl_efile.h b/erts/emulator/drivers/common/erl_efile.h
index 3868b38137..69ad02633c 100644
--- a/erts/emulator/drivers/common/erl_efile.h
+++ b/erts/emulator/drivers/common/erl_efile.h
@@ -162,7 +162,7 @@ int efile_write_info(Efile_error* errInfo, Efile_info* pInfo, char *name);
int efile_write(Efile_error* errInfo, int flags, int fd,
char* buf, size_t count);
int efile_writev(Efile_error* errInfo, int flags, int fd,
- SysIOVec* iov, int iovcnt, size_t size);
+ SysIOVec* iov, int iovcnt);
int efile_read(Efile_error* errInfo, int flags, int fd,
char* buf, size_t count, size_t* pBytesRead);
int efile_seek(Efile_error* errInfo, int fd,