1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

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.
This commit is contained in:
Joseph Myers
2015-06-17 20:19:04 +00:00
parent c21d37deb2
commit dfa2d21450
9 changed files with 35 additions and 10 deletions

View File

@ -21,12 +21,14 @@
/* Receive the oldest from highest priority messages in message queue
MQDES, stop waiting if ABS_TIMEOUT expires. */
ssize_t
mq_timedreceive (mqd_t mqdes, char *__restrict msg_ptr, size_t msg_len,
__mq_timedreceive (mqd_t mqdes, char *__restrict msg_ptr, size_t msg_len,
unsigned int *__restrict msg_prio,
const struct timespec *__restrict abs_timeout)
{
__set_errno (ENOSYS);
return -1;
}
hidden_def (mq_timedreceive)
hidden_def (__mq_timedreceive)
weak_alias (__mq_timedreceive, mq_timedreceive)
hidden_weak (mq_timedreceive)
stub_warning (mq_timedreceive)

View File

@ -21,11 +21,13 @@
/* Add message pointed by MSG_PTR to message queue MQDES, stop blocking
on full message queue if ABS_TIMEOUT expires. */
int
mq_timedsend (mqd_t mqdes, const char *msg_ptr, size_t msg_len,
__mq_timedsend (mqd_t mqdes, const char *msg_ptr, size_t msg_len,
unsigned int msg_prio, const struct timespec *abs_timeout)
{
__set_errno (ENOSYS);
return -1;
}
hidden_def (mq_timedsend)
hidden_def (__mq_timedsend)
weak_alias (__mq_timedsend, mq_timedsend)
hidden_weak (mq_timedsend)
stub_warning (mq_timedsend)