Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Aug 2001 06:38:35 -0700
From:      Dima Dorfman <dima@unixfreak.org>
To:        Ben Smithurst <ben@FreeBSD.org>
Cc:        arch@freebsd.org
Subject:   Re: Library routine to load a kld if it already isn't 
Message-ID:  <20010804133840.067FB3E31@bazooka.unixfreak.org>
In-Reply-To: <20010804074928.A66860@strontium.shef.vinosystems.com>; from ben@FreeBSD.org on "Sat, 4 Aug 2001 07:49:28 %2B0100"

next in thread | previous in thread | raw e-mail | index | archive | help
Ben Smithurst <ben@FreeBSD.org> writes:
> Dima Dorfman wrote:
> 
> > X.Sh ERRORS
> > XAn attempt to load the module may fail for the following reasons:
> > X.Bl -tag -width Er
> > X.It Bq Er EPERM
> 
> I think I'd prefer this section be reduced to
> 
> 	kldmaybeload() may fail and set errno for any of the errors
> 	specified for the routines modfind(2) and kldload(2).
> 
> in the way other libc manual pages do.  That way, there's just one less
> place to update when additional error possibilities are added to those
> functions.

Adding error possibilities is a change in the interface, and shouldn't
done lightly.  Nonetheless, I agree with your idea in general,
although the text you propose is inaccurate.  It doesn't use
modfind(2), it uses kldnext(2), kldfirstmod(2), modfnext(2),
modstat(2), and kldload(2).  Of all of those, only kldstat(2) should
fail.  If any of the others fail, there's either a bug in the routine,
or a bug in the kernel.  (One bug is known: if the module it's
currently checking is unloaed before it calls modfnext(2), or the file
is unloaded before it calls kldnext(2), those functions will fail with
ENOENT.  Now that I think about it, it might be good to document
that.)

Thanks for your comments.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




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