/*
- * linux/kernel/posix_timers.c
+ * linux/kernel/posix-timers.c
*
*
* 2002-10-15 Posix Clocks & timers
#include <linux/wait.h>
#include <linux/workqueue.h>
#include <linux/module.h>
+#include <linux/vs_context.h>
/*
* Management arrays for POSIX timers. Timers are kept in slab memory
/*
* Lets keep our timers in a slab cache :-)
*/
-static kmem_cache_t *posix_timers_cache;
+static struct kmem_cache *posix_timers_cache;
static struct idr posix_timers_id;
static DEFINE_SPINLOCK(idr_lock);
int posix_timer_event(struct k_itimer *timr,int si_private)
{
+ struct vx_info_save vxis;
+ int ret;
+
+ enter_vx_info(task_get_vx_info(timr->it_process), &vxis);
memset(&timr->sigq->info, 0, sizeof(siginfo_t));
timr->sigq->info.si_sys_private = si_private;
/* Send signal to the process that owns this timer.*/
if (timr->it_sigev_notify & SIGEV_THREAD_ID) {
struct task_struct *leader;
- int ret;
ret = send_sigqueue(timr->it_sigev_signo, timr->sigq,
timr->it_process);
if (likely(ret >= 0))
- return ret;
+ goto out;
timr->it_sigev_notify = SIGEV_SIGNAL;
leader = timr->it_process->group_leader;
timr->it_process = leader;
}
- return send_group_sigqueue(timr->it_sigev_signo, timr->sigq,
+ ret = send_group_sigqueue(timr->it_sigev_signo, timr->sigq,
timr->it_process);
+out:
+ leave_vx_info(&vxis);
+ put_vx_info(vxis.vxi);
+ return ret;
}
EXPORT_SYMBOL_GPL(posix_timer_event);
return CLOCK_DISPATCH(which_clock, nsleep,
(which_clock, flags, &t, rmtp));
}
+
+/*
+ * nanosleep_restart for monotonic and realtime clocks
+ */
+static int common_nsleep_restart(struct restart_block *restart_block)
+{
+ return hrtimer_nanosleep_restart(restart_block);
+}
+
+/*
+ * This will restart clock_nanosleep. This is required only by
+ * compat_clock_nanosleep_restart for now.
+ */
+long
+clock_nanosleep_restart(struct restart_block *restart_block)
+{
+ clockid_t which_clock = restart_block->arg0;
+
+ return CLOCK_DISPATCH(which_clock, nsleep_restart,
+ (restart_block));
+}