Date: Sun, 11 Jun 2017 10:37:17 +0200 From: u-klys@aetey.se To: freebsd-emulation@freebsd.org Subject: linux_mremap() with MREMAP_MAYMOVE - not implemented? Message-ID: <20170611083717.GM30784@example.net>
next in thread | raw e-mail | index | archive | help
Hello, I am to run Linux binaries (i386) under FreeBSD 11.0-RELEASE (amd64). The behaviour which surprises me is as follows $ truss ./rea linux_set_thread_area(0xffffcc3c) = 0 (0x0) linux_set_tid_address(0x804fb2c) = 75293 (0x1261d) linux_mmap2(0x0,0x101000,0x3,0x22,0xffffffff,0x0) = 671412224 (0x2804f000) linux_mremap(0x2804f000,0x101000,0x201000,0x1,0x0) ERR#-12 'Cannot allocate memory' linux_ioctl(0x1,0x5413,0xffffcae4) = 0 (0x0) FAILED REALLOCATING from 1 M to 2 M linux_writev(0x1,0xffffcab4,0x2) = 35 (0x23) linux_exit_group(0x0) process exit, rval = 0 $ The test binary is compiled under Linux from $ cat rea.c #include <stdio.h> #include <stdlib.h> #define DELTA (1024*1024) int main( int argc, char **argv ){ unsigned int i = DELTA; char *p, *q; if( !(p = malloc(i)) ) return 1; while( (q=realloc(p, (i+=DELTA))) ) p = q; printf("FAILED REALLOCATING from %u M to %u M\n", i/DELTA-1, i/DELTA); return 0; } $ and statically linked against musl standard C library which relies on mremap() in its malloc implementation. Is support for MREMAP_MAYMOVE missing? Regards, Rune
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20170611083717.GM30784>