On Sat, 4 Oct 2003, Hans-Georg Thien wrote:Hello Richard, - It seems, that I should be more precise about what I exactly mean...
[...]I am looking for a possibility to read out the last timestamp when an
interrupt has occured.
e.g.: the user presses a key on the keyboard. Where can I read out the
timestamp of this event?
You can get A SIGIO signal for every keyboard, (or other input) event.
What you do with it is entirely up to you. Linux/Unix doesn't have
"callbacks", instead it has signals. It also has select() and poll(),
all useful for handling such events. If you want a time-stamp, you
call gettimeofday() in your signal handler.
Thanks a lot Richard,
... but ... can I use signals in kernel mode?
Well you talked about the user pressing a key and getting
a time-stamp as a result. If you need time-stamps
inside the kernel, i.e, a module, then you can call
the kernel's do_gettimeofday() function.