Re: RFC: A revised timerfd API

Thomas Gleixner
2007-09-18T11:30:26Z

On Tue, 2007-09-18 at 13:08 +0200, Michael Kerrisk wrote:
> > > it does make the API a little more clumsy.
> >
> > Hmm, we might do something like:
> >
> > timer_gettime(fd | POSIX_TIMER_FD, .....);
> >
> > So the kernel looks up the fd in order to figure out the timer_id, which
> > needs to be referenced in filep->private_data anyway.
>
> And you'd need similar for timer_settime() and, perhaps,
> timer_getoverrun(). But it seems slightly ugly, in the same way that
> my idea in option (d) of returning a file descriptor from
> timer_create() seems a slightly ugly. (And can we guarantee that
> the [timerid] space is distinct from the [fd|POSIX_TIMER_FD] space?)

If we use the most significant bit for POSIX_TIMER_FD, we should be
fine.

tglx