Autoloading modules after socket calls.

View: New views
2 Messages — Rating Filter:   Alert me  

Autoloading modules after socket calls.

by Jonathan Walsh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am not sure how used this list is, but it seemed like a good place to
ask this sort of question.  I was wondering if there is a way to have
the kernel autoload a module on a failed call to something that requires
it.  For example if I have sctp compiled as a module, but not inserted,
and I make a call to socket() requesting a IPPROTO_SCTP socket it will
fail with EPROTONOSUPPORT.  Is there a way in some sort of kernel
configuration of specifying that the sctp module should be swapped in at
this point?  I could write code to pick up this error and insert the
module myself, but I was hoping for a way for the kernel to
automatically do it for me.

Thanks,

Jonathan Walsh
Associate Member Engineering Staff
Lockheed Martin Advanced Technology Laboratories
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Re: Autoloading modules after socket calls.

by Steve Graegert :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 1/15/07, Jonathan Walsh <jwalsh@...> wrote:

> I am not sure how used this list is, but it seemed like a good place to
> ask this sort of question.  I was wondering if there is a way to have
> the kernel autoload a module on a failed call to something that requires
> it.  For example if I have sctp compiled as a module, but not inserted,
> and I make a call to socket() requesting a IPPROTO_SCTP socket it will
> fail with EPROTONOSUPPORT.  Is there a way in some sort of kernel
> configuration of specifying that the sctp module should be swapped in at
> this point?  I could write code to pick up this error and insert the
> module myself, but I was hoping for a way for the kernel to
> automatically do it for me.

Jonathan,

maybe "kmod" is what you're looking for.  kmod performs background
monitoring and makes sure the required modules are loaded by modprobe
as soon as the respective functionality is needed in the kernel, but
it is not designed to unload modules automatically.

Simply activate the option 'Kernel module loader'  (CONFIG_KMOD) in
the kernel configuration.  It is available for both Kernel versions
2.4 and 2.6, respectively.

       \Steve

--

Steve Graegert <steve@...>
Jabber    xmpp://graegerts@...
Internet  http://eth0.graegert.com, http://blog.graegert.com
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html