This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
Re: MIPS bits/mman.h missing POSIX_MADV_* definitions
- From: Daniel Jacobowitz <drow at false dot org>
- To: libc-ports at sourceware dot org
- Date: Fri, 5 May 2006 10:18:13 -0400
- Subject: Re: MIPS bits/mman.h missing POSIX_MADV_* definitions
- References: <Pine.LNX.4.64.0604202109350.21991@digraph.polyomino.org.uk>
On Thu, Apr 20, 2006 at 09:11:52PM +0000, Joseph S. Myers wrote:
> The MIPS <bits/mman.h> header is missing definitions of POSIX_MADV_*
> (present on other targets), as shown up by Open POSIX testing. (Examining
> the other bits/mman.h headers shows that HPPA also seems to be missing
> these definitions.)
>
> 2006-04-20 Joseph S. Myers <joseph@codesourcery.com>
>
> * sysdeps/unix/sysv/linux/mips/bits/mman.h (POSIX_MADV_NORMAL,
> POSIX_MADV_RANDOM, POSIX_MADV_SEQUENTIAL, POSIX_MADV_WILLNEED,
> POSIX_MADV_DONTNEED): Define.
Thanks. I've instead checked in this, since there've been other missed
changes too.
--
Daniel Jacobowitz
CodeSourcery
2006-05-05 Daniel Jacobowitz <dan@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/bits/mman.h: Formatting changes
for consistency with other ports.
(MADV_REMOVE): Correct value.
(MADV_DONTFORK, MADV_DOFORK, POSIX_MADV_NORMAL,
POSIX_MADV_RANDOM, POSIX_MADV_SEQUENTIAL, POSIX_MADV_WILLNEED,
POSIX_MADV_DONTNEED): Define.
2006-05-05 Daniel Jacobowitz <dan@codesourcery.com>
* sysdeps/unix/sysv/linux/arm/bits/mman.h: Update error message
for consistency with other ports.
(MADV_REMOVE, MADV_DONTFORK, MADV_DOFORK): Define.
Index: sysdeps/unix/sysv/linux/mips/bits/mman.h
===================================================================
RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/mips/bits/mman.h,v
retrieving revision 1.11
diff -u -p -r1.11 mman.h
--- sysdeps/unix/sysv/linux/mips/bits/mman.h 31 Jan 2006 01:26:05 -0000 1.11
+++ sysdeps/unix/sysv/linux/mips/bits/mman.h 5 May 2006 14:14:16 -0000
@@ -50,7 +50,7 @@
/* Other flags. */
#define MAP_FIXED 0x10 /* Interpret addr exactly. */
#ifdef __USE_MISC
-# define MAP_FILE 0x00
+# define MAP_FILE 0
# define MAP_ANONYMOUS 0x0800 /* Don't use a file. */
# define MAP_ANON MAP_ANONYMOUS
# define MAP_RENAME MAP_ANONYMOUS
@@ -70,26 +70,37 @@
/* Flags to `msync'. */
#define MS_ASYNC 1 /* Sync memory asynchronously. */
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
#define MS_SYNC 4 /* Synchronous memory sync. */
+#define MS_INVALIDATE 2 /* Invalidate the caches. */
/* Flags for `mlockall'. */
#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
#define MCL_FUTURE 2 /* Lock all additions to address
space. */
-/* Advice to `madvise'. */
-#ifdef __USE_BSD
-#define MADV_NORMAL 0 /* default page-in behavior */
-#define MADV_RANDOM 1 /* page-in minimum required */
-#define MADV_SEQUENTIAL 2 /* read-ahead aggressively */
-#define MADV_WILLNEED 3 /* pre-fault pages */
-#define MADV_DONTNEED 4 /* discard these pages */
-#define MADV_REMOVE 5 /* remove these pages & resources */
-#endif
-
/* Flags for `mremap'. */
#ifdef __USE_GNU
# define MREMAP_MAYMOVE 1
# define MREMAP_FIXED 2
#endif
+
+/* Advice to `madvise'. */
+#ifdef __USE_BSD
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
+#endif
+
+/* The POSIX people had to invent similar names for the same things. */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+#endif
Index: sysdeps/unix/sysv/linux/arm/bits/mman.h
===================================================================
RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/arm/bits/mman.h,v
retrieving revision 1.7
diff -u -p -r1.7 mman.h
--- sysdeps/unix/sysv/linux/arm/bits/mman.h 31 Oct 2005 20:41:32 -0000 1.7
+++ sysdeps/unix/sysv/linux/arm/bits/mman.h 5 May 2006 14:16:13 -0000
@@ -1,5 +1,5 @@
/* Definitions for POSIX memory map interface. Linux/ARM version.
- Copyright (C) 1997, 2000, 2003, 2005 Free Software Foundation, Inc.
+ Copyright (C) 1997, 2000, 2003, 2005, 2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -18,7 +18,7 @@
02111-1307 USA. */
#ifndef _SYS_MMAN_H
-# error "Never include this file directly. Use <sys/mman.h> instead"
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
#endif
/* The following definitions basically come from the kernel headers.
@@ -88,6 +88,9 @@
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
# define MADV_WILLNEED 3 /* Will need these pages. */
# define MADV_DONTNEED 4 /* Don't need these pages. */
+# define MADV_REMOVE 9 /* Remove these pages and resources. */
+# define MADV_DONTFORK 10 /* Do not inherit across fork. */
+# define MADV_DOFORK 11 /* Do inherit across fork. */
#endif
/* The POSIX people had to invent similar names for the same things. */