1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-01 10:06:57 +03:00

Hurd: Fix mlock in all cases except non-readable pages.

This commit is contained in:
Samuel Thibault
2012-05-10 15:17:03 -07:00
committed by Roland McGrath
parent 6b645f0d70
commit 66cbbebcc6
2 changed files with 6 additions and 2 deletions

View File

@ -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;