Dealing with an orphaned function inside the kernel

mre2007 at cs.columbia.edu mre2007 at cs.columbia.edu
Thu Jul 1 19:47:53 PDT 2004


FreeBSD Hackers:

I am trying to use the sched_bind() function from sched.h inside a kernel
module and having difficulties. It seems that sched_bind() is orphaned
inside of sys/kern. I'm not sure how to stop the kernel linker from
garbage collecting this function, due to the fact that it is never
actually used in the kernel. I determined this to be the case by noticing
that:

nm `sysctl -n kern.bootfile` | grep sched_bind

doesn't return the symbol, and the fact that I grepped for sched_bind and
didn't see it anywhere else other than the schedule files. When I try to
load my kernel module using this function, I get the message:

link_elf: symbol sched_bind undefined

What's the proper way to remedy this situation? Maybe a function pointer
in an innocuous place in the code? Can someone provide a good example
perhaps of the proper way to do this?

Thanks in advance,
-Marc Eisenbarth


More information about the freebsd-hackers mailing list