Re: Killing clones

H. Peter Anvin (hpa@transmeta.com)
16 Sep 1997 09:42:14 GMT


Followup to: <Pine.LNX.3.95.970915132448.24625B-100000@penguin.transmeta.com>
By author: Linus Torvalds <torvalds@transmeta.com>
In newsgroup: linux.dev.kernel
> >
> > (and how does one grow/shrink a mmap'd region? That's one thing I still
> > haven't figured out... apparently growing/shrinking mmap'd files uses
> > 'ftruncate' but what about nonfile shared memory regions?)
>
> You can use "mremap()" to grow or shrink (or move) an existing memory map.
>
> I don't know if anybody uses it, though.
>

DOSEMU does, for DPMI_realloc(); and I think at least some version of
the mmap-based malloc()-implementation uses it for realloc(). This
actually makes realloc() usable even for a substantial-sized memory
region.

-hpa

-- 
    PGP: 2047/2A960705 BA 03 D3 2C 14 A8 A8 BD  1E DF FE 69 EE 35 BD 74
    See http://www.zytor.com/~hpa/ for web page and full PGP public key
Always looking for a few good BOsFH.  **  Linux - the OS of global cooperation
        I am Baha'i -- ask me about it or see http://www.bahai.org/