Re: [PATCH] Read THREAD_CPUTIME clock from other processes.

From: Dario Faggioli
Date: Fri Dec 24 2010 - 06:36:30 EST


On Thu, 2010-12-23 at 18:38 +0100, Dario Faggioli wrote:
> > > rcu_read_lock();
> > > p = find_task_by_vpid(pid);
> > > - if (!p || !(CPUCLOCK_PERTHREAD(which_clock) ?
> > > - same_thread_group(p, current) : has_group_leader_pid(p))) {
> > > + if (!p)
> > > error = -EINVAL;
> > > - }
> >
> > This changes the behaviour of sys_clock_settime(). Probably doesn't
> > matter since it does nothing, but perhaps !CPUCLOCK_PERTHREAD &&
> > !group_leader should result in -EINAVL as before.
> >
> Oops, sure, you're right, I can fix this. :-)
>
Mmm... This is trickier than I remembered expected. Apparently, glibc
always gives us a !CPUCLOCK_PERTHREAD() clockid, since it uses
MAKE_PROCESS_CLOCK() when clock_cpugetclockid is called.

Therefore, the take two of this thing will be a little different from
this first posting...

Thanks and Regards,
Dario

--
<<This happens because I choose it to happen!>> (Raistlin Majere)
----------------------------------------------------------------------
Dario Faggioli, ReTiS Lab, Scuola Superiore Sant'Anna, Pisa (Italy)

http://retis.sssup.it/people/faggioli -- dario.faggioli@xxxxxxxxxx

Attachment: signature.asc
Description: This is a digitally signed message part