PAGESIZE is not portable
authorBruce Korb <bkorb@gnu.org>
Tue, 5 Sep 2000 22:26:16 +0000 (22:26 +0000)
committerBruce Korb <korbb@gcc.gnu.org>
Tue, 5 Sep 2000 22:26:16 +0000 (22:26 +0000)
From-SVN: r36166

gcc/ChangeLog
gcc/fixinc/fixincl.c

index 552efaa1598cc8b015329f14f59d8e7cdd4e08b8..7047b0c8389e5f94f44dd0c83c276825e4a14cca 100644 (file)
@@ -2,6 +2,7 @@
 
         * gcc/fixinc/fixincl.c(load_file): always read header files
         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>
 
index ad5d23ac4324147974c20385735cabcfafc0e319..bd8e7afecd1ce6e6ed878516bbfb65d1700cdb17 100644 (file)
@@ -359,7 +359,7 @@ load_file ( fname )
 
   /*  IF the file size is a multiple of the page size,
       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;
   else
     res = (char*)mmap ((void*)NULL, data_map_size, PROT_READ,