Messages in this thread |  | | From | "Petr Vandrovec" <> | Date | Mon, 2 Sep 2002 18:18:55 +0200 | Subject | Re: kthread execve question |
| |
On 2 Sep 02 at 17:03, Der Herr Hofrat wrote: > > any hint whats wrong ? any pointers to using kernel threads dosc/examples in > general and how to execute user space apps would be appreciated. > > char cmd_path[256] = "/bin/echo"; > > static int exec_cmd(void * kthread_arg) > { > static char * envp[] = { "HOME=/", > "TERM=linux", > "PATH=/:/bin:/usr/bin:/usr/bin", > NULL }; > char *argv[] = { kthread_arg, > ">>", > "/tmp/kthread_echo",
'>>' is bash thing. Try executing "/bin/touch" with "/tmp/testfile" instead. If /tmp/testfile will appear, you got it.
And also do not forget that argv[0] should contain program name, not first argument - so in most cases you want exec_usermodehelper(argv[0], argv, envp) ... Petr Vandrovec
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
|  |