|
发表于 2003-9-17 19:29:59
|
显示全部楼层
I have encoutered the same problem too, and
I have just studied the difference of module.c between kernel-2.4 and kernel-2.6, VERY different! in fact, the new kernel(2.6.0-test5) use a new module mechanism, and in kernel 2.6 there is no sys_query_module fuction,in which the command QM_MODULES WAS implemented!
asmlinkage long
sys_query_module(const char *name_user, int which, char *buf, size_t bufsize,
size_t *ret)
{
struct module *mod;
int err;
lock_kernel();
if (name_user == NULL)
mod = &kernel_module;
else {
long namelen;
char *name;
if ((namelen = get_mod_name(name_user, &name)) < 0) {
err = namelen;
goto out;
}
err = -ENOENT;
if ((mod = find_module(name)) == NULL) {
put_mod_name(name);
goto out;
}
put_mod_name(name);
}
/* __MOD_ touches the flags. We must avoid that */
atomic_inc(&mod->uc.usecount);
switch (which)
{
case 0:
err = 0;
break;
case QM_MODULES: //QM_MODULES goes here, but not in kernel 2.6 any longer!
err = qm_modules(buf, bufsize, ret);
break;
case QM_DEPS:
err = qm_deps(mod, buf, bufsize, ret);
break;
case QM_REFS:
err = qm_refs(mod, buf, bufsize, ret);
break;
case QM_SYMBOLS:
err = qm_symbols(mod, buf, bufsize, ret);
break;
case QM_INFO:
err = qm_info(mod, buf, bufsize, ret);
break;
default:
err = -EINVAL;
break;
}
atomic_dec(&mod->uc.usecount);
out:
unlock_kernel();
return err;
} |
|