From owner-freebsd-arch Mon Dec 31 1:38:56 2001 Delivered-To: freebsd-arch@freebsd.org Received: from espresso.q9media.com (espresso.q9media.com [216.254.138.122]) by hub.freebsd.org (Postfix) with ESMTP id BEC6137B42A; Mon, 31 Dec 2001 01:38:49 -0800 (PST) Received: (from mike@localhost) by espresso.q9media.com (8.11.6/8.11.6) id fBV9aXO55673; Mon, 31 Dec 2001 04:36:33 -0500 (EST) (envelope-from mike) Date: Mon, 31 Dec 2001 04:36:33 -0500 From: Mike Barcroft To: Peter Pentchev Cc: Mike Smith , arch@freebsd.org Subject: kldload(2) family (was Re: loadable aio) Message-ID: <20011231043633.E45114@espresso.q9media.com> References: <20011230215630.B45114@espresso.q9media.com> <200112310508.fBV58MI03596@mass.dis.org> <20011231034807.D45114@espresso.q9media.com> <20011231105940.B3512@straylight.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011231105940.B3512@straylight.oblivion.bg>; from roam@ringlet.net on Mon, Dec 31, 2001 at 10:59:40AM +0200 Organization: The FreeBSD Project Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [Moved to -arch, BCC'd to -hackers.] Peter Pentchev writes: > Okay, so it's not documented in the manual, but one look at the source > should suffice :) :( > As Mike said, there is a search path. However, the current directory > is tried first. If a file by that name is not found in the current > directory, the search path is, well, searched ;) The search path > is available in the kern.module_path sysctl or in the output of > 'kldconfig -r'. Oh no, it's worse than I feared. > This is similar to what shells have been doing for decades, with > the added feature of an implicit '.' at the start of the search path. Yes, the usual approach shells take is much better designed. Here's how I would design this interface: o _kldload(2) accepts a file path (similar to open(2)) o kldunload(2) accepts a filename (no path) o kldload(3) accepts a module name (procfs), file name (procfs.ko), or file path (/boot/kernel/procfs.ko). o Search paths for kldload(3) are controlled by the environment variable `KLDPATH' (similar to MANPATH and PATH). o When kldload(3) locates a module file, it calls _kldload(2). o kldload(8) uses kldload(3) o kldunload(8) uses kldunload(2) The main advantage of this design is that it allows a Unix programmer to utilize it. :) Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message