.\" Copyright (C) 1996 Free Software Foundation, Inc. .\" This file is distributed accroding to the GNU General Public License. .\" See the file COPYING in the top level source directory for details. .\" .\" Translated 20 Feb 1998 by Vicente Pastor Gómez .\" .TH INIT_MODULE 2 "26 Dic 1996" "Linux 2.1.17" "Soporte de Módulos de Linux" .SH NOMBRE init_module \- inicializa una entrada de módulo cargable .SH SINOPSIS .nf .B #include .sp .BI "int init_module(const char *" name ", struct module *" image ); .fi .SH DESCRIPCIÓN .B init_module carga la imagen del módulo relocalizado en el espacio del núcleo y ejecuta la función \fIinit\fP del módulo. .PP La imagen del módulo comienza con una estructura de módulo seguida por código y datos apropiados. La estructura de módulo se define así: .PP .RS .nf 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 }; .fi .RE .PP Se espera que todos los punteros, a excepción de \fInext\fP y \fIrefs\fP, apunten dentro del cuerpo del módulo, y estén inicializados adecuadamente al espacio del núcleo, p.ej. relocalizados con el resto del módulo. .PP Esta llamada de sistema sólo esta abierta al superusuario. .SH "VALOR DEVUELTO" Si hay éxito, se devuelve cero. Si hay algún error, se devuelve \-1 y \fIerrno\fP es actualizado. .SH ERRORES .TP .B EPERM El usuario no es el superusuario. .TP .B ENOENT No existe ningún módulo con ese nombre. .TP .B EINVAL Alguna entrada de \fIimage\fP se llenó incorrectamente, \fIimage->name\fP no se corresponde con el nombre original del módulo, alguna entrada de \fIimage->deps\fP no se corresponde con un módulo cargado, o alguna otra inconsistencia similar. .TP .B EBUSY La rutina de inicialización del módulo falló. .TP .B EFAULT \fIname\fP o \fIimage\fP está fuera del espacio de direcciones accesible al programa. .SH "VÉASE TAMBIÉN" .BR create_module "(2), " delete_module "(2), " query_module "(2)."