If I recall correctly, MAP_ANONYMOUS is not true POSIX but an extension most un*x system implement yet it is sometime call MAP_ANON. To be portable, you must detect in ./configure if mmap supports either MAP_ANONYMOUS or MAP_ANON and fallback to /tmp/xxx if none is supported.
Christian ----- Message d'origine ----- De : "Thomas Preud'homme" <[email protected]> Date ven. 10/01/2014 07:33 (GMT +01:00) À : "[email protected]" <[email protected]> Cc : "Keren Tan" <[email protected]> Objet : Re: [Tinycc-devel] Use an anonymous file to back mmap Le jeudi 9 janvier 2014, 14:21:59 Keren Tan a écrit : > Hi All, > > I just submitted a tentative patch to the mob branch about mmap. When > selinux is enabled, tccrun.c uses mmap to hold the dynamically generated > code/data. It is backed by a randomly named file under /tmp directory. My > patch is to use an anonymous file in mmap instead, so that the generated > code/data only resides in memory, and tcc does not depend on a writable > /tmp anymore. > > tcc is fantastic! I am new to this community. Your comments are very > welcome! Here is my comment: you removed the line s1->mem_size = ret; which is used to unmap these memory regions in libtcc.c > > http://repo.or.cz/w/tinycc.git/commit/935d8169b8e3570f1a5e726c5295be2f460c15 > 40 > > Best, > Keren Tan Thanks for your patch. Best regards, Thomas _______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
_______________________________________________ Tinycc-devel mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/tinycc-devel
