From dfa2d21450f44b3ea7129858764c1508d87ae27a Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 17 Jun 2015 20:19:04 +0000 Subject: Fix mq_receive, mq_send mq_timed* namespace (bug 18545). mq_receive calls mq_timedreceive, and mq_send calls mq_timedsend. But mq_receive and mq_send were in POSIX by 1996, while mq_timed* were added in the 2001 edition of POSIX. This patch fixes this by making mq_timed* into weak aliases for __mq_timed* and calling the __mq_timed* names. Tested for x86_64 and x86 (testsuite, and that disassembly of installed shared libraries is unchanged by the patch). [BZ #18545] * rt/mq_timedreceive.c (mq_timedreceive): Rename to __mq_timedreceive and define as alias of __mq_timedreceive. Use hidden_weak. * rt/mq_timedsend.c (mq_timedsend): Rename to __mq_timedsend and define as alias of __mq_timedsend. Use hidden_weak. * sysdeps/unix/sysv/linux/syscalls.list (mq_timedsend): Use __mq_timedsend as strong name. (mq_timedreceive): Use __mq_timedreceive as strong name. * include/mqueue.h (__mq_timedsend): Declare. Use hidden_proto. (__mq_timedreceive): Likewise. * sysdeps/unix/sysv/linux/mq_receive.c (mq_receive): Call __mq_timedreceive instead of mq_timedreceive. * sysdeps/unix/sysv/linux/mq_send.c (mq_send): Call __mq_timedsend instead of mq_timedsend. * conform/Makefile (test-xfail-UNIX98/mqueue.h/linknamespace): Remove variable. --- sysdeps/unix/sysv/linux/mq_receive.c | 2 +- sysdeps/unix/sysv/linux/mq_send.c | 2 +- sysdeps/unix/sysv/linux/syscalls.list | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'sysdeps/unix/sysv') diff --git a/sysdeps/unix/sysv/linux/mq_receive.c b/sysdeps/unix/sysv/linux/mq_receive.c index 3c41ecf411..ff73d0a138 100644 --- a/sysdeps/unix/sysv/linux/mq_receive.c +++ b/sysdeps/unix/sysv/linux/mq_receive.c @@ -28,7 +28,7 @@ ssize_t mq_receive (mqd_t mqdes, char *msg_ptr, size_t msg_len, unsigned int *msg_prio) { - return mq_timedreceive (mqdes, msg_ptr, msg_len, msg_prio, NULL); + return __mq_timedreceive (mqdes, msg_ptr, msg_len, msg_prio, NULL); } #else diff --git a/sysdeps/unix/sysv/linux/mq_send.c b/sysdeps/unix/sysv/linux/mq_send.c index 4022cf1fee..9013657aa0 100644 --- a/sysdeps/unix/sysv/linux/mq_send.c +++ b/sysdeps/unix/sysv/linux/mq_send.c @@ -27,7 +27,7 @@ int mq_send (mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msg_prio) { - return mq_timedsend (mqdes, msg_ptr, msg_len, msg_prio, NULL); + return __mq_timedsend (mqdes, msg_ptr, msg_len, msg_prio, NULL); } #else diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list index 09dd10d1ab..ed5d38f622 100644 --- a/sysdeps/unix/sysv/linux/syscalls.list +++ b/sysdeps/unix/sysv/linux/syscalls.list @@ -106,8 +106,8 @@ removexattr - removexattr i:ss removexattr lremovexattr - lremovexattr i:ss lremovexattr fremovexattr - fremovexattr i:is fremovexattr -mq_timedsend - mq_timedsend Ci:ipiip mq_timedsend -mq_timedreceive - mq_timedreceive Ci:ipipp mq_timedreceive +mq_timedsend - mq_timedsend Ci:ipiip __mq_timedsend mq_timedsend +mq_timedreceive - mq_timedreceive Ci:ipipp __mq_timedreceive mq_timedreceive mq_setattr - mq_getsetattr i:ipp mq_setattr timerfd_create EXTRA timerfd_create i:ii timerfd_create -- cgit v1.2.3-70-g09d2