lkml.org 
[lkml]   [2002]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: 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/

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