diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-06-17 20:20:08 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2015-06-17 20:20:08 +0000 |
commit | 0595c98494c25f8eaa1a3298e8fa032ad5e4405e (patch) | |
tree | a3e0a10935b919b816c2f9033226b4a62dd415f2 /sysdeps/unix/sysv | |
parent | dfa2d21450f44b3ea7129858764c1508d87ae27a (diff) | |
download | glibc-0595c98494c25f8eaa1a3298e8fa032ad5e4405e.tar.gz |
Fix mq_notify socket, recv namespace (bug 18546).
mq_notify (in the 1996 edition of POSIX) brings in references to recv
and socket (not in POSIX until the 2001 edition). This patch fixes
this by using __recv and __socket, exporting them from libc at version
GLIBC_PRIVATE.
Tested for x86_64 and x86 (testsuite and comparison of installed
stripped shared libraries; PLT / dynamic symbol table changes render
the comparison not particularly useful for libc).
[BZ #18546]
* socket/recv.c (__recv): Use libc_hidden_def.
* socket/socket.c (__socket): Likewise.
* sysdeps/mach/hurd/recv.c (__recv): Likewise.
* sysdeps/mach/hurd/socket.c (__socket): Likewise.
* sysdeps/unix/sysv/linux/generic/recv.c (__recv): Likewise.
* sysdeps/unix/sysv/linux/recv.c (__recv): Use libc_hidden_weak.
* sysdeps/unix/sysv/linux/socket.c (__socket): Use
libc_hidden_def.
* sysdeps/unix/sysv/linux/x86_64/recv.c (__recv): Use
libc_hidden_weak.
* include/sys/socket.h (__socket): Do not use attribute_hidden.
Use libc_hidden_proto.
(__recv): Likewise.
* socket/Versions (libc): Export __recv and __socket at version
GLIBC_PRIVATE.
* sysdeps/unix/sysv/linux/mq_notify.c (helper_thread): Call __recv
instead of recv.
(init_mq_netlink): Call __socket instead of socket.
* conform/Makefile (test-xfail-POSIX/mqueue.h/linknamespace):
Remove variable.
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r-- | sysdeps/unix/sysv/linux/generic/recv.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/mq_notify.c | 6 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/recv.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/socket.c | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/recv.c | 1 |
5 files changed, 7 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/generic/recv.c b/sysdeps/unix/sysv/linux/generic/recv.c index 37861721e7..324cca6713 100644 --- a/sysdeps/unix/sysv/linux/generic/recv.c +++ b/sysdeps/unix/sysv/linux/generic/recv.c @@ -28,4 +28,5 @@ __libc_recv (int sockfd, void *buffer, size_t len, int flags) NULL, NULL); } strong_alias (__libc_recv, __recv) +libc_hidden_def (__recv) weak_alias (__libc_recv, recv) diff --git a/sysdeps/unix/sysv/linux/mq_notify.c b/sysdeps/unix/sysv/linux/mq_notify.c index 5a27274a3d..84b9cfa839 100644 --- a/sysdeps/unix/sysv/linux/mq_notify.c +++ b/sysdeps/unix/sysv/linux/mq_notify.c @@ -117,8 +117,8 @@ helper_thread (void *arg) { union notify_data data; - ssize_t n = recv (netlink_socket, &data, sizeof (data), - MSG_NOSIGNAL | MSG_WAITALL); + ssize_t n = __recv (netlink_socket, &data, sizeof (data), + MSG_NOSIGNAL | MSG_WAITALL); if (n < NOTIFY_COOKIE_LEN) continue; @@ -157,7 +157,7 @@ init_mq_netlink (void) if (netlink_socket == -1) { /* Just a normal netlink socket, not bound. */ - netlink_socket = socket (AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, 0); + netlink_socket = __socket (AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, 0); /* No need to do more if we have no socket. */ if (netlink_socket == -1) return; diff --git a/sysdeps/unix/sysv/linux/recv.c b/sysdeps/unix/sysv/linux/recv.c index d2e80d5a80..cd2bc1e101 100644 --- a/sysdeps/unix/sysv/linux/recv.c +++ b/sysdeps/unix/sysv/linux/recv.c @@ -29,3 +29,4 @@ __libc_recv (int fd, void *buf, size_t len, int flags) } weak_alias (__libc_recv, recv) weak_alias (__libc_recv, __recv) +libc_hidden_weak (__recv) diff --git a/sysdeps/unix/sysv/linux/socket.c b/sysdeps/unix/sysv/linux/socket.c index fcb4775c6b..3b2c7fea26 100644 --- a/sysdeps/unix/sysv/linux/socket.c +++ b/sysdeps/unix/sysv/linux/socket.c @@ -26,4 +26,5 @@ __socket (int fd, int type, int domain) { return SOCKETCALL (socket, fd, type, domain); } +libc_hidden_def (__socket) weak_alias (__socket, socket) diff --git a/sysdeps/unix/sysv/linux/x86_64/recv.c b/sysdeps/unix/sysv/linux/x86_64/recv.c index 995d11d3f0..06fdb7a5e6 100644 --- a/sysdeps/unix/sysv/linux/x86_64/recv.c +++ b/sysdeps/unix/sysv/linux/x86_64/recv.c @@ -29,4 +29,5 @@ __libc_recv (int fd, void *buf, size_t n, int flags) } weak_alias (__libc_recv, __recv) +libc_hidden_weak (__recv) weak_alias (__recv, recv) |