about summary refs log tree commit diff
path: root/sysdeps/mach/hurd
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2000-03-25 20:20:44 +0000
committerRoland McGrath <roland@gnu.org>2000-03-25 20:20:44 +0000
commit9e3438bee63e8550ec432a70063a721fcf6f60e2 (patch)
tree0c9395d7c69b942bad39617d77955240f7fe0583 /sysdeps/mach/hurd
parent6a08db097bfbc85337e9b36de24ce1faf3c5cc63 (diff)
downloadglibc-9e3438bee63e8550ec432a70063a721fcf6f60e2.tar.gz
glibc-9e3438bee63e8550ec432a70063a721fcf6f60e2.tar.xz
glibc-9e3438bee63e8550ec432a70063a721fcf6f60e2.zip
* sysdeps/mach/hurd/setrlimit.c (setrlimit): Go into a critical
	section while taking the _hurd_rlimit_lock.
	* sysdeps/mach/hurd/getrlimit.c (__getrlimit): Likewise.
Diffstat (limited to 'sysdeps/mach/hurd')
-rw-r--r--sysdeps/mach/hurd/getrlimit.c4
-rw-r--r--sysdeps/mach/hurd/setrlimit.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/getrlimit.c b/sysdeps/mach/hurd/getrlimit.c
index a03f4e1fe6..1dae8a6acb 100644
--- a/sysdeps/mach/hurd/getrlimit.c
+++ b/sysdeps/mach/hurd/getrlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1994, 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1991,93,94,96,97,2000 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
@@ -34,9 +34,11 @@ __getrlimit (enum __rlimit_resource resource, struct rlimit *rlimits)
       return -1;
     }
 
+  HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_rlimit_lock);
   lim = _hurd_rlimits[resource];
   __mutex_unlock (&_hurd_rlimit_lock);
+  HURD_CRITICAL_END;
 
   *rlimits = lim;
 
diff --git a/sysdeps/mach/hurd/setrlimit.c b/sysdeps/mach/hurd/setrlimit.c
index d2988d5147..1ae2254080 100644
--- a/sysdeps/mach/hurd/setrlimit.c
+++ b/sysdeps/mach/hurd/setrlimit.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991,92,93,94,97,98,2000 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
@@ -51,9 +51,11 @@ setrlimit (resource, rlimits)
   if (lim.rlim_cur > lim.rlim_max)
     lim.rlim_cur = lim.rlim_max;
 
+  HURD_CRITICAL_BEGIN;
   __mutex_lock (&_hurd_rlimit_lock);
   _hurd_rlimits[resource] = lim;
   __mutex_unlock (&_hurd_rlimit_lock);
+  HURD_CRITICAL_END;
 
   return 0;
 }