safe_syscall4(int, semtimedop, int, semid, struct sembuf *, tsops,
unsigned, nsops, const struct timespec *, timeout)
#endif
-#ifdef TARGET_NR_mq_timedsend
+#if defined(TARGET_NR_mq_timedsend) || \
+ defined(TARGET_NR_mq_timedsend_time64)
safe_syscall5(int, mq_timedsend, int, mqdes, const char *, msg_ptr,
size_t, len, unsigned, prio, const struct timespec *, timeout)
#endif
-#ifdef TARGET_NR_mq_timedreceive
+#if defined(TARGET_NR_mq_timedreceive) || \
+ defined(TARGET_NR_mq_timedreceive_time64)
safe_syscall5(int, mq_timedreceive, int, mqdes, char *, msg_ptr,
size_t, len, unsigned *, prio, const struct timespec *, timeout)
#endif
#if defined(TARGET_NR_clock_settime64) || defined(TARGET_NR_futex_time64) || \
defined(TARGET_NR_timer_settime64) || \
+ defined(TARGET_NR_mq_timedsend_time64) || \
+ defined(TARGET_NR_mq_timedreceive_time64) || \
(defined(TARGET_NR_timerfd_settime64) && defined(CONFIG_TIMERFD))
static inline abi_long target_to_host_timespec64(struct timespec *host_ts,
abi_ulong target_addr)
}
return ret;
#endif
+#ifdef TARGET_NR_mq_timedsend_time64
+ case TARGET_NR_mq_timedsend_time64:
+ {
+ struct timespec ts;
+
+ p = lock_user(VERIFY_READ, arg2, arg3, 1);
+ if (arg5 != 0) {
+ if (target_to_host_timespec64(&ts, arg5)) {
+ return -TARGET_EFAULT;
+ }
+ ret = get_errno(safe_mq_timedsend(arg1, p, arg3, arg4, &ts));
+ if (!is_error(ret) && host_to_target_timespec64(arg5, &ts)) {
+ return -TARGET_EFAULT;
+ }
+ } else {
+ ret = get_errno(safe_mq_timedsend(arg1, p, arg3, arg4, NULL));
+ }
+ unlock_user(p, arg2, arg3);
+ }
+ return ret;
+#endif
#ifdef TARGET_NR_mq_timedreceive
case TARGET_NR_mq_timedreceive:
}
return ret;
#endif
+#ifdef TARGET_NR_mq_timedreceive_time64
+ case TARGET_NR_mq_timedreceive_time64:
+ {
+ struct timespec ts;
+ unsigned int prio;
+
+ p = lock_user(VERIFY_READ, arg2, arg3, 1);
+ if (arg5 != 0) {
+ if (target_to_host_timespec64(&ts, arg5)) {
+ return -TARGET_EFAULT;
+ }
+ ret = get_errno(safe_mq_timedreceive(arg1, p, arg3,
+ &prio, &ts));
+ if (!is_error(ret) && host_to_target_timespec64(arg5, &ts)) {
+ return -TARGET_EFAULT;
+ }
+ } else {
+ ret = get_errno(safe_mq_timedreceive(arg1, p, arg3,
+ &prio, NULL));
+ }
+ unlock_user(p, arg2, arg3);
+ if (arg4 != 0) {
+ put_user_u32(prio, arg4);
+ }
+ }
+ return ret;
+#endif
/* Not implemented for now... */
/* case TARGET_NR_mq_notify: */