mq_timedsend.c 1.0 KB

12345678910111213141516171819202122232425
  1. /*
  2. * Copyright (C) 2017 Waldemar Brodkorb <wbx@uclibc-ng.org>
  3. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  4. */
  5. #include <sys/syscall.h>
  6. #include <mqueue.h>
  7. #include <unistd.h>
  8. #include <cancel.h>
  9. #if defined(__UCLIBC_USE_TIME64__) && defined(__NR_mq_timedsend_time64)
  10. #include "internal/time64_helpers.h"
  11. int _NC(mq_timedsend)(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned int msq_prio, const struct timespec *abs_timeout)
  12. {
  13. return INLINE_SYSCALL(mq_timedsend_time64, 5, mqdes, msg_ptr, msg_len, msq_prio, TO_TS64_P(abs_timeout));
  14. }
  15. #else
  16. #define __NR___mq_timedsend_nocancel __NR_mq_timedsend
  17. _syscall5(int, __NC(mq_timedsend), mqd_t, mqdes, const char *, msg_ptr, size_t, msg_len, unsigned int, msq_prio, const struct timespec *, abs_timeout)
  18. #endif
  19. CANCELLABLE_SYSCALL(int, mq_timedsend, (mqd_t mqdes, const char *msg_ptr, size_t msq_len, unsigned int msq_prio, const struct timespec *abs_timeout),
  20. (mqdes, msg_ptr, msq_len, msq_prio, abs_timeout))
  21. lt_libc_hidden(mq_timedsend)