From: Qiuyu Zhang <qiuyu.zhang@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: Question about copy_from_user/copy_to_user
Date: Sat, 10 Jul 2004 15:44:31 -0500 [thread overview]
Message-ID: <c26fd82804071013442f4c1447@mail.gmail.com> (raw)
Hi all,
I am working on a module driver. A user application alloc a bunch of
memory for storing packet. And module driver can read /write data
from/into the memory in user space. I use ioctl function to pass the
pointer of memory of user space to module driver. What I want to do
is to store the pointer in kernel space and when I need to write or
read data from memory of user space, I try to use copy_from_user or
copy_to_user to get/put data. But I always get wrong data. I don't
know the reason. Would you guys give me some help?
Simple description of the code:
device_ioctl() {
// get the pointer of memory of user space, and assign the
pointer to kernel variable.
}
device_xmit(){
// when upper layer send a packet to this device.
// I try to use the copy_from_user to get some information from
user space buf
// but I cannot get correct information.
}
Thx
next reply other threads:[~2004-07-10 20:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-10 20:44 Qiuyu Zhang [this message]
2004-07-11 1:59 ` Question about copy_from_user/copy_to_user Richard B. Johnson
-- strict thread matches above, loose matches on Subject: below --
2004-07-10 23:09 Paul Zimmerman
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=c26fd82804071013442f4c1447@mail.gmail.com \
--to=qiuyu.zhang@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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