Files
linux/tools/include/nolibc/sys/uio.h
Benjamin Berg 4bb30188c7 tools/nolibc: add uio.h with readv and writev
This is generally useful and struct iovec is also needed for other
purposes such as ptrace.

Signed-off-by: Benjamin Berg <benjamin.berg@intel.com>
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
2025-10-29 16:29:19 +01:00

50 lines
1.1 KiB
C

/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
/*
* uio for NOLIBC
* Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
* Copyright (C) 2025 Intel Corporation
*/
/* make sure to include all global symbols */
#include "../nolibc.h"
#ifndef _NOLIBC_SYS_UIO_H
#define _NOLIBC_SYS_UIO_H
#include "../sys.h"
#include <linux/uio.h>
/*
* ssize_t readv(int fd, const struct iovec *iovec, int count);
*/
static __attribute__((unused))
ssize_t sys_readv(int fd, const struct iovec *iovec, int count)
{
return my_syscall3(__NR_readv, fd, iovec, count);
}
static __attribute__((unused))
ssize_t readv(int fd, const struct iovec *iovec, int count)
{
return __sysret(sys_readv(fd, iovec, count));
}
/*
* ssize_t writev(int fd, const struct iovec *iovec, int count);
*/
static __attribute__((unused))
ssize_t sys_writev(int fd, const struct iovec *iovec, int count)
{
return my_syscall3(__NR_writev, fd, iovec, count);
}
static __attribute__((unused))
ssize_t writev(int fd, const struct iovec *iovec, int count)
{
return __sysret(sys_writev(fd, iovec, count));
}
#endif /* _NOLIBC_SYS_UIO_H */