Re: allocate memory in userspace

Brian Gerst (bgerst@didntduck.org)
Tue, 02 Jul 2002 08:19:30 -0400


Timo Benk wrote:
> Hi,
>
> I am a kernel newbie and i am writing a module. I
> need to allocate some memory in userspace because
> i want to access syscalls like open(), lstat() etc.
> I need to call these methods in the kernel, and in
> my special case there is no other way, but i
> do not want to reimplement all the syscalls.

What are you trying to do with this module? If you are needing to use
syscalls like open(), you are probably trying to do something that is
forbidden in kernel space. For example, trying to read a configuration
file.

Recommended reading:
http://www.linux.org.uk/~ajh/ols2002_proceedings.pdf.gz
The chapter named "How NOT to write kernel drivers", especially sections
7 and 8.

--
				Brian Gerst

- 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/