aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2012-05-10 15:17:03 -0700
committerRoland McGrath <roland@hack.frob.com>2012-05-10 15:57:25 -0700
commit66cbbebcc616db8e221e81f7ecbb2c77701d031b (patch)
treee9ebbcdb8c4b4a67b3db6e4859ab975342c36052
parent6b645f0d702e9285f3d7fe5684258e77051cfa8e (diff)
downloadglibc-66cbbebcc616db8e221e81f7ecbb2c77701d031b.tar
glibc-66cbbebcc616db8e221e81f7ecbb2c77701d031b.tar.gz
glibc-66cbbebcc616db8e221e81f7ecbb2c77701d031b.tar.bz2
glibc-66cbbebcc616db8e221e81f7ecbb2c77701d031b.zip
Hurd: Fix mlock in all cases except non-readable pages.
-rw-r--r--ChangeLog4
-rw-r--r--sysdeps/mach/hurd/mlock.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b48d9e55ba..e52cd67f47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2012-05-10 Samuel Thibault <samuel.thibault@ens-lyon.org>
+ Fix mlock in all cases except non-readable pages.
+ * sysdeps/mach/hurd/mlock.c (mlock): Give VM_PROT_READ
+ instead of VM_PROT_ALL as parameter to __vm_wire function.
+
* sysdeps/mach/hurd/mkdir.c: Include <string.h>.
(__mkdir): When path is `/', just fail with EEXIST.
* sysdeps/mach/hurd/mkdirat.c: Likewise.
diff --git a/sysdeps/mach/hurd/mlock.c b/sysdeps/mach/hurd/mlock.c
index 2cb3e56321..47bafaae19 100644
--- a/sysdeps/mach/hurd/mlock.c
+++ b/sysdeps/mach/hurd/mlock.c
@@ -1,5 +1,5 @@
/* mlock -- guarantee pages are resident in memory. Mach/Hurd version.
- Copyright (C) 2001 Free Software Foundation, Inc.
+ Copyright (C) 2001-2012 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
@@ -39,7 +39,7 @@ mlock (const void *addr, size_t len)
page = trunc_page ((vm_address_t) addr);
len = round_page ((vm_address_t) addr + len) - page;
err = __vm_wire (hostpriv, __mach_task_self (), page, len,
- VM_PROT_ALL); /* XXX ? */
+ VM_PROT_READ);
__mach_port_deallocate (__mach_task_self (), hostpriv);
return err ? __hurd_fail (err) : 0;