Most *config(8) programs, such as ifconfig(8), mdconfig(8), and
ccdconfig(8), attempt to load their corresponding module if it isn't
already loaded, or already compiled into the kernel.  Looking at these
programs, they achieve this task in (primarily) two different ways.

The first uses modfind() then kldload() (e.g., see ccdconfig.c r1.19
l174).  Others use a combination of kldnext(), modfnext(), and some
loops to do this (e.g., see ifconfig.c r1.64 l1911).  Is there any
difference between these two, and which one is preferred (I'd think
the former if there is no difference).

It would be nice if they all did the same thing.  Once it's determined
which method is preferred, I'd like to propose a kldmaybeload(3)
routine that takes a module name and loads it if it's not already
loaded or compiled in.  For now this just factors out some common
code, but it may save headaches later if the kld interface is changed
so that neither of these methods work without modification (with a
kldmaybeload, it'd be sufficient just to modify the library function).

Thanks for any insight.

                                        Dima Dorfman


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to