2020-01-18 09:38:21 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2019-06-07 11:49:03 +02:00
|
|
|
#include <errno.h>
|
|
|
|
|
#include <sys/uio.h>
|
2021-02-05 12:16:30 +01:00
|
|
|
#include <syscall.h>
|
2019-05-10 17:38:51 +02:00
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
2021-02-12 05:40:03 +03:30
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
}
|
2019-05-10 17:38:51 +02:00
|
|
|
}
|