PAGESIZE is not portable
From-SVN: r36166
This commit is contained in:
parent
a3bcdaf9e9
commit
dc46505a00
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
* gcc/fixinc/fixincl.c(load_file): always read header files
|
* gcc/fixinc/fixincl.c(load_file): always read header files
|
||||||
with sizes that are a multiple of the page size.
|
with sizes that are a multiple of the page size.
|
||||||
|
& use libiberty's getpagesize for determining that.
|
||||||
|
|
||||||
2000-09-05 Alexandre Oliva <aoliva@redhat.com>
|
2000-09-05 Alexandre Oliva <aoliva@redhat.com>
|
||||||
|
|
||||||
|
@ -359,7 +359,7 @@ load_file ( fname )
|
|||||||
|
|
||||||
/* IF the file size is a multiple of the page size,
|
/* IF the file size is a multiple of the page size,
|
||||||
THEN sometimes you will seg fault trying to access a trailing byte */
|
THEN sometimes you will seg fault trying to access a trailing byte */
|
||||||
if ((stbf.st_size & (PAGESIZE-1)) == 0)
|
if ((stbf.st_size & (getpagesize()-1)) == 0)
|
||||||
res = (char*)BAD_ADDR;
|
res = (char*)BAD_ADDR;
|
||||||
else
|
else
|
||||||
res = (char*)mmap ((void*)NULL, data_map_size, PROT_READ,
|
res = (char*)mmap ((void*)NULL, data_map_size, PROT_READ,
|
||||||
|
Loading…
Reference in New Issue
Block a user