asmlinkage long compat_sys_mq_notify(mqd_t mqdes, const struct compat_sigevent __user *u_notification) { struct sigevent __user *p = NULL; if (u_notification) { struct sigevent n; p = compat_alloc_user_space(sizeof(*p)); if (get_compat_sigevent(&n, u_notification)) return -EFAULT; if (n.sigev_notify == SIGEV_THREAD) n.sigev_value.sival_ptr = compat_ptr(n.sigev_value.sival_int); if (copy_to_user(p, &n, sizeof(*p))) return -EFAULT; } return sys_mq_notify(mqdes, p); }
long compat_sys_timer_create(clockid_t which_clock, struct compat_sigevent __user *timer_event_spec, timer_t __user *created_timer_id) { struct sigevent __user *event = NULL; if (timer_event_spec) { struct sigevent kevent; event = compat_alloc_user_space(sizeof(*event)); if (get_compat_sigevent(&kevent, timer_event_spec) || copy_to_user(event, &kevent, sizeof(*event))) return -EFAULT; } return sys_timer_create(which_clock, event, created_timer_id); }