Re: Having problem with mmap system call!!!

From: Alan Cox
Date: Thu Sep 16 2004 - 12:16:16 EST


On Iau, 2004-09-16 at 15:54, Richard B. Johnson wrote:
> > SHM_FAIL is the wrong error check btw.
> >
>
> MAP_FAILED only appeared in real late 'C' runtime library headers.
> That's why the code defines SHM_FAIL, which is also correct, but
> doesn't cause a redefinition error.

SuS doesn't permit the use of SHM_FAIL. And you don't get redefinition
errors if you use ds

> Well that's really nice. Now, how do you do that? The kernel DS
> is not the user DS so you end up with a kernel hack instead of
> a user hack?

Who cares about DS ? the user space page tables get mapped, its how all
mmap functions work. A simple example is the sound drivers (2.4
drivers/sound) which kmalloc a buffer of kernel space then make it
mappable to the user

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/