recvfrom.c 759 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_recvfrom
  8. #error Missing definition of NR_recvfrom needed for cancellation.
  9. #endif
  10. ssize_t
  11. recvfrom (int fd, const void *buf, size_t len, int flags,
  12. __SOCKADDR_ARG addr, socklen_t addrlen)
  13. {
  14. return _syscall6(ssize_t, __NC(recvfrom), int, fd, const void* buf,
  15. size_t, len, int, flags, __SOCKADDR_ARG,
  16. addr.__sockaddr__, socklen_t, addrlen);
  17. }
  18. CANCELLABLE_SYSCALL(ssize_t, recvfrom, (int fd, const void *buf,
  19. size_t len, int flags, __SOCKADDR_ARG addr,
  20. socklen_t addrlen), (fd, buf, len, flags, addr, addrlen))
  21. lt_libc_hidden(recvfrom)