lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1173657008.2964.6.camel@entropy>
Date:	Sun, 11 Mar 2007 16:50:08 -0700
From:	Nicholas Miell <nmiell@...cast.net>
To:	Davide Libenzi <davidel@...ilserver.org>
Cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [patch 6/9] signalfd/timerfd v3 - timerfd core ...

On Sun, 2007-03-11 at 16:13 -0700, Davide Libenzi wrote:
> On Sun, 11 Mar 2007, Davide Libenzi wrote:
> 
> > This patch introduces a new system call for timers events delivered
> > though file descriptors. This allows timer event to be used with
> > standard POSIX poll(2), select(2) and read(2). As a consequence of
> > supporting the Linux f_op->poll subsystem, they can be used with
> > epoll(2) too.
> > The system call is defined as:
> > 
> > int timerfd(int ufd, int clockid, int tmrtype, const struct timespec *utmr);
> > 
> > The "ufd" parameter allows for re-use (re-programming) of an existing
> > timerfd w/out going through the close/open cycle (same as signalfd).
> > If "ufd" is -1, s new file descriptor will be created, otherwise the
> > existing "ufd" will be re-programmed.
> > The "clockid" parameter is either CLOCK_MONOTONIC or CLOCK_REALTIME.
> > The "tmrtype" parameter allows to specify the timer type. The following
> > values are supported:
> > 
> >     TFD_TIMER_REL
> >         The time specified in the "utmr" parameter is a relative time
> > 	from NOW.
> > 
> >     TFD_TIMER_ABS
> >         The timer specified in the "utmr" parameter is an absolute time.
> > 
> >     TFD_TIMER_SEQ
> >         The time specified in the "utmr" parameter is an interval at
> > 	which a continuous clock rate will be generated.
> > 
> 
> Duh! Forgot to update the documenation. Now timerfd() gets an itimerspec.
> For TFD_TIMER_REL only the it_interval is valid, and it's the relative 
> time. For TFD_TIMER_ABS, only the it_value is valid, and that the expiry 
> absolute time. For TFD_TIMER_SEQ, it_value tells when the first tick 
> should be generated, and it_interval tells the period of the following 
> ticks.
> 

You should probably make it behave like the other things that use
itimerspec, just to avoid confusion -- i.e. timers are relative by
default, there's a flag that makes them absolute, they expire when
it_value specifies, and repeat every it_interval nanoseconds if
it_interval is non-zero.

i.e.

int timerfd(int ufd, int clockid, int flags, const struct timespec
*utmr);

with TFD_TIMER_ABS in flags making the timer absolute instead of
relative (and no TFD_TIMER_REL or TFD_TIMER_SEQ at all).

-- 
Nicholas Miell <nmiell@...cast.net>

-
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ