From: Valdis.Kletnieks@vt.edu
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux lover <linux_lover2004@yahoo.com>, linux-kernel@vger.kernel.org
Subject: Re: How to read file in kernel module?
Date: Mon, 07 Feb 2005 11:52:44 -0500 [thread overview]
Message-ID: <200502071652.j17GqmJA010393@turing-police.cc.vt.edu> (raw)
In-Reply-To: Your message of "Mon, 07 Feb 2005 07:38:36 +0100." <1107758316.3886.58.camel@laptopd505.fenrus.org>
[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]
On Mon, 07 Feb 2005 07:38:36 +0100, Arjan van de Ven said:
> On Sun, 2005-02-06 at 22:17 -0800, linux lover wrote:
> > Now what i want is to use same bufproc_read &
> > bufproc_write functions defined in /proc file
> > handling kernel module to be used in another kernel
> > module to read that /proc/file in kernel module.The
> > second kernel module only used to read /proc file in
> > kernel. I am not understanding how can i open that
> > /proc/file in second kenrel module to read in kernel?
> > regards,
>
> the answer really is that you should not read files from kernel
> modules; /proc or otherwise.
As Arjan said - what you probably want to be doing instead is changing
the code in your first module that provides the bufproc_* functions so
that they're wrappers around some code that does the "real work", and
then call the real_work function from your second module. Most likely,
what you *really* want to be passing around is some 'struct *foo', and
the bufproc_* functions are converting to/from a struct foo and a linear
byte stream. (In the limiting case where it's just one variable, why not
just 'EXPORT_SYMBOL(variable)' in the first module and then just assign or
read the variable from the second module?)
[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]
next prev parent reply other threads:[~2005-02-07 16:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-07 6:17 How to read file in kernel module? linux lover
2005-02-07 6:38 ` Arjan van de Ven
2005-02-07 10:13 ` Marcel Holtmann
2005-02-07 13:00 ` Michelle Konzack
2005-02-07 16:52 ` Valdis.Kletnieks [this message]
2005-02-07 14:29 ` Olaf Dietsche
-- strict thread matches above, loose matches on Subject: below --
2005-01-10 13:30 linux lover
2005-01-10 16:15 ` Fao, Sean
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=200502071652.j17GqmJA010393@turing-police.cc.vt.edu \
--to=valdis.kletnieks@vt.edu \
--cc=arjan@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux_lover2004@yahoo.com \
/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;
as well as URLs for NNTP newsgroup(s).