On 11/10/06, Helmut Duregger <Helmut.Duregger@xxxxxxxxxxxxxxxxxx> wrote:
The ns_to_timeval is declared in
http://lxr.linux.no/source/include/linux/time.h#L143
and it is defined in here
http://lxr.linux.no/source/kernel/time.c#L633
but I didn't find it exportet anywhere (EXPORT_SYMBOL(ns_to_timeval);).
If it is not exported then it is not visible to your kernel module.
I think there is no such option. I don't see any good solution here either.
You can duplicate the ns_to_timeval implementation in your module,
or patch the kernel and add EXPORT_SYMBOL(ns_to_timeval)
to the end of the kernel/time.c file.
Do you really need to use ktime_to_timeval?
BlackHole
Hello!
We are working on a linux kernel module on AMD64 and are using ktime.h.
Now we want to use ktime_to_timeval, which is defined over a macro for
ns_to_timeval on 64bit cpus, to transform a ktime_t struct to
a struct timeval
(see http://lxr.linux.no/source/include/linux/ktime.h#L111
for the definition of ns_to_timeval).
But the compiler says "ns_to_timeval" is undefinded as a warning. Now
this should not be a problem because I've read it will be resolved when
the module is loaded. But here comes the problem, it is not resolved
and the module not loaded.
Any idea why?
The ns_to_timeval is declared in
http://lxr.linux.no/source/include/linux/time.h#L143
and it is defined in here
http://lxr.linux.no/source/kernel/time.c#L633
but I didn't find it exportet anywhere (EXPORT_SYMBOL(ns_to_timeval);).
If it is not exported then it is not visible to your kernel module.
Do I have to enable some kernel time option and recompile the kernel?
I think there is no such option. I don't see any good solution here either.
You can duplicate the ns_to_timeval implementation in your module,
or patch the kernel and add EXPORT_SYMBOL(ns_to_timeval)
to the end of the kernel/time.c file.
Do you really need to use ktime_to_timeval?
BlackHole