Re: [PATCH, v3] shmat: introduce flag SHM_MAP_NOT_FIXED

From: Andi Kleen
Date: Tue Oct 07 2008 - 19:51:40 EST


On Wed, Oct 08, 2008 at 12:40:30AM +0100, Alan Cox wrote:
> > > Can use shm_open and mmap to get POSIX standard shm behaviour via a sane
> >
> > I don't think shm_open can attach to SYSV shared segments. Or are you
> > proposing to add "sysvshmfs" to make that possible?
>
> Actually you can do so. As it stands today the SYS3 SHM interface code
> does the following
>
> create a char array in the form SYS%08ld, key
> open it on shmfs

Perhaps I'm confused but my /dev/shm doesn't have any such files,
but I see a variety of shm segments in ipcs.

What would the path passed to shm_open look like?

>
> > - There are legacy interfaces that cannot be really changed who use sysv shm
> > (e.g. X shm and others -- just do a ipcs on your system)
>
> They can be changed

You want to break the X interface? And who knows who else
is using it.

> and nobody is wanting to map those at fixed addresses.

You're saying it should always use the address as a search hint?

Just changing the semantics unconditionally would seem risky to me. After
all as you point out they are primarily for compatibility and for that keeping
old semantics would seem better to me.

-Andi
--
ak@xxxxxxxxxxxxxxx
--
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/