diff --git a/emper/io.hpp b/emper/io.hpp index 76da837b79775247cafe7d7e95923b6496843eef..fc154f36359f0e5689162c16a3099ca7db72e26c 100644 --- a/emper/io.hpp +++ b/emper/io.hpp @@ -219,7 +219,7 @@ inline auto acceptAndWait(int socket, struct sockaddr *address, socklen_t *addre * * @return Future object which signals the completion of the read request */ -inline auto readFile(int fildes, void *buf, size_t nbyte, off_t offset = 0, bool read_all = false) +inline auto readFile(int fildes, void *buf, size_t nbyte, off_t offset = -1, bool read_all = false) -> std::unique_ptr<Future> { auto future = std::make_unique<ReadFuture>(fildes, buf, nbyte, offset, read_all); future->submit(); @@ -241,7 +241,7 @@ inline auto readFile(int fildes, void *buf, size_t nbyte, off_t offset = 0, bool * * @return -1 on error, otherwise the number of bytes read */ -inline auto readFileAndWait(int fildes, void *buf, size_t nbyte, off_t offset = 0, +inline auto readFileAndWait(int fildes, void *buf, size_t nbyte, off_t offset = -1, bool read_all = false) -> ssize_t { ReadFuture future(fildes, buf, nbyte, offset, read_all); future.submit(); @@ -266,7 +266,7 @@ inline auto readFileAndWait(int fildes, void *buf, size_t nbyte, off_t offset = * * @return Future object which signals the completion of the write request */ -inline auto writeFile(int fildes, const void *buf, size_t nbyte, off_t offset = 0, +inline auto writeFile(int fildes, const void *buf, size_t nbyte, off_t offset = -1, bool write_all = true) -> std::unique_ptr<Future> { auto future = std::make_unique<WriteFuture>(fildes, buf, nbyte, offset, write_all); future->submit(); @@ -291,7 +291,7 @@ inline auto writeFile(int fildes, const void *buf, size_t nbyte, off_t offset = * * @return -1 on error, otherwise the number of bytes written */ -inline auto writeFileAndWait(int fildes, const void *buf, size_t nbyte, off_t offset = 0, +inline auto writeFileAndWait(int fildes, const void *buf, size_t nbyte, off_t offset = -1, bool write_all = true) -> ssize_t { WriteFuture future(fildes, buf, nbyte, offset, write_all); future.submit();