diff options
| author | Paul Saab <ps@FreeBSD.org> | 2005-04-23 16:38:27 +0000 |
|---|---|---|
| committer | Paul Saab <ps@FreeBSD.org> | 2005-04-23 16:38:27 +0000 |
| commit | d52f834a5ffa3bb1af32be059d2f9450bf6cfc25 (patch) | |
| tree | 3c04d76d99a12bfb96e2be4888c1e7c6aa71ebb8 /sys/compat/linux | |
| parent | a6306d69d443d289eef49fd6e4d875dab7b1b9ff (diff) | |
Notes
Diffstat (limited to 'sys/compat/linux')
| -rw-r--r-- | sys/compat/linux/linux_misc.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index 1f5965dbead8..5598f778f7f8 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -186,8 +186,7 @@ int linux_alarm(struct thread *td, struct linux_alarm_args *args) { struct itimerval it, old_it; - struct timeval tv; - struct proc *p; + int error; #ifdef DEBUG if (ldebug(alarm)) @@ -195,32 +194,21 @@ linux_alarm(struct thread *td, struct linux_alarm_args *args) #endif if (args->secs > 100000000) - return EINVAL; + return (EINVAL); it.it_value.tv_sec = (long)args->secs; it.it_value.tv_usec = 0; it.it_interval.tv_sec = 0; it.it_interval.tv_usec = 0; - p = td->td_proc; - PROC_LOCK(p); - old_it = p->p_realtimer; - getmicrouptime(&tv); - if (timevalisset(&old_it.it_value)) - callout_stop(&p->p_itcallout); - if (it.it_value.tv_sec != 0) { - callout_reset(&p->p_itcallout, tvtohz(&it.it_value), - realitexpire, p); - timevaladd(&it.it_value, &tv); - } - p->p_realtimer = it; - PROC_UNLOCK(p); - if (timevalcmp(&old_it.it_value, &tv, >)) { - timevalsub(&old_it.it_value, &tv); + error = kern_setitimer(td, ITIMER_REAL, &it, &old_it); + if (error) + return (error); + if (timevalisset(&old_it.it_value)) { if (old_it.it_value.tv_usec != 0) old_it.it_value.tv_sec++; td->td_retval[0] = old_it.it_value.tv_sec; } - return 0; + return (0); } #endif /*!__alpha__*/ |
