]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Y2038: add function __mq_timedsend_time64
authorAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Thu, 7 Sep 2017 22:42:01 +0000 (00:42 +0200)
committerAlbert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr>
Wed, 24 Oct 2018 10:53:27 +0000 (12:53 +0200)
rt/Makefile
rt/Versions
rt/mq_timedsend_time64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/arm/librt.abilist
sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist

index 928f90e4dba8b522af82415e6c93a1fc12e78f60..f6011f46d35ec6ffe4c938ccb4c88ce127252f8d 100644 (file)
@@ -38,7 +38,7 @@ shm-routines   := shm_open shm_unlink
 mq-routines    := mq_open mq_close mq_unlink mq_getattr mq_setattr     \
                  mq_notify mq_send mq_receive mq_timedsend             \
                  mq_timedreceive                                       \
-                 mq_timedreceiv_time64
+                 mq_timedreceiv_time64 mq_timedsend_time64
 
 routines = $(clock-routines)
 
index 25202cff1182006e1374df6bb172341dce11dcad..4844d6b036effc142b50b520c6847c1c6f422e6c 100644 (file)
@@ -43,5 +43,6 @@ librt {
    __timerfd_gettime64;
    __timerfd_settime64;
    __mq_timedreceive64;
+   __mq_timedsend_time64;
   }
 }
diff --git a/rt/mq_timedsend_time64.c b/rt/mq_timedsend_time64.c
new file mode 100644 (file)
index 0000000..7459d94
--- /dev/null
@@ -0,0 +1,52 @@
+/* Add message pointed by MSG_PTR to message queue MQDES, stop blocking
+   on full message queue if ABS_TIMEOUT expires.
+
+   Copyright (C) 2018 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 <errno.h>
+#include <mqueue.h>
+#include <y2038-support.h>
+
+/* 64-bit time version */
+
+int
+__mq_timedsend_time64 (mqd_t mqdes, const char *msg_ptr, size_t msg_len,
+                 unsigned int msg_prio, const struct __timespec64 *abs_timeout)
+{
+  struct timespec ts32, *tsp32 = NULL;
+#ifdef __NR_mq_timedsend_time64
+  int result;
+  
+  if (__y2038_get_kernel_support () > 0)
+    {
+      result = INLINE_SYSCALL (mq_timedsend_time64, 5, mqdes, msg_ptr,
+                              msg_len, msg_prio, abs_timeout);
+      if (result == 0 || errno != ENOSYS)
+        return result;
+      __y2038_set_kernel_support (-1);
+    }
+#endif
+
+  if (abs_timeout)
+    {
+      ts32.tv_sec = abs_timeout->tv_sec;
+      ts32.tv_nsec = abs_timeout->tv_nsec;
+      tsp32 = &ts32;
+    }
+  return mq_timedsend(mqdes, msg_ptr, msg_len, msg_prio, tsp32);
+}
index a056a935c0cf564819f27b63a23c6522195be26a..58e5f4baa1f388dd907292b7ad809b1f6efcdcf8 100644 (file)
@@ -1,4 +1,5 @@
 GLIBC_2.29 __mq_timedreceive64 F
+GLIBC_2.29 __mq_timedsend_time64 F
 GLIBC_2.29 __timer_gettime64 F
 GLIBC_2.29 __timer_settime64 F
 GLIBC_2.29 __timerfd_gettime64 F
index 814232546413ae3999de6d463e8f26f1cab4fef4..7027d8ac78baa537dc79fdf3cfc168c2135c4abf 100644 (file)
@@ -28,6 +28,7 @@ GLIBC_2.2 timer_getoverrun F
 GLIBC_2.2 timer_gettime F
 GLIBC_2.2 timer_settime F
 GLIBC_2.29 __mq_timedreceive64 F
+GLIBC_2.29 __mq_timedsend_time64 F
 GLIBC_2.29 __timer_gettime64 F
 GLIBC_2.29 __timer_settime64 F
 GLIBC_2.29 __timerfd_gettime64 F