*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> init_module (2)              
Title
Content
Arch
Section
 

INIT_MODULE(2)

Contents


NAME    [Toc]    [Back]

       init_module - initialize a loadable module entry

SYNOPSIS    [Toc]    [Back]

       #include <linux/module.h>

       int init_module(const char *name, struct module *image);

DESCRIPTION    [Toc]    [Back]

       init_module loads the relocated module image into kernel space and runs
       the module's init function.

       The module image begins with a module structure and is followed by code
       and data as appropriate.  The module structure is defined as follows:

	      struct module
	      {
		unsigned long size_of_struct;
		struct module *next;
		const char *name;
		unsigned long size;
		long usecount;
		unsigned long flags;
		unsigned int nsyms;
		unsigned int ndeps;
		struct module_symbol *syms;
		struct module_ref *deps;
		struct module_ref *refs;
		int (*init)(void);
		void (*cleanup)(void);
		const struct exception_table_entry *ex_table_start;
		const struct exception_table_entry *ex_table_end;
	      #ifdef __alpha__
		unsigned long gp;
	      #endif
	      };

       All  of	the  pointer  fields, with the exception of next and refs, are
       expected to point within the module body and be initialized  as	appropriate
 for kernel space, i.e. relocated with the rest of the module.

       This system call is only open to the superuser.

RETURN VALUE    [Toc]    [Back]

       On  success,  zero  is returned.  On error, -1 is returned and errno is
       set appropriately.

ERRORS    [Toc]    [Back]

       EPERM  The user is not the superuser.

       ENOENT No module by that name exists.

       EINVAL Some image slot filled in incorrectly, image->name does not correspond
 to the original module name, some image->deps entry does
	      not correspond to a loaded module, or some other similar	inconsistency.


       EBUSY  The module's initialization routine failed.

       EFAULT name or image is outside the program's accessible address space.

SEE ALSO    [Toc]    [Back]

      
      
       create_module(2), delete_module(2), query_module(2).



Linux 2.1.17			  26 Dec 1996			INIT_MODULE(2)
[ Back ]
 Similar pages
Name OS Title
create_module Linux create a loadable module entry
delete_module Linux delete a loadable module entry
insmod Linux install loadable kernel module
snmpmod FreeBSD SNMP daemon loadable module interface
CSSM_ModuleLoad Tru64 Initialize the security service module (CDSA)
rmmod Linux unload loadable modules
ldr_inq_region Tru64 Return module information about a region in a loaded module
lkm OpenBSD Loadable Kernel Modules interface
VFS_SET FreeBSD set up loadable file system vfsconf
mload IRIX dynamically loadable kernel modules
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service