Subject: Re: port-i386/3920: linux emulation doesn't support mremap()
To: None <current-users@NetBSD.ORG>
From: Matthias Scheler <tron@lyssa.owl.de>
List: current-users
Date: 08/09/1997 23:14:08
In article <199707272034.WAA00986@lyssa.owl.de>,
	Matthias Scheler <tron@lyssa.owl.de> writes:
> ...
> #if HAVE_MMAP
>   if (chunk_is_mmapped(oldp))
>   {
> #if HAVE_MREMAP
>     newp = mremap_chunk(oldp, nb);
>     if(newp) return chunk2mem(newp);
> #endif
> ...
> 
> As one can see a dummy function returning an error on mremap() will solve
> the problem.

Just some additional information:
The mremap() call is only used if the "libc" is compiled under Linux. If
the mremap() call fails a standard method is used to fulfil the realloc()
call. Under NetBSD-i386's Linux emulation this fallback code is never
used because the process is aborted due to a bad syscalls. With my patch
the mremap() call will fail "cleanly", the standard code will do the job
and the program will work fine.

-- 
Matthias Scheler                                http://home.owl.de/~tron/