I have following lines for kevent
in the man
:
EVFILT_TIMER Establishes an arbitrary timer identified by ident.
When adding a timer, data specifies the moment to
fire the timer (for NOTE_ABSTIME) or the timeout
period. The timer will be periodic unless EV_ONESHOT
or NOTE_ABSTIME is specified. On return, data
contains the number of times the timeout has expired
since the last call to kevent(). For non-monotonic
timers, this filter automatically sets the EV_CLEAR
flag internally.
The filter accepts the following flags in the fflags
argument:
NOTE_SECONDS data is in seconds.
NOTE_MSECONDS data is in milliseconds.
NOTE_USECONDS data is in microseconds.
NOTE_NSECONDS data is in nanoseconds.
NOTE_ABSTIME The specified expiration time is
absolute.
If fflags is not set, the default is milliseconds.
On return, fflags contains the events which triggered
the filter.
Now, I do not understand the last line:
On return, fflags contains the events which triggered the filter.
I mean literally, I do not understand the sentence. The event by the definition is a struct. How can fflags
contain "events"?
Update
The return value of fflags
of EVFILT_TIMER
is the same as that was passed in. Thanks to OP of accepted answer.
According to the
FreeBSD-13.0-RELEASE-p11
sources:From what we see in
/usr/src/sys/kern/kern_event.c
(as an example of use):The value of the
u_int event
above in one from some defined in/usr/include/sys/event.h
which areu_int
too.So, the
fflags
is used as input and output as well as defined in the man page:You will find the
event
referred byfflags
in/usr/include/sys/event.h