Re: anonymous shared mmap. Where? (fwd)

Matti E Aarnio (mea@mea.cc.utu.fi)
Fri, 26 Jul 1996 21:20:58 +0300 (EET DST)


> > On Wed, 24 Jul 1996, A.N.Kuznetsov wrote:
> > >
> > > Unpleasant discovery, 2.0 has no shared anonymous mmap ???
>
> > It's definitely 2.1, if even that. Shared anonymous mmap is a monstrosity
> > (even the name is a oxymoron), and it's hard to implement to boot.
>
> Can someone tell me what shared anonymous mmap is. Is it a way to
> create shared memory regions between a process and its children, or is
> it a way to create shared memory regions between unrelated processses?

Between process and its children.

However I used recently alternate strategy, when I needed
a shared page or two:

fp = mktemp();
fwrite(fp,....); <-- about pagefull
lseek(fileno(fp),0,0); <-- MUST do, linux oddity is that file io
pointer affects the mmap() of said file..
p = mmap( ... )
fclose(fp);

fork(); and be happy.

> Thanks,
>
> Jim

/Matti Aarnio <mea@utu.fi>