aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorMichael Kerrisk <mtk.manpages@googlemail.com>2008-07-25 04:47:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 13:53:39 -0400
commitd8878ba3f05ae5bbfad5a6e72e5121c0ea35f989 (patch)
tree31fbf7bd9605c103d8ef9e538beb54da8df04540 /kernel
parente4901f92a8dbe843e76651a50f7a2a6dd3d53474 (diff)
signals: make siginfo_t si_utime + si_sstime report times in USER_HZ, not HZ
In the switch to configurable HZ in 2.6, the treatment of the si_utime and si_stime fields that are exposed to userland via the siginfo structure looks to have been botched. As things stand, these fields report times in units of HZ, so that userland gets information that varies depending on the HZ that the kernel was configured with. This patch changes the reported values to use USER_HZ units. Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com> Acked-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Ingo Molnar <mingo@elte.hu> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/signal.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 0514da573f22..ba60eeeb63aa 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1370,10 +1370,9 @@ void do_notify_parent(struct task_struct *tsk, int sig)
1370 1370
1371 info.si_uid = tsk->uid; 1371 info.si_uid = tsk->uid;
1372 1372
1373 /* FIXME: find out whether or not this is supposed to be c*time. */ 1373 info.si_utime = cputime_to_clock_t(cputime_add(tsk->utime,
1374 info.si_utime = cputime_to_jiffies(cputime_add(tsk->utime,
1375 tsk->signal->utime)); 1374 tsk->signal->utime));
1376 info.si_stime = cputime_to_jiffies(cputime_add(tsk->stime, 1375 info.si_stime = cputime_to_clock_t(cputime_add(tsk->stime,
1377 tsk->signal->stime)); 1376 tsk->signal->stime));
1378 1377
1379 info.si_status = tsk->exit_code & 0x7f; 1378 info.si_status = tsk->exit_code & 0x7f;
@@ -1441,9 +1440,8 @@ static void do_notify_parent_cldstop(struct task_struct *tsk, int why)
1441 1440
1442 info.si_uid = tsk->uid; 1441 info.si_uid = tsk->uid;
1443 1442
1444 /* FIXME: find out whether or not this is supposed to be c*time. */ 1443 info.si_utime = cputime_to_clock_t(tsk->utime);
1445 info.si_utime = cputime_to_jiffies(tsk->utime); 1444 info.si_stime = cputime_to_clock_t(tsk->stime);
1446 info.si_stime = cputime_to_jiffies(tsk->stime);
1447 1445
1448 info.si_code = why; 1446 info.si_code = why;
1449 switch (why) { 1447 switch (why) {