From owner-freebsd-hackers Thu Mar 18 17: 8: 1 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from lion.butya.kz (butya-gw.butya.kz [194.87.112.252]) by hub.freebsd.org (Postfix) with ESMTP id D702214F17 for ; Thu, 18 Mar 1999 17:07:54 -0800 (PST) (envelope-from bp@butya.kz) Received: from bp (helo=localhost) by lion.butya.kz with local-esmtp (Exim 2.12 #1) id 10NnmH-00042r-00; Fri, 19 Mar 1999 07:08:45 +0600 Date: Fri, 19 Mar 1999 07:08:45 +0600 (ALMT) From: Boris Popov To: Dan Seguin Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: KLD extern calls In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Thu, 18 Mar 1999, Dan Seguin wrote: > Is it possible to make calls to std libs from within a KLD? For example, > getpwuid()? If so, how does one link it in? I've tried ld by hand No, you can't use stdlibs call without a user process. The simplest way is to create daemon which will call KLD via syscall. This call should sleep on entry. Whenever KLD want to call stdlib's function it should fill necessary arguments, wakeup sleeping call which will pass them back to daemon and receive reply via the same syscall. Of course, you should define a simple protocol between daemon and KLD and avoid mess with request/reply. The same goal can be achieved via socket interface. -- | Boris Popov | http://www.butya.kz/~bp/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message