For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > April 2005 > modprobe question









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author modprobe question
Pat Ford

2005-04-15, 3:59 pm

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


phil_gg04@treefic.com

2005-04-15, 3:59 pm

> 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.

Jens.Toerring@physik.fu-berlin.de

2005-04-15, 8:58 pm

Pat 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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com