Subject: Re: RFC: mremap(2)
To: None <joerg@britannica.bec.de>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 07/05/2007 21:46:56
> Hi all,
> I would like to add the equivalent of mremap(2) from Linux for the use
> e.g. of malloc(3).
>
> Prototype:
> void *mremap(void *oldp, size_t oldsize, void *newp,
> size_t newsize, int flags)
>
> Supported flags from mmap(2):
> MAP_FIXED
> MAP_ALIGNED
>
> Semantic:
> Resize the mapped range [oldp..oldp_oldsize] to newsize. If MAP_FIXED is
> specified newp is tried and mremap fails it that can't be used.
> Otherwise oldp and newp are used as hints for the position, factoring in
> the given alignment. Return value is either the new address or
> MAP_FAILED.
>
> Attached is an attempt to implement this.
>
> Joerg
the implementation seems reasonable to me.
before it goes in the tree, i'd like to see an actual user of the syscall.
YAMAMOTO Takashi