text
stringlengths
0
234
this clock is like
.br clock_boottime ,
but will wake the system if it is suspended.
the caller must have the
.b cap_wake_alarm
capability in order to set a timer against this clock.
.pp
see
.br clock_getres (2)
for some further details on the above clocks.
.pp
the current value of each of these clocks can be retrieved using
.br clock_gettime (2).
.pp
starting with linux 2.6.27, the following values may be bitwise ored in
.ir flags
to change the behavior of
.br timerfd_create ():
.tp 14
.b tfd_nonblock
set the
.br o_nonblock
file status flag on the open file description (see
.br open (2))
referred to by the new file descriptor.
using this flag saves extra calls to
.br fcntl (2)
to achieve the same result.
.tp
.b tfd_cloexec
set the close-on-exec
.rb ( fd_cloexec )
flag on the new file descriptor.
see the description of the
.b o_cloexec
flag in
.br open (2)
for reasons why this may be useful.
.pp
in linux versions up to and including 2.6.26,
.i flags
must be specified as zero.
.ss timerfd_settime()
.br timerfd_settime ()
arms (starts) or disarms (stops)
the timer referred to by the file descriptor
.ir fd .
.pp
the
.i new_value
argument specifies the initial expiration and interval for the timer.
the
.i itimerspec
structure used for this argument contains two fields,
each of which is in turn a structure of type
.ir timespec :
.pp
.in +4n
.ex
struct timespec {
time_t tv_sec; /* seconds */
long tv_nsec; /* nanoseconds */
};
struct itimerspec {
struct timespec it_interval; /* interval for periodic timer */
struct timespec it_value; /* initial expiration */
};
.ee
.in
.pp
.i new_value.it_value
specifies the initial expiration of the timer,
in seconds and nanoseconds.
setting either field of
.i new_value.it_value
to a nonzero value arms the timer.
setting both fields of
.i new_value.it_value
to zero disarms the timer.
.pp
setting one or both fields of
.i new_value.it_interval
to nonzero values specifies the period, in seconds and nanoseconds,
for repeated timer expirations after the initial expiration.
if both fields of
.i new_value.it_interval
are zero, the timer expires just once, at the time specified by
.ir new_value.it_value .
.pp
by default,
the initial expiration time specified in
.i new_value
is interpreted relative to the current time
on the timer's clock at the time of the call (i.e.,
.i new_value.it_value
specifies a time relative to the current value of the clock specified by
.ir clockid ).
an absolute timeout can be selected via the
.i flags