From: Robert Hancock <hancockr@shaw.ca>
To: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: msgsnd in module
Date: Wed, 23 Feb 2005 17:45:15 -0600 [thread overview]
Message-ID: <421D158B.1080008@shaw.ca> (raw)
In-Reply-To: <3AVR2-2UO-5@gated-at.bofh.it>
Vijayalakshmi Hadimani wrote:
> Hi,
> I am inserting a module(device driver) using insmod.
> I want to send a message from this module to an user process.
> For this I used msgsnd with buffer in the call as a local
> variable. I am getting an error "EFAULT" for this call.
> However this did not happen when I made the driver code as a
> part of kernel and not as a module. Any idea about what could
> be the problem and how to solve it?
Well, first off, sending SysV messages from the kernel is a pretty
bizarre thing to do. Secondly, you can't just call the system call from
inside the kernel and pass in kernel memory, because the system call
expects to deal with user-space memory. You'd have to duplicate some or
all of the code of msgsnd and change it to just read the memory directly
instead of using copy_from_user, etc.
next parent reply other threads:[~2005-02-23 23:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3AVR2-2UO-5@gated-at.bofh.it>
2005-02-23 23:45 ` Robert Hancock [this message]
2005-02-23 4:37 msgsnd in module Vijayalakshmi Hadimani
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=421D158B.1080008@shaw.ca \
--to=hancockr@shaw.ca \
--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