summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exec.c
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-06-17 19:11:55 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-06-17 19:11:55 +0000
commit407e1f7584c8aaaf7209611a864ba04253685690 (patch)
tree0b2da6aa5f947080312c01f7e306c4f4bffe39b8 /sys/kern/kern_exec.c
parent22db4b2e9c63b9f500b2d0f99d94107b5a600444 (diff)
Add support for the _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME options,
including CLOCK_{PROCESS,THREAD}_CPUTIME_ID constants and {clock,pthread}_getcpuclockid() functions. Worked out at t2k13 with help from tedu@ and matthew@ and testing by aja@ ok matthew@
Diffstat (limited to 'sys/kern/kern_exec.c')
-rw-r--r--sys/kern/kern_exec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/kern/kern_exec.c b/sys/kern/kern_exec.c
index 5046191d86b..262352e6944 100644
--- a/sys/kern/kern_exec.c
+++ b/sys/kern/kern_exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_exec.c,v 1.134 2013/03/30 06:32:25 tedu Exp $ */
+/* $OpenBSD: kern_exec.c,v 1.135 2013/06/17 19:11:54 guenther Exp $ */
/* $NetBSD: kern_exec.c,v 1.75 1996/02/09 18:59:28 christos Exp $ */
/*-
@@ -609,6 +609,10 @@ sys_execve(struct proc *p, void *v, register_t *retval)
splx(s);
}
+ /* reset CPU time usage for the thread, but not the process */
+ timespecclear(&p->p_tu.tu_runtime);
+ p->p_tu.tu_uticks = p->p_tu.tu_sticks = p->p_tu.tu_iticks = 0;
+
uvm_km_free_wakeup(exec_map, (vaddr_t) argp, NCARGS);
pool_put(&namei_pool, nid.ni_cnd.cn_pnbuf);