uio.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: LGPL-2.1 OR MIT */
  2. /*
  3. * uio for NOLIBC
  4. * Copyright (C) 2017-2021 Willy Tarreau <w@1wt.eu>
  5. * Copyright (C) 2025 Intel Corporation
  6. */
  7. /* make sure to include all global symbols */
  8. #include "../nolibc.h"
  9. #ifndef _NOLIBC_SYS_UIO_H
  10. #define _NOLIBC_SYS_UIO_H
  11. #include "../sys.h"
  12. #include <linux/uio.h>
  13. /*
  14. * ssize_t readv(int fd, const struct iovec *iovec, int count);
  15. */
  16. static __attribute__((unused))
  17. ssize_t sys_readv(int fd, const struct iovec *iovec, int count)
  18. {
  19. return my_syscall3(__NR_readv, fd, iovec, count);
  20. }
  21. static __attribute__((unused))
  22. ssize_t readv(int fd, const struct iovec *iovec, int count)
  23. {
  24. return __sysret(sys_readv(fd, iovec, count));
  25. }
  26. /*
  27. * ssize_t writev(int fd, const struct iovec *iovec, int count);
  28. */
  29. static __attribute__((unused))
  30. ssize_t sys_writev(int fd, const struct iovec *iovec, int count)
  31. {
  32. return my_syscall3(__NR_writev, fd, iovec, count);
  33. }
  34. static __attribute__((unused))
  35. ssize_t writev(int fd, const struct iovec *iovec, int count)
  36. {
  37. return __sysret(sys_writev(fd, iovec, count));
  38. }
  39. #endif /* _NOLIBC_SYS_UIO_H */