based on a book i'm reading, apparently i can write a loadable
module whose entire source file is nothing more than:

=====
#include <linux/module.h>
#include <linux/jiffies.h>

module_param(jiffies, uint, 444) ;

MODULE_LICENSE("Dual BSD/GPL");
=====

  as you can see, its entire purpose is to make the internal value
"jiffies" available to me under /sys/module and, sure enough, using
the standard kbuild structure, it builds and loads and seems to work.

  but i wasn't aware that you could write a valid loadable module
without at least a call to module_init().  in fact, from
include/linux/init.h:

/* Each module must use one module_init(), or one no_module_init */

  clearly, i'm not doing that.  so, should i have been surprised that
the above is a valid loadable module?  why does it load without a call
to module_init() that returns a success value of zero?

rday

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [EMAIL PROTECTED]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to