diff options
Diffstat (limited to 'libpthread/nptl/sysdeps/unix')
41 files changed, 244 insertions, 317 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/accept.S b/libpthread/nptl/sysdeps/unix/sysv/linux/accept.S deleted file mode 100644 index 529763d80..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/accept.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/accept.c b/libpthread/nptl/sysdeps/unix/sysv/linux/accept.c new file mode 100644 index 000000000..edc110371 --- /dev/null +++ b/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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/connect.S b/libpthread/nptl/sysdeps/unix/sysv/linux/connect.S deleted file mode 100644 index 441843fa0..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/connect.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/connect.c b/libpthread/nptl/sysdeps/unix/sysv/linux/connect.c new file mode 100644 index 000000000..e0d022f45 --- /dev/null +++ b/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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/creat.S b/libpthread/nptl/sysdeps/unix/sysv/linux/creat.S deleted file mode 100644 index cd0e1b879..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/creat.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/creat.c b/libpthread/nptl/sysdeps/unix/sysv/linux/creat.c new file mode 100644 index 000000000..a4c7c68e1 --- /dev/null +++ b/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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/exit-thread.S b/libpthread/nptl/sysdeps/unix/sysv/linux/exit-thread.S deleted file mode 100644 index a4a7d5d16..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/exit-thread.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/lseek.S b/libpthread/nptl/sysdeps/unix/sysv/linux/lseek.S deleted file mode 100644 index 70a920ba1..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/lseek.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/msync.S b/libpthread/nptl/sysdeps/unix/sysv/linux/msync.S deleted file mode 100644 index 074a0d717..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/msync.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/msync.c b/libpthread/nptl/sysdeps/unix/sysv/linux/msync.c new file mode 100644 index 000000000..48ee95653 --- /dev/null +++ b/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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.S b/libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.S deleted file mode 100644 index 71efe32f9..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c b/libpthread/nptl/sysdeps/unix/sysv/linux/nanosleep.c new file mode 100644 index 000000000..73fae44bc --- /dev/null +++ b/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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pause.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pause.S deleted file mode 100644 index 3841018a8..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pause.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-accept.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-accept.S deleted file mode 100644 index 24062101d..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-accept.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-close.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-close.S deleted file mode 100644 index ab32ca598..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-close.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-connect.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-connect.S deleted file mode 100644 index b5124f8ec..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-connect.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-lseek.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-lseek.S deleted file mode 100644 index 4db71722a..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-lseek.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-msync.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-msync.S deleted file mode 100644 index 640270ad9..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-msync.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-nanosleep.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-nanosleep.S deleted file mode 100644 index 08d8f0150..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-nanosleep.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-open.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-open.S deleted file mode 100644 index 39ed92cc7..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-open.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-pause.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-pause.S deleted file mode 100644 index c6cb57180..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-pause.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-read.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-read.S deleted file mode 100644 index 623ba27a8..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-read.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-recv.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-recv.S deleted file mode 100644 index 6d2e3c2d6..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-recv.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-recvfrom.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-recvfrom.S deleted file mode 100644 index 96aeeaa3d..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-recvfrom.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-recvmsg.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-recvmsg.S deleted file mode 100644 index f7161e47c..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-recvmsg.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-send.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-send.S deleted file mode 100644 index 76bed39ec..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-send.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-sendmsg.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-sendmsg.S deleted file mode 100644 index d17096eae..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-sendmsg.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-sendto.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-sendto.S deleted file mode 100644 index d07a71f8a..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-sendto.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-write.S b/libpthread/nptl/sysdeps/unix/sysv/linux/pt-write.S deleted file mode 100644 index 6bc666779..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/pt-write.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/recv.S b/libpthread/nptl/sysdeps/unix/sysv/linux/recv.S deleted file mode 100644 index 95fa6516e..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/recv.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/recv.c b/libpthread/nptl/sysdeps/unix/sysv/linux/recv.c new file mode 100644 index 000000000..144871c53 --- /dev/null +++ b/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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/recvfrom.S b/libpthread/nptl/sysdeps/unix/sysv/linux/recvfrom.S deleted file mode 100644 index d9cc1e9b4..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/recvfrom.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/recvfrom.c b/libpthread/nptl/sysdeps/unix/sysv/linux/recvfrom.c new file mode 100644 index 000000000..623b62fa0 --- /dev/null +++ b/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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/recvmsg.S b/libpthread/nptl/sysdeps/unix/sysv/linux/recvmsg.S deleted file mode 100644 index c761b907c..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/recvmsg.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/recvmsg.c b/libpthread/nptl/sysdeps/unix/sysv/linux/recvmsg.c new file mode 100644 index 000000000..d0f277a97 --- /dev/null +++ b/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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/send.S b/libpthread/nptl/sysdeps/unix/sysv/linux/send.S deleted file mode 100644 index eb744c712..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/send.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/send.c b/libpthread/nptl/sysdeps/unix/sysv/linux/send.c new file mode 100644 index 000000000..a403dde85 --- /dev/null +++ b/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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sendmsg.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sendmsg.S deleted file mode 100644 index 4c41e01c1..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sendmsg.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sendmsg.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sendmsg.c new file mode 100644 index 000000000..4e055daf5 --- /dev/null +++ b/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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sendto.S b/libpthread/nptl/sysdeps/unix/sysv/linux/sendto.S deleted file mode 100644 index 7cb5278e9..000000000 --- a/libpthread/nptl/sysdeps/unix/sysv/linux/sendto.S +++ /dev/null @@ -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) diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/sendto.c b/libpthread/nptl/sysdeps/unix/sysv/linux/sendto.c new file mode 100644 index 000000000..216d928ce --- /dev/null +++ b/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) |