4 * Created on: Aug 14, 2008
5 * Author: Stefan Bucur <stefanb@zytor.com>
11 #include <sys/module.h>
15 * EXEC_ROOT_NAME - The name of the ELF module associated with the COM32 module.
17 * This is a shallow ELF module, that contains only the symbol table for
18 * the code and data sections of the loaded COM32 root module.
20 #define EXEC_ROOT_NAME "_root_.c32"
23 * spawn_load - Load a library module or executes an executable one
24 * @name the name of the library/executable to use, including the extension
26 * @argc: the number of string arguments in @argv
27 * @argv: a NULL-terminated vector of string arguments, starting with
30 * This procedure in essence loads takes the name of a module and checks to see what
31 * kind of module it is ( executable or library ), after which is performs the
32 * appropriate action, either spawning or simply loading the module into memory.
34 extern int spawn_load(const char *name
, int argc
, char **argv
);
37 * spawnv - Executes a program in the current environment.
38 * @name: the name of the program to spawn, including the extension
40 * @argv: a NULL-terminated vector of string arguments, starting with
43 * A program is an ELF module that contains a main routine. A program is
44 * loaded into memory, executed, then unloaded, thus remaining in memory only
45 * while the main() function is executing. A program also defines a
46 * memory allocation context, and a simple garbage collection mechanism
47 * it thus provided. This is done by internally associating with the program
48 * module each pointer returned by malloc(). After the program finishes
49 * its execution, all the unallocated memory pertaining to the program
50 * is automatically cleaned up.
52 * Note that this association takes place both for the allocations happening
53 * directly in the program, or indirectly through a library function. Libraries
54 * do not create allocation contexts, thus each allocation they made belong
55 * to the innermost calling program.
57 extern int spawnv(const char *name
, const char **argv
);
60 * spawnl - Executes a program in the current environment.
61 * @name: the name of the program to spawn, including the extension
63 * @arg: the first argument (argv[0]) to be passed to the main function
65 * @...: optional subsequent arguments that are passed o the main function
68 * This is another version of the spawn routine. Please see 'spawnv' for
69 * a full presentation.
71 extern int spawnl(const char *name
, const char *arg
, ...);
74 * exec_term - Releases the resources of the execution environment.
76 extern void exec_term(void);