sendto.c 765 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
  3. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  4. */
  5. #include <sys/socket.h>
  6. #include <cancel.h>
  7. #ifndef __NR_sendto
  8. #error Missing definition of NR_sendto needed for cancellation.
  9. #endif
  10. ssize_t
  11. sendto (int fd, const void *buf, size_t len, int flags,
  12. __CONST_SOCKADDR_ARG addr, socklen_t addrlen)
  13. {
  14. return _syscall6(ssize_t, __NC(sendto), int, fd, const void* buf,
  15. size_t, len, int, flags, __CONST_SOCKADDR_ARG,
  16. addr.__sockaddr__, socklen_t, addrlen);
  17. }
  18. CANCELLABLE_SYSCALL(ssize_t, sendto, (int fd, const void *buf,
  19. size_t len, int flags, __CONST_SOCKADDR_ARG addr,
  20. socklen_t addrlen), (fd, buf, len, flags, addr, addrlen))
  21. lt_libc_hidden(sendto)