From: Erik Mouw <erik@harddisk-recovery.com>
To: ranjith kumar <ranjit_kumar_b4u@yahoo.co.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: How to run an a.out file in a kernel module
Date: Fri, 27 Oct 2006 13:06:37 +0200 [thread overview]
Message-ID: <20061027110636.GA2837@harddisk-recovery.com> (raw)
In-Reply-To: <20061027101611.67643.qmail@web27406.mail.ukl.yahoo.com>
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
next prev parent reply other threads:[~2006-10-27 11:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-27 10:16 How to run an a.out file in a kernel module ranjith kumar
2006-10-27 11:06 ` Jiri Slaby
2006-10-27 11:06 ` Erik Mouw [this message]
2006-10-29 11:19 ` ranjith kumar
2006-10-29 12:31 ` Jiri Slaby
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20061027110636.GA2837@harddisk-recovery.com \
--to=erik@harddisk-recovery.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ranjit_kumar_b4u@yahoo.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox