On 18/03/2016 20:36, ari kumpumäki wrote:
Hi all
Why the following test code works fluently in Linux and cygwin 1.5.
But with cygwin 2.4.1 it gives a segmentation fault, when running "x =
mem[filePageSize];"
return (char *) mmap(0, ALIGN_TO_PAGE_SIZE(size), PROT_NONE,
MAP_SHARED | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0);
why a file descriptor = -1 ?
http://pubs.opengroup.org/onlinepubs/9699919799/functions/mmap.html
Please note also that unsigned is not always same size of address
(eg 64 bit)
size_t works better for that.
In any case you should check the function result.
Regards
Marco
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple