1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
|
.\" 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 Gmez <VPASTORG@santandersupernet.com , vicpastor@hotmail.com>
.TH INIT_MODULE 2 "26 Dic 1996" "Linux 2.1.17" "Soporte de Mdulos de Linux"
.SH NOMBRE
init_module \- inicializa una entrada de mdulo cargable
.SH SINOPSIS
.nf
.B #include <linux/module.h>
.sp
.BI "int init_module(const char *" name ", struct module *" image );
.fi
.SH DESCRIPCIN
.B init_module
carga la imagen del mdulo relocalizado en el espacio del kernel y ejecuta
la funcin \fIinit\fP del mdulo.
.PP
La imagen del mdulo comienza con una estructura de mdulo seguida por
cdigo y datos apropiados. La estructura de mdulo 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 excepcin de \fInext\fP y \fIrefs\fP,
apunten dentro del cuerpo del mdulo, y estn inicializados adecuadamente
al espacio del kernel, p.ej. relocalizados con el resto del mdulo.
.PP
Esta llamada de sistema slo esta abierta al superusuario.
.SH "VALOR REGRESADO"
Si hay xito, se devuelve cero. Si hay algn 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 ningn mdulo 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 mdulo, alguna entrada de
\fIimage->deps\fP no se corresponde con un mdulo cargado, o alguna otra
inconsistencia similar.
.TP
.B EBUSY
La rutina de inicializacin del mdulo fall.
.TP
.B EFAULT
\fIname\fP o \fIimage\fP est fuera del espacio de direcciones accesible
al programa.
.SH "VASE TAMBIN"
.BR create_module "(2), " delete_module "(2), " query_module "(2)."
|