diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-02-12 05:40:03 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-02-15 17:32:56 +0100 |
commit | a3a7ab83c472b9cd3a0b119d4b27104525d1d2f1 (patch) | |
tree | 498c5784fec26d859dbbe84b452c385f22d5336a /Userland/Libraries/LibC/sys | |
parent | 1e79c0461612807eeb0783665fba4e409c56462e (diff) | |
download | serenity-a3a7ab83c472b9cd3a0b119d4b27104525d1d2f1.zip |
Kernel+LibC: Implement readv
We already had writev, so let's just add readv too.
Diffstat (limited to 'Userland/Libraries/LibC/sys')
-rw-r--r-- | Userland/Libraries/LibC/sys/uio.cpp | 6 | ||||
-rw-r--r-- | Userland/Libraries/LibC/sys/uio.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/sys/uio.cpp b/Userland/Libraries/LibC/sys/uio.cpp index 2fd6c94fe9..58b03a690f 100644 --- a/Userland/Libraries/LibC/sys/uio.cpp +++ b/Userland/Libraries/LibC/sys/uio.cpp @@ -35,4 +35,10 @@ ssize_t writev(int fd, const struct iovec* iov, int iov_count) int rc = syscall(SC_writev, fd, iov, iov_count); __RETURN_WITH_ERRNO(rc, rc, -1); } + +ssize_t readv(int fd, const struct iovec* iov, int iov_count) +{ + int rc = syscall(SC_readv, fd, iov, iov_count); + __RETURN_WITH_ERRNO(rc, rc, -1); +} } diff --git a/Userland/Libraries/LibC/sys/uio.h b/Userland/Libraries/LibC/sys/uio.h index be310b38f1..b77492a61b 100644 --- a/Userland/Libraries/LibC/sys/uio.h +++ b/Userland/Libraries/LibC/sys/uio.h @@ -37,5 +37,6 @@ struct iovec { }; ssize_t writev(int fd, const struct iovec*, int iov_count); +ssize_t readv(int fd, const struct iovec*, int iov_count); __END_DECLS |