lkml.org 
[lkml]   [2005]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: msgsnd in module
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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.027 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site