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.
/* 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
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;