lkml.org 
[lkml]   [1998]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: pre-2.1.90.. (kmod fix)
> Why not try to fork out of the call to request_module?

That was my first approach. It didn't work, but that was a long
time ago and I now know a lot more about the kernel. So, I'm trying to
move the fork/clone/kernel_thread into request_module again. It cleans
things up a lot, and I imagine it would fix the module-loading-modules
problem. After spending most of last night trying this, I reached the
following pseudo-code/conclusions:

request_module(char * name)
{
int pid;

pid = kernel_thread(loader, name, 0);

waitpid(pid, NULL, __WCLONE);
}

loader(void * name)
{
char * argv[] = { "modprobe", "-k", name, NULL };
char * envp[] = { stuff };

execve(modprobe_path, argv, envp);

/* if we reach this, bad news! */
printk("error!\n");
_exit(0);
}

request_module() works just fine (after learning about the
__WCLONE option, that is). The problem is with the execve(). It just
doesn't happen. Unfortunatly, I didn't get a chance to test the return
value or anything.
Any ideas?

--
Kirk Petersen
speakeasy.org/~kirk/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:41    [W:0.042 / U:3.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site