26 extern void pedigree_module_unload(
char *name);
27 extern int pedigree_module_is_loaded(
char *name);
28 extern int pedigree_module_get_depending(
char *name,
char *buf,
size_t bufsz);
29 int unload_module(
char *name);
31 int unload_module(
char *name)
33 if (!pedigree_module_is_loaded(name))
35 printf(
"Module %s isn't loaded!\n", name);
38 printf(
"Module %s being unloaded...\n", name);
41 char *dep = (
char *) malloc(256);
42 while (pedigree_module_get_depending(name, dep, 256))
44 if (unload_module(dep) == -1)
49 pedigree_module_unload(name);
50 if (!pedigree_module_is_loaded(name))
52 printf(
"Module %s couldn't been unloaded\n", name);
56 int main(
int argc,
char **argv)
60 printf(
"Usage: %s <module name>\n", argv[0]);
64 return unload_module(argv[1]);