From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 2 02:47:53 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C75EF16A4CE for ; Fri, 2 Jul 2004 02:47:53 +0000 (GMT) Received: from cs.columbia.edu (cs.columbia.edu [128.59.16.20]) by mx1.FreeBSD.org (Postfix) with ESMTP id 82F0843D53 for ; Fri, 2 Jul 2004 02:47:53 +0000 (GMT) (envelope-from mre2007@cs.columbia.edu) Received: from hydra.cs.columbia.edu (IDENT:y8RVnxD3qU4KH4uViY4XJjCaBDAJd0jd@hydra.cs.columbia.edu [128.59.16.129]) by cs.columbia.edu (8.12.10/8.12.10) with ESMTP id i622kDfq002643 verify=NOT); Thu, 1 Jul 2004 22:46:13 -0400 (EDT) Received: from webmail.cs.columbia.edu (IDENT:QpAMXDjRHOC/hRiQPmPUFZnhlccNCOja@localhost [127.0.0.1]) i622kCXt021799; Thu, 1 Jul 2004 22:46:12 -0400 Received: from 24.243.189.238 (SquirrelMail authenticated user mre2007) by webmail.cs.columbia.edu with HTTP; Thu, 1 Jul 2004 22:46:12 -0400 (EDT) Message-ID: <33087.24.243.189.238.1088736372.squirrel@webmail.cs.columbia.edu> Date: Thu, 1 Jul 2004 22:46:12 -0400 (EDT) From: mre2007@cs.columbia.edu To: freebsd-hackers@freebsd.org User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-PMX-Version: 4.6.0.99824, Antispam-Core: 4.6.1.104326, Antispam-Data: 2004.7.1.105720 X-PerlMx-Spam: Gauge=X, Probability=10%, Report='PRIORITY_NO_NAME 0.716, FROM_ENDS_IN_NUMS 0.001, NO_REAL_NAME 0.000, __FROM_ENDS_IN_NUMS 0, __TO_MALFORMED_2 0, __USER_AGENT 0, __MIME_VERSION 0, __EVITE_CTYPE 0, __CT_TEXT_PLAIN 0, __CT 0, __CTE 0, __HAS_X_PRIORITY 0, __MIME_TEXT_ONLY 0, __HAS_MSGID 0, __SANE_MSGID 0, USER_AGENT 0.000' Subject: Dealing with an orphaned function inside the kernel X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Jul 2004 02:47:53 -0000 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