Re: How to run an a.out file in a kernel module



Hi,
1) What is the synatx of call_usermodehelper()
function?
I found out that it takes 4 arguments. But
what values we have to pass as argumets.
I did searched in internet. But could not find out.
Sorry to post this question.

2) How to print something using C code such that it
will be displayed when corresponding a.out file is
called in a kernel module using call_usermodehelper()
function.

Thanks in advance.

--- Erik Mouw <erik@xxxxxxxxxxxxxxxxxxxxx> wrote:

On Fri, Oct 27, 2006 at 11:16:11AM +0100, ranjith
kumar wrote:
How to run an a.out file in a kernel
module
I tried to include

system("./a.out");
in the C file. But I got compilation errors.

Simple: you don't. There are a bunch of problems
over here:

1) The system() call is a userland libc call and
doesn't exist in the
kernel
2) You can't be sure you're in user context
3) You don't know in what filesytem namespace you
are

You could use call_usermodehelper() if you really
need to call a
usermode helper, but usually it's a sign of bad
design if you need to.


Erik

--
+-- Erik Mouw -- www.harddisk-recovery.com -- +31 70
370 12 90 --
| Lab address: Delftechpark 26, 2628 XH, Delft, The
Netherlands
-
To unsubscribe from this list: send the line
"unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/





___________________________________________________________
All New Yahoo! Mail ? Tired of Vi@gr@! come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: XFS breakage in 2.6.18-rc1
    ... system disk too who had to take the hit. ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: XFS Bug null pointer dereference in xfs_free_ag_extent
    ... I also filed bug 6877 at kernel.org ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: [patch] remove unused acct variables from task_struct
    ... struct mempolicy *mempolicy; ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: DIPC alpha2 for i386, Alpha, SPARC, and M68k
    ... there seems to be a delay on cs.uwindsor.ca between the time you upload something and the time it actually shows up on the page. ... More majordomo info at http://vger.kernel.org/majordomo-info.html ... Please read the FAQ at http://www.tux.org/lkml/ ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: Accessing tcp socket information from within a module
    ... You don't even need to write your kernel module, ... a special netlink socket provided to userspace exactly for this ... send the line "unsubscribe linux-kernel" in ... More majordomo info at http://vger.kernel.org/majordomo-info.html ...
    (Linux-Kernel)

Loading