Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Jul 2004 22:46:12 -0400 (EDT)
From:      mre2007@cs.columbia.edu
To:        freebsd-hackers@freebsd.org
Subject:   Dealing with an orphaned function inside the kernel
Message-ID:  <33087.24.243.189.238.1088736372.squirrel@webmail.cs.columbia.edu>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?33087.24.243.189.238.1088736372.squirrel>