summaryrefslogtreecommitdiff
path: root/librt/mq_timedreceive.c
diff options
context:
space:
mode:
authorDmitry Chestnykh <dm.chestnykh@gmail.com>2024-02-25 14:43:28 +0300
committerWaldemar Brodkorb <wbx@openadk.org>2024-02-25 19:27:48 +0100
commit81ed334f67e0c56ff0a89ade0fc156c0ba23f190 (patch)
tree09829cc5cd0d03a4f91887864f6a3c28213549af /librt/mq_timedreceive.c
parent086a5f165096af104b01bb6d5639bd769bd17620 (diff)
Add support for using time64 on big-endian machines.
For BE architectures there is one significant difference in comparison with time64 support for little-endian architectures like ARMv7. The difference is that we strictly need to pass two 64bit values to system calls because Linux Kernel internally uses `struct __kernel_timespec` and similar, which consists of two 64bit fields. For this reason many files have been changed to convert pointers to timespec-family structures (mixed of 64bit and 32bit values) to the pointer of the similar but 64bit-only structures for using as system calls args. This is general prerequisite for any BE architecture. Signed-off-by: Dmitry Chestnykh <dm.chestnykh@gmail.com>
Diffstat (limited to 'librt/mq_timedreceive.c')
-rw-r--r--librt/mq_timedreceive.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/librt/mq_timedreceive.c b/librt/mq_timedreceive.c
index db1ae1aa8..f89b4c36b 100644
--- a/librt/mq_timedreceive.c
+++ b/librt/mq_timedreceive.c
@@ -9,12 +9,16 @@
#include <cancel.h>
#if defined(__UCLIBC_USE_TIME64__) && defined(__NR_mq_timedreceive_time64)
-#define __NR___mq_timedreceive_nocancel __NR_mq_timedreceive_time64
+#include "internal/time64_helpers.h"
+
+int _NC(mq_timedreceive)(mqd_t mqdes, char *restrict msg_ptr, size_t msg_len, unsigned int *restrict msq_prio, const struct timespec *restrict abs_timeout)
+{
+ return INLINE_SYSCALL(mq_timedreceive_time64, 5, mqdes, msg_ptr, msg_len, msq_prio, TO_TS64_P(abs_timeout));
+}
#else
#define __NR___mq_timedreceive_nocancel __NR_mq_timedreceive
-#endif
-
_syscall5(ssize_t, __NC(mq_timedreceive), mqd_t, mqdes, char *__restrict, msg_ptr, size_t, msg_len, unsigned int *__restrict, msq_prio, const struct timespec *__restrict, abs_timeout)
+#endif
CANCELLABLE_SYSCALL(ssize_t, mq_timedreceive, (mqd_t mqdes, char *__restrict msg_ptr, size_t msq_len, unsigned int *__restrict msq_prio, const struct timespec *__restrict abs_timeout),
(mqdes, msg_ptr, msq_len, msq_prio, abs_timeout))