[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[glibc] 01/01: hurd-i386/tg-mlockall.diff: New patch, add support for mlockall



This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch sid
in repository glibc.

commit 48d7a18e3d13fd4ef611ffb435625acf62315abc
Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
Date:   Mon Jan 2 16:06:54 2017 +0100

    hurd-i386/tg-mlockall.diff: New patch, add support for mlockall
---
 debian/changelog                          |   1 +
 debian/patches/hurd-i386/tg-mlockall.diff | 106 ++++++++++++++++++++++++++++++
 debian/patches/series                     |   1 +
 3 files changed, 108 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index c6ace96..c753e51 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,7 @@ glibc (2.24-9) UNRELEASED; urgency=medium
   * hurd-i386/tg-libpthread-gsync-mutex.diff: Update patch, fixes trylock
     error return.
   * hurd-i386/tg-magic-pid.diff: New patch, add support for /proc/self.
+  * hurd-i386/tg-mlockall.diff: New patch, add support for mlockall.
 
   [ Aurelien Jarno ]
   * debian/sysdeps/{amd64,i386,x32}.mk: disable lock elision (aka Intel TSX)
diff --git a/debian/patches/hurd-i386/tg-mlockall.diff b/debian/patches/hurd-i386/tg-mlockall.diff
new file mode 100644
index 0000000..3ee1020
--- /dev/null
+++ b/debian/patches/hurd-i386/tg-mlockall.diff
@@ -0,0 +1,106 @@
+Subject: [PATCH] Add mlockall support
+
+* sysdeps/mach/hurd/mlockall.c: New file
+* sysdeps/mach/hurd/munlockall.c: New file
+
+---
+ sysdeps/mach/hurd/mlockall.c   | 42 ++++++++++++++++++++++++++++++++++++++++++
+ sysdeps/mach/hurd/munlockall.c | 40 ++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 82 insertions(+)
+
+diff --git a/sysdeps/mach/hurd/mlockall.c b/sysdeps/mach/hurd/mlockall.c
+new file mode 100644
+index 0000000000..11a3deac8a
+--- /dev/null
++++ b/sysdeps/mach/hurd/mlockall.c
+@@ -0,0 +1,42 @@
++/* mlockall -- lock in core all the pages in this process.  Stub version.
++   Copyright (C) 2001-2016 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
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
++
++#include <sys/types.h>
++#include <sys/mman.h>
++#include <errno.h>
++#include <hurd.h>
++#include <mach/mach_host.h>
++
++/* Cause all currently mapped pages of the process to be memory resident
++   until unlocked by a call to the `munlockall', until the process exits,
++   or until the process calls `execve'.  */
++
++int
++mlockall (int flags)
++{
++  mach_port_t host;
++  error_t err;
++
++  err = __get_privileged_ports (&host, NULL);
++  if (err)
++    return __hurd_fail (err);
++
++  err = __vm_wire_all (host, __mach_task_self (), flags);
++  __mach_port_deallocate (__mach_task_self (), host);
++  return err ? __hurd_fail (err) : 0;
++}
+diff --git a/sysdeps/mach/hurd/munlockall.c b/sysdeps/mach/hurd/munlockall.c
+new file mode 100644
+index 0000000000..6fbb69435d
+--- /dev/null
++++ b/sysdeps/mach/hurd/munlockall.c
+@@ -0,0 +1,40 @@
++/* munlockall -- undo the effects of all prior mlock calls.  Stub version.
++   Copyright (C) 2001-2016 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
++   modify it under the terms of the GNU Lesser General Public
++   License as published by the Free Software Foundation; either
++   version 2.1 of the License, or (at your option) any later version.
++
++   The GNU C Library is distributed in the hope that it will be useful,
++   but WITHOUT ANY WARRANTY; without even the implied warranty of
++   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++   Lesser General Public License for more details.
++
++   You should have received a copy of the GNU Lesser General Public
++   License along with the GNU C Library; if not, see
++   <http://www.gnu.org/licenses/>.  */
++
++#include <sys/types.h>
++#include <sys/mman.h>
++#include <errno.h>
++#include <hurd.h>
++#include <mach/mach_host.h>
++
++/* Undo the effects of all prior mlock calls in this process.  */
++
++int
++munlockall (void)
++{
++  mach_port_t host;
++  error_t err;
++
++  err = __get_privileged_ports (&host, NULL);
++  if (err)
++    return __hurd_fail (err);
++
++  err = __vm_wire_all (host, __mach_task_self (), VM_WIRE_NONE);
++  __mach_port_deallocate (__mach_task_self (), host);
++  return err ? __hurd_fail (err) : 0;
++}
+-- 
+tg: (7bb5f8a836..) t/mlockall (depends on: baseline)
diff --git a/debian/patches/series b/debian/patches/series
index 4c8f68a..96df013 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -141,6 +141,7 @@ hurd-i386/tg-NOFOLLOW-DIRECTORY.diff
 hurd-i386/tg-libc_rwlock_recursive.diff
 hurd-i386/cvs-hurd_signal.h_c++.diff
 hurd-i386/tg-magic-pid.diff
+hurd-i386/tg-mlockall.diff
 
 i386/local-biarch.diff
 i386/local-cmov.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-glibc/glibc.git


Reply to: