Browse Source

Enable remap_file_pages prototype controlled by __USE_GNU define as well as mremap, instead of __USE_MISC according to glibc. Missing prototype was spotted out by Peter Mazinger

Carmelo Amoroso 16 years ago
parent
commit
17e961d9c7
1 changed files with 10 additions and 11 deletions
  1. 10 11
      include/sys/mman.h

+ 10 - 11
include/sys/mman.h

@@ -134,18 +134,9 @@ static inline int mlock (__const void *__addr, size_t __len) { return 0; }
 static inline int munlock (__const void *__addr, size_t __len) { return 0; }
 static inline int mlockall (int __flags) { return 0; }
 static inline int munlockall (void) { return 0; }
-
 #endif
 
 #ifdef __USE_MISC
-/* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length
-   NEW_LEN.  If MREMAP_MAYMOVE is set in FLAGS the returned address
-   may differ from ADDR.  If MREMAP_FIXED is set in FLAGS the function
-   takes another paramter which is a fixed address at which the block
-   resides after a successful call.  */
-extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
-		     int __flags, ...) __THROW;
-
 /* mincore returns the memory residency status of the pages in the
    current process's address space specified by [start, start + len).
    The status is returned in a vector of bytes.  The least significant
@@ -153,14 +144,22 @@ extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
    it is zero.  */
 extern int mincore (void *__start, size_t __len, unsigned char *__vec)
      __THROW;
+#endif
+
+#ifdef __USE_GNU
+/* Remap pages mapped by the range [ADDR,ADDR+OLD_LEN) to new length
+   NEW_LEN.  If MREMAP_MAYMOVE is set in FLAGS the returned address
+   may differ from ADDR.  If MREMAP_FIXED is set in FLAGS the function
+   takes another paramter which is a fixed address at which the block
+   resides after a successful call.  */
+extern void *mremap (void *__addr, size_t __old_len, size_t __new_len,
+		     int __flags, ...) __THROW;
 
-#if 0
 /* Remap arbitrary pages of a shared backing store within an existing
    VMA.  */
 extern int remap_file_pages (void *__start, size_t __size, int __prot,
 			     size_t __pgoff, int __flags) __THROW;
 #endif
-#endif
 
 
 /* Open shared memory segment.  */