diff options
author | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2017-09-08 00:42:01 +0200 |
---|---|---|
committer | Albert ARIBAUD (3ADEV) <albert.aribaud@3adev.fr> | 2018-10-24 12:53:27 +0200 |
commit | 2db28845c198a77d1a060d1954fed28eb9b8d78a (patch) | |
tree | 48a4be61743d0fc137068672fff2b6f5bbc3cd6f | |
parent | 619f7917420cd973e01654631ff16c08d4e30193 (diff) | |
download | glibc-2db28845c198a77d1a060d1954fed28eb9b8d78a.tar glibc-2db28845c198a77d1a060d1954fed28eb9b8d78a.tar.gz glibc-2db28845c198a77d1a060d1954fed28eb9b8d78a.tar.bz2 glibc-2db28845c198a77d1a060d1954fed28eb9b8d78a.zip |
Y2038: add function __mq_timedsend_time64
-rw-r--r-- | rt/Makefile | 2 | ||||
-rw-r--r-- | rt/Versions | 1 | ||||
-rw-r--r-- | rt/mq_timedsend_time64.c | 52 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/arm/librt.abilist | 1 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist | 1 |
5 files changed, 56 insertions, 1 deletions
diff --git a/rt/Makefile b/rt/Makefile index 928f90e4db..f6011f46d3 100644 --- a/rt/Makefile +++ b/rt/Makefile @@ -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) diff --git a/rt/Versions b/rt/Versions index 25202cff11..4844d6b036 100644 --- a/rt/Versions +++ b/rt/Versions @@ -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 index 0000000000..7459d9452d --- /dev/null +++ b/rt/mq_timedsend_time64.c @@ -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); +} diff --git a/sysdeps/unix/sysv/linux/arm/librt.abilist b/sysdeps/unix/sysv/linux/arm/librt.abilist index a056a935c0..58e5f4baa1 100644 --- a/sysdeps/unix/sysv/linux/arm/librt.abilist +++ b/sysdeps/unix/sysv/linux/arm/librt.abilist @@ -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 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist index 8142325464..7027d8ac78 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/librt.abilist @@ -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 |