Code Comments
Programming Forum and web based access to our favorite programming groups.Hi All;
I have a program that relies of some modules being loaded. is there a
modprobe() or anything similar? I'm trying to avoid a system("modprobe...")
type call
Thanks
Pat
Post Follow-up to this message> is there a [library function] modprobe() or anything similar?
I suggest running your modprobe command under strace and watching what
system calls it does. man init_module for one of them. What is your
objection to system("modprobe") anyway?
Beware that you can make your program less portable if you do this
since the kernel interface is subject to change while the modprobe
program tries to present a consistent interface. See the "backwards
compatibility" section in the modprobe man page.
--Phil.
Post Follow-up to this messagePat Ford <pat.ford@nrc.ca> wrote:
> I have a program that relies of some modules being loaded. is there a
> modprobe() or anything similar? I'm trying to avoid a system("modprobe..."
)
> type call
I guess you're talking about Linux here. If that assumption is correct
you shouldn't have to invoke modprobe at all - if things are set up
correctly (major device number is associated with the module in the
/etc/modules.conf file) then the module should be loaded automatically
the moment (unless is already is) the device file gets opened.
Regards, Jens
--
\ Jens Thoms Toerring ___ Jens.Toerring@physik.fu-berlin.de
\__________________________ http://www.toerring.de
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.