This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.21-34-ge86c5b6


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  e86c5b6459e9803118cd4708e0ff024a27bf33f8 (commit)
      from  c187253fc222ed05de710d94b5bcaf02c3ef37c5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e86c5b6459e9803118cd4708e0ff024a27bf33f8

commit e86c5b6459e9803118cd4708e0ff024a27bf33f8
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Sat Feb 7 22:22:40 2015 +0100

    hurd: support mmap with PROT_NONE

diff --git a/ChangeLog b/ChangeLog
index 4ba04cd..3c19596 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
 
 	* hurd/hurd/signal.h (_hurd_critical_section_lock): Don't unlock
 	sigstate.
+	* sysdeps/mach/hurd/mmap.c (__mmap): Also handle PROT_NONE case.
 
 2015-02-07  Samuel Thibault  <samuel.thibault@ens-lyon.org>
 
diff --git a/sysdeps/mach/hurd/mmap.c b/sysdeps/mach/hurd/mmap.c
index ca34045..393008f 100644
--- a/sysdeps/mach/hurd/mmap.c
+++ b/sysdeps/mach/hurd/mmap.c
@@ -97,6 +97,13 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
 	  }
 	switch (prot & (PROT_READ|PROT_WRITE))
 	  {
+	  /* Although it apparently doesn't make sense to map a file with
+	     protection set to PROT_NONE, it is actually sometimes done.
+	     In particular, that's how localedef reserves some space for
+	     the locale archive file, the rationale being that some
+	     implementations take into account whether the mapping is
+	     anonymous or not when selecting addresses.  */
+	  case PROT_NONE:
 	  case PROT_READ:
 	    memobj = robj;
 	    if (wobj != MACH_PORT_NULL)
@@ -126,8 +133,8 @@ __mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
 		return (__ptr_t) (long int) __hurd_fail (EACCES);
 	      }
 	    break;
-	  default:		/* impossible */
-	    return 0;
+	  default:
+	    __builtin_unreachable ();
 	  }
 	break;
 	/* XXX handle MAP_NOEXTEND */

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                |    1 +
 sysdeps/mach/hurd/mmap.c |   11 +++++++++--
 2 files changed, 10 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]