Browse Source

nptl: remove sysdep-cancel ASM macros, convert to C

Waldemar Brodkorb 6 years ago
parent
commit
dcbff4072b
42 changed files with 244 additions and 322 deletions
  1. 0 5
      include/unistd.h
  2. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/accept.S
  3. 23 0
      libpthread/nptl/sysdeps/unix/sysv/linux/accept.c
  4. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/connect.S
  5. 23 0
      libpthread/nptl/sysdeps/unix/sysv/linux/connect.c
  6. 0 7
      libpthread/nptl/sysdeps/unix/sysv/linux/creat.S
  7. 22 0
      libpthread/nptl/sysdeps/unix/sysv/linux/creat.c
  8. 0 22
      libpthread/nptl/sysdeps/unix/sysv/linux/exit-thread.S
  9. 0 7
      libpthread/nptl/sysdeps/unix/sysv/linux/lseek.S
  10. 0 7
      libpthread/nptl/sysdeps/unix/sysv/linux/msync.S
  11. 19 0
      libpthread/nptl/sysdeps/unix/sysv/linux/msync.c
  12. 0 9
      libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.S
  13. 21 0
      libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c
  14. 0 7
      libpthread/nptl/sysdeps/unix/sysv/linux/pause.S
  15. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-accept.S
  16. 0 9
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-close.S
  17. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-connect.S
  18. 0 7
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-lseek.S
  19. 0 7
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-msync.S
  20. 0 9
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-nanosleep.S
  21. 0 9
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-open.S
  22. 0 7
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-pause.S
  23. 0 9
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-read.S
  24. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-recv.S
  25. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-recvfrom.S
  26. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-recvmsg.S
  27. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-send.S
  28. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-sendmsg.S
  29. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-sendto.S
  30. 0 9
      libpthread/nptl/sysdeps/unix/sysv/linux/pt-write.S
  31. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/recv.S
  32. 19 0
      libpthread/nptl/sysdeps/unix/sysv/linux/recv.c
  33. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/recvfrom.S
  34. 26 0
      libpthread/nptl/sysdeps/unix/sysv/linux/recvfrom.c
  35. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/recvmsg.S
  36. 23 0
      libpthread/nptl/sysdeps/unix/sysv/linux/recvmsg.c
  37. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/send.S
  38. 19 0
      libpthread/nptl/sysdeps/unix/sysv/linux/send.c
  39. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/sendmsg.S
  40. 23 0
      libpthread/nptl/sysdeps/unix/sysv/linux/sendmsg.c
  41. 0 12
      libpthread/nptl/sysdeps/unix/sysv/linux/sendto.S
  42. 26 0
      libpthread/nptl/sysdeps/unix/sysv/linux/sendto.c

+ 0 - 5
include/unistd.h

@@ -830,11 +830,6 @@ extern __pid_t vfork (void) __THROW;
 libc_hidden_proto(vfork)
 #endif /* Use BSD. */
 
-#if 0 /* psm: seems unused , exit-thread.S is not compiled */
-/* Special exit function which only terminates the current thread.  */
-extern void __exit_thread (int val) __attribute__ ((__noreturn__));
-#endif
-
 /* Return the pathname of the terminal FD is open on, or NULL on errors.
    The returned storage is good only until the next call to this function.  */
 extern char *ttyname (int __fd) __THROW;

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/accept.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_accept
-#error Missing definition of NR_accept needed for cancellation.
-#endif
-PSEUDO (__libc_accept, accept, 3)
-ret
-PSEUDO_END(__libc_accept)
-libc_hidden_def (__libc_accept)
-weak_alias (__libc_accept, __accept)
-libc_hidden_weak (__accept)
-weak_alias (__libc_accept, accept)
-libc_hidden_weak (accept)

+ 23 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/accept.c

@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/socket.h>
+#include <cancel.h>
+
+#ifndef __NR_accept
+#error Missing definition of NR_accept needed for cancellation.
+#endif
+
+int
+accept (int fd, __SOCKADDR_ARG addr, socklen_t *len)
+{
+  return _syscall3(int, __NC(accept), int, fd, __SOCKADDR_ARG,
+			addr.__sockaddr__, socklen_t*, len);
+}
+
+CANCELLABLE_SYSCALL(int, accept, (int fd, __SOCKADDR_ARG addr,
+			socklen_t *len), (fd, addr, len))
+
+lt_libc_hidden(accept)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/connect.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_connect
-#error Missing definition of NR_connect needed for cancellation.
-#endif
-PSEUDO (__libc_connect, connect, 3)
-ret
-PSEUDO_END(__libc_connect)
-libc_hidden_def (__libc_connect)
-weak_alias (__libc_connect, __connect)
-libc_hidden_weak (__connect)
-weak_alias (__libc_connect, connect)
-libc_hidden_weak (connect)

+ 23 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/connect.c

@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/socket.h>
+#include <cancel.h>
+
+#ifndef __NR_connect
+#error Missing definition of NR_connect needed for cancellation.
+#endif
+
+int
+connect (int fd, __CONST_SOCKADDR_ARG addr, socklen_t len)
+{
+  return _syscall3(int, __NC(connect), int, fd, __CONST_SOCKADDR_ARG,
+			addr.__sockaddr__, socklen_t, len);
+}
+
+CANCELLABLE_SYSCALL(int, connect, (int fd, __CONST_SOCKADDR_ARG addr,
+			socklen_t len), (fd, addr, len))
+
+lt_libc_hidden(connect)

+ 0 - 7
libpthread/nptl/sysdeps/unix/sysv/linux/creat.S

@@ -1,7 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_creat, creat, 2)
-ret
-PSEUDO_END(__libc_creat)
-libc_hidden_def (__libc_creat)
-weak_alias (__libc_creat, creat)
-libc_hidden_weak (creat)

+ 22 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/creat.c

@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <cancel.h>
+
+int
+creat (const char *file, mode_t mode)
+{
+# ifdef __NR_creat
+  return _syscall2(int, __NC(creat), const char*, file, mode_t, mode)
+# else
+  return __open (file, O_WRONLY | O_CREAT | O_TRUNC, mode);
+# endif
+}
+
+CANCELLABLE_SYSCALL(int, creat, (const char *file, mode_t mode), (file, mode))
+
+lt_libc_hidden(creat)

+ 0 - 22
libpthread/nptl/sysdeps/unix/sysv/linux/exit-thread.S

@@ -1,22 +0,0 @@
-/* Copyright (C) 1991,92,97,99,2002 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-
-PSEUDO (__exit_thread, exit, 1)
-	/* Shouldn't get here.  */
-PSEUDO_END(__exit_thread)

+ 0 - 7
libpthread/nptl/sysdeps/unix/sysv/linux/lseek.S

@@ -1,7 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_lseek, lseek, 3)
-ret
-PSEUDO_END (__libc_lseek)
-libc_hidden_def (__libc_lseek)
-weak_alias (__libc_lseek, lseek)
-libc_hidden_weak (lseek)

+ 0 - 7
libpthread/nptl/sysdeps/unix/sysv/linux/msync.S

@@ -1,7 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_msync, msync, 3)
-ret
-PSEUDO_END(__libc_msync)
-libc_hidden_def (__libc_msync)
-weak_alias (__libc_msync, msync)
-libc_hidden_weak (msync)

+ 19 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/msync.c

@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/mman.h>
+#include <cancel.h>
+
+int
+msync (void *addr, size_t length, int flags)
+{
+  return _syscall3(int, __NC(msync), const void* addr,
+			size_t, lenght, int, flags);
+}
+
+CANCELLABLE_SYSCALL(int, msync, (const void *addr,
+			size_t lenght, int flags), (addr, length, flags))
+
+lt_libc_hidden(msync)

+ 0 - 9
libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.S

@@ -1,9 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_nanosleep, nanosleep, 3)
-ret
-PSEUDO_END (__libc_nanosleep)
-libc_hidden_def (__libc_nanosleep)
-weak_alias (__libc_nanosleep, __nanosleep)
-libc_hidden_weak (__nanosleep)
-weak_alias (__libc_nanosleep, nanosleep)
-libc_hidden_weak (nanosleep)

+ 21 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c

@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <time.h>
+#include <cancel.h>
+
+/* Pause execution for a number of nanoseconds.  */
+int
+nanosleep (const struct timespec *requested_time,
+             struct timespec *remaining)
+{
+  return _syscall2(int, __NC(nanosleep), const struct timespec*,
+			requested_time, struct timespec* remaining)
+}
+
+CANCELLABLE_SYSCALL(int, nanosleep, (const struct timespec *requested_time,
+			struct timespec *remaining), (requested_time, remaining))
+
+lt_libc_hidden(nanosleep)

+ 0 - 7
libpthread/nptl/sysdeps/unix/sysv/linux/pause.S

@@ -1,7 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_pause, pause, 0)
-ret
-PSEUDO_END (__libc_pause)
-libc_hidden_def (__libc_pause)
-weak_alias (__libc_pause, pause)
-libc_hidden_weak (pause)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/pt-accept.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_accept
-#error Missing definition of NR_accept needed for cancellation.
-#endif
-PSEUDO (__libc_accept, accept, 3)
-ret
-PSEUDO_END(__libc_accept)
-libpthread_hidden_def (__libc_accept)
-weak_alias (__libc_accept, __accept)
-libpthread_hidden_weak (__accept)
-weak_alias (__libc_accept, accept)
-libpthread_hidden_weak (accept)

+ 0 - 9
libpthread/nptl/sysdeps/unix/sysv/linux/pt-close.S

@@ -1,9 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_close, close, 1)
-ret
-PSEUDO_END (__libc_close)
-libpthread_hidden_def (__libc_close)
-weak_alias (__libc_close, __close)
-libpthread_hidden_weak (__close)
-weak_alias (__libc_close, close)
-libpthread_hidden_weak (close)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/pt-connect.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_connect
-#error Missing definition of NR_connect needed for cancellation.
-#endif
-PSEUDO (__libc_connect, connect, 3)
-ret
-PSEUDO_END(__libc_connect)
-libpthread_hidden_def (__libc_connect)
-weak_alias (__libc_connect, __connect)
-libpthread_hidden_weak (__connect)
-weak_alias (__libc_connect, connect)
-libpthread_hidden_weak (connect)

+ 0 - 7
libpthread/nptl/sysdeps/unix/sysv/linux/pt-lseek.S

@@ -1,7 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_lseek, lseek, 3)
-ret
-PSEUDO_END (__libc_lseek)
-libpthread_hidden_def (__libc_lseek)
-weak_alias (__libc_lseek, lseek)
-libpthread_hidden_weak (lseek)

+ 0 - 7
libpthread/nptl/sysdeps/unix/sysv/linux/pt-msync.S

@@ -1,7 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_msync, msync, 3)
-ret
-PSEUDO_END(__libc_msync)
-libpthread_hidden_def (__libc_msync)
-weak_alias (__libc_msync, msync)
-libpthread_hidden_weak (msync)

+ 0 - 9
libpthread/nptl/sysdeps/unix/sysv/linux/pt-nanosleep.S

@@ -1,9 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_nanosleep, nanosleep, 3)
-ret
-PSEUDO_END (__libc_nanosleep)
-libpthread_hidden_def (__libc_nanosleep)
-weak_alias (__libc_nanosleep, __nanosleep)
-libpthread_hidden_weak (__nanosleep)
-weak_alias (__libc_nanosleep, nanosleep)
-libpthread_hidden_weak (nanosleep)

+ 0 - 9
libpthread/nptl/sysdeps/unix/sysv/linux/pt-open.S

@@ -1,9 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_open, open, 3)
-ret
-PSEUDO_END (__libc_open)
-libpthread_hidden_def (__libc_open)
-weak_alias (__libc_open, __open)
-libpthread_hidden_weak (__open)
-weak_alias (__libc_open, open)
-libpthread_hidden_weak (open)

+ 0 - 7
libpthread/nptl/sysdeps/unix/sysv/linux/pt-pause.S

@@ -1,7 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_pause, pause, 0)
-ret
-PSEUDO_END (__libc_pause)
-libpthread_hidden_def (__libc_pause)
-weak_alias (__libc_pause, pause)
-libpthread_hidden_weak (pause)

+ 0 - 9
libpthread/nptl/sysdeps/unix/sysv/linux/pt-read.S

@@ -1,9 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_read, read, 3)
-ret
-PSEUDO_END (__libc_read)
-libpthread_hidden_def (__libc_read)
-weak_alias (__libc_read, __read)
-libpthread_hidden_weak (__read)
-weak_alias (__libc_read, read)
-libpthread_hidden_weak (read)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/pt-recv.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_recv
-#error Missing definition of NR_recv needed for cancellation.
-#endif
-PSEUDO (__libc_recv, recv, 4)
-ret
-PSEUDO_END(__libc_recv)
-libpthread_hidden_def (__libc_recv)
-weak_alias (__libc_recv, __recv)
-libpthread_hidden_weak (__recv)
-weak_alias (__libc_recv, recv)
-libpthread_hidden_weak (recv)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/pt-recvfrom.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_recvfrom
-#error Missing definition of NR_recvfrom needed for cancellation.
-#endif
-PSEUDO (__libc_recvfrom, recvfrom, 6)
-ret
-PSEUDO_END(__libc_recvfrom)
-libpthread_hidden_def (__libc_recvfrom)
-weak_alias (__libc_recvfrom, __recvfrom)
-libpthread_hidden_weak (__recvfrom)
-weak_alias (__libc_recvfrom, recvfrom)
-libpthread_hidden_weak (recvfrom)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/pt-recvmsg.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_recvmsg
-#error Missing definition of NR_recvmsg needed for cancellation.
-#endif
-PSEUDO (__libc_recvmsg, recvmsg, 3)
-ret
-PSEUDO_END(__libc_recvmsg)
-libpthread_hidden_def (__libc_recvmsg)
-weak_alias (__libc_recvmsg, __recvmsg)
-libpthread_hidden_weak (__recvmsg)
-weak_alias (__libc_recvmsg, recvmsg)
-libpthread_hidden_weak (recvmsg)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/pt-send.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_send
-#error Missing definition of NR_send needed for cancellation.
-#endif
-PSEUDO (__libc_send, send, 4)
-ret
-PSEUDO_END (__libc_send)
-libpthread_hidden_def (__libc_send)
-weak_alias (__libc_send, __send)
-libpthread_hidden_weak (__send)
-weak_alias (__libc_send, send)
-libpthread_hidden_weak (send)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/pt-sendmsg.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_sendmsg
-#error Missing definition of NR_sendmsg needed for cancellation.
-#endif
-PSEUDO (__libc_sendmsg, sendmsg, 3)
-ret
-PSEUDO_END(__libc_sendmsg)
-libpthread_hidden_def (__libc_sendmsg)
-weak_alias (__libc_sendmsg, __sendmsg)
-libpthread_hidden_weak (__sendmsg)
-weak_alias (__libc_sendmsg, sendmsg)
-libpthread_hidden_weak (sendmsg)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/pt-sendto.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_sendto
-#error Missing definition of NR_sendto needed for cancellation.
-#endif
-PSEUDO (__libc_sendto, sendto, 6)
-ret
-PSEUDO_END(__libc_sendto)
-libpthread_hidden_def (__libc_sendto)
-weak_alias (__libc_sendto, __sendto)
-libpthread_hidden_weak (__sendto)
-weak_alias (__libc_sendto, sendto)
-libpthread_hidden_weak (sendto)

+ 0 - 9
libpthread/nptl/sysdeps/unix/sysv/linux/pt-write.S

@@ -1,9 +0,0 @@
-#include <sysdep-cancel.h>
-PSEUDO (__libc_write, write, 3)
-ret
-PSEUDO_END (__libc_write)
-libpthread_hidden_def (__libc_write)
-weak_alias (__libc_write, __write)
-libpthread_hidden_weak (__write)
-weak_alias (__libc_write, write)
-libpthread_hidden_weak (write)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/recv.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_recv
-#error Missing definition of NR_recv needed for cancellation.
-#endif
-PSEUDO (__libc_recv, recv, 4)
-ret
-PSEUDO_END(__libc_recv)
-libc_hidden_def (__libc_recv)
-weak_alias (__libc_recv, __recv)
-libc_hidden_weak (__recv)
-weak_alias (__libc_recv, recv)
-libc_hidden_weak (recv)

+ 19 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/recv.c

@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/socket.h>
+#include <cancel.h>
+
+ssize_t
+recv (int fd, void *buf, size_t len, int flags)
+{
+  return _syscall4(ssize_t, __NC(recv), int, fd, void* buf,
+			size_t, len, int, flags);
+}
+
+CANCELLABLE_SYSCALL(ssize_t, recv, (int fd, void *buf,
+			size_t len, int flags), (fd, buf, len, flags))
+
+lt_libc_hidden(recv)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/recvfrom.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_recvfrom
-#error Missing definition of NR_recvfrom needed for cancellation.
-#endif
-PSEUDO (__libc_recvfrom, recvfrom, 6)
-ret
-PSEUDO_END(__libc_recvfrom)
-libc_hidden_def (__libc_recvfrom)
-weak_alias (__libc_recvfrom, __recvfrom)
-libc_hidden_weak (__recvfrom)
-weak_alias (__libc_recvfrom, recvfrom)
-libc_hidden_weak (recvfrom)

+ 26 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/recvfrom.c

@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/socket.h>
+#include <cancel.h>
+
+#ifndef __NR_recvfrom
+#error Missing definition of NR_recvfrom needed for cancellation.
+#endif
+
+ssize_t
+recvfrom (int fd, const void *buf, size_t len, int flags,
+	       __SOCKADDR_ARG addr, socklen_t addrlen)
+{
+  return _syscall6(ssize_t, __NC(recvfrom), int, fd, const void* buf,
+			size_t, len, int, flags, __SOCKADDR_ARG,
+			addr.__sockaddr__, socklen_t, addrlen);
+}
+
+CANCELLABLE_SYSCALL(ssize_t, recvfrom, (int fd, const void *buf,
+			size_t len, int flags, __SOCKADDR_ARG addr,
+			socklen_t addrlen), (fd, buf, len, flags, addr, addrlen))
+
+lt_libc_hidden(recvfrom)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/recvmsg.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_recvmsg
-#error Missing definition of NR_recvmsg needed for cancellation.
-#endif
-PSEUDO (__libc_recvmsg, recvmsg, 3)
-ret
-PSEUDO_END(__libc_recvmsg)
-libc_hidden_def (__libc_recvmsg)
-weak_alias (__libc_recvmsg, __recvmsg)
-libc_hidden_weak (__recvmsg)
-weak_alias (__libc_recvmsg, recvmsg)
-libc_hidden_weak (recvmsg)

+ 23 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/recvmsg.c

@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/socket.h>
+#include <cancel.h>
+
+#ifndef __NR_recvmsg
+#error Missing definition of NR_recvmsg needed for cancellation.
+#endif
+
+ssize_t
+recvmsg (int fd, const struct msghdr *msg, int flags)
+{
+  return _syscall3(ssize_t, __NC(recvmsg), int, fd, const struct msghdr*, msg,
+			int, flags);
+}
+
+CANCELLABLE_SYSCALL(ssize_t, recvmsg, (int fd, const struct msghdr *msg,
+			int flags), (fd, msg, flags))
+
+lt_libc_hidden(recvmsg)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/send.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_send
-#error Missing definition of NR_send needed for cancellation.
-#endif
-PSEUDO (__libc_send, send, 4)
-ret
-PSEUDO_END (__libc_send)
-libc_hidden_def (__libc_send)
-weak_alias (__libc_send, __send)
-libc_hidden_weak (__send)
-weak_alias (__libc_send, send)
-libc_hidden_weak (send)

+ 19 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/send.c

@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/socket.h>
+#include <cancel.h>
+
+ssize_t
+send (int fd, const void *buf, size_t len, int flags)
+{
+  return _syscall4(ssize_t, __NC(send), int, fd, const void* buf,
+			size_t, len, int, flags);
+}
+
+CANCELLABLE_SYSCALL(ssize_t, send, (int fd, const void *buf,
+			size_t len, int flags), (fd, buf, len, flags))
+
+lt_libc_hidden(send)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/sendmsg.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_sendmsg
-#error Missing definition of NR_sendmsg needed for cancellation.
-#endif
-PSEUDO (__libc_sendmsg, sendmsg, 3)
-ret
-PSEUDO_END(__libc_sendmsg)
-libc_hidden_def (__libc_sendmsg)
-weak_alias (__libc_sendmsg, __sendmsg)
-libc_hidden_weak (__sendmsg)
-weak_alias (__libc_sendmsg, sendmsg)
-libc_hidden_weak (sendmsg)

+ 23 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/sendmsg.c

@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/socket.h>
+#include <cancel.h>
+
+#ifndef __NR_sendmsg
+#error Missing definition of NR_sendmsg needed for cancellation.
+#endif
+
+ssize_t
+sendmsg (int fd, const struct msghdr *msg, int flags)
+{
+  return _syscall3(ssize_t, __NC(sendmsg), int, fd, const struct msghdr*, msg,
+			int, flags);
+}
+
+CANCELLABLE_SYSCALL(ssize_t, sendmsg, (int fd, const struct msghdr *msg,
+			int flags), (fd, msg, flags))
+
+lt_libc_hidden(sendmsg)

+ 0 - 12
libpthread/nptl/sysdeps/unix/sysv/linux/sendto.S

@@ -1,12 +0,0 @@
-#include <sysdep-cancel.h>
-#ifndef __NR_sendto
-#error Missing definition of NR_sendto needed for cancellation.
-#endif
-PSEUDO (__libc_sendto, sendto, 6)
-ret
-PSEUDO_END(__libc_sendto)
-libc_hidden_def (__libc_sendto)
-weak_alias (__libc_sendto, __sendto)
-libc_hidden_weak (__sendto)
-weak_alias (__libc_sendto, sendto)
-libc_hidden_weak (sendto)

+ 26 - 0
libpthread/nptl/sysdeps/unix/sysv/linux/sendto.c

@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/socket.h>
+#include <cancel.h>
+
+#ifndef __NR_sendto
+#error Missing definition of NR_sendto needed for cancellation.
+#endif
+
+ssize_t
+sendto (int fd, const void *buf, size_t len, int flags,
+	       __CONST_SOCKADDR_ARG addr, socklen_t addrlen)
+{
+  return _syscall6(ssize_t, __NC(sendto), int, fd, const void* buf,
+			size_t, len, int, flags, __CONST_SOCKADDR_ARG,
+			addr.__sockaddr__, socklen_t, addrlen);
+}
+
+CANCELLABLE_SYSCALL(ssize_t, sendto, (int fd, const void *buf,
+			size_t len, int flags, __CONST_SOCKADDR_ARG addr,
+			socklen_t addrlen), (fd, buf, len, flags, addr, addrlen))
+
+lt_libc_hidden(sendto)