[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.0811241625050.3301@localhost.localdomain>
Date: Mon, 24 Nov 2008 16:32:31 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Petr Tesarik <ptesarik@...e.cz>
cc: LKML <linux-kernel@...r.kernel.org>,
Oleg Nesterov <oleg@...hat.com>,
Roland McGrath <roland@...hat.com>
Subject: Re: Fix clock_gettime with CLOCK_PROCESS_CPUTIME_ID
On Mon, 24 Nov 2008, Petr Tesarik wrote:
> Since CLOCK_PROCESS_CPUTIME_ID is in fact translated to -6, the switch
> statement in cpu_clock_sample_group() must first mask off the irrelevant
> bits, similar to cpu_clock_sample().
>
> Signed-off-by: Petr Tesarik <ptesarik@...e.cz>
Good catch. Applied.
Thanks,
tglx
> --
> posix-cpu-timers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/posix-cpu-timers.c b/kernel/posix-cpu-timers.c
> --- a/kernel/posix-cpu-timers.c
> +++ b/kernel/posix-cpu-timers.c
> @@ -311,7 +311,7 @@ static int cpu_clock_sample_group(const clockid_t which_clock,
> struct task_cputime cputime;
>
> thread_group_cputime(p, &cputime);
> - switch (which_clock) {
> + switch (CPUCLOCK_WHICH(which_clock)) {
> default:
> return -EINVAL;
> case CPUCLOCK_PROF:
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists