Use the new timeout facilities for ITIMER_REAL.
authorart <art@openbsd.org>
Thu, 23 Mar 2000 15:55:52 +0000 (15:55 +0000)
committerart <art@openbsd.org>
Thu, 23 Mar 2000 15:55:52 +0000 (15:55 +0000)
sys/kern/kern_exec.c
sys/kern/kern_exit.c
sys/kern/kern_time.c

index aab9464..15ed8af 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: kern_exec.c,v 1.40 2000/03/22 21:35:37 mickey Exp $   */
+/*     $OpenBSD: kern_exec.c,v 1.41 2000/03/23 15:55:52 art Exp $      */
 /*     $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $  */
 
 /*-
@@ -566,7 +566,7 @@ sys_execve(p, v, retval)
        if (p->p_flag & P_SUGIDEXEC) {
                int i, s = splclock();
 
-               untimeout(realitexpire, (void *)p);
+               timeout_del(&p->p_realit_to);
                timerclear(&p->p_realtimer.it_interval);
                timerclear(&p->p_realtimer.it_value);
                for (i = 0; i < sizeof(p->p_stats->p_timer) /
index b7d6195..5efdeea 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: kern_exit.c,v 1.21 2000/02/21 20:00:09 art Exp $      */
+/*     $OpenBSD: kern_exit.c,v 1.22 2000/03/23 15:55:52 art Exp $      */
 /*     $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $  */
 
 /*
@@ -134,7 +134,7 @@ exit1(p, rv)
        }
        p->p_sigignore = ~0;
        p->p_siglist = 0;
-       untimeout(realitexpire, (caddr_t)p);
+       timeout_del(&p->p_realit_to);
 
        /*
         * Close open files and release open-file table.
index eac35bc..736fe37 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: kern_time.c,v 1.17 2000/03/17 22:24:26 jakob Exp $    */
+/*     $OpenBSD: kern_time.c,v 1.18 2000/03/23 15:55:52 art Exp $      */
 /*     $NetBSD: kern_time.c,v 1.20 1996/02/18 11:57:06 fvdl Exp $      */
 
 /*
@@ -486,10 +486,11 @@ sys_setitimer(p, v, retval)
                return (EINVAL);
        s = splclock();
        if (SCARG(uap, which) == ITIMER_REAL) {
-               untimeout(realitexpire, (void *)p);
+               timeout_del(&p->p_realit_to);
                if (timerisset(&aitv.it_value)) {
                        timeradd(&aitv.it_value, &time, &aitv.it_value);
-                       timeout(realitexpire, (void *)p, hzto(&aitv.it_value));
+                       timeout_set(&p->p_realit_to, realitexpire, p);
+                       timeout_add(&p->p_realit_to, hzto(&aitv.it_value));
                }
                p->p_realtimer = aitv;
        } else
@@ -524,8 +525,8 @@ realitexpire(arg)
                timeradd(&p->p_realtimer.it_value,
                    &p->p_realtimer.it_interval, &p->p_realtimer.it_value);
                if (timercmp(&p->p_realtimer.it_value, &time, >)) {
-                       timeout(realitexpire, (void *)p,
-                           hzto(&p->p_realtimer.it_value));
+                       timeout_add(&p->p_realit_to,
+                                   hzto(&p->p_realtimer.it_value));
                        splx(s);
                        return;
                }