* sysdeps/mach/hurd/setrlimit.c (setrlimit): Go into a critical
authorRoland McGrath <roland@gnu.org>
Sat, 25 Mar 2000 20:20:44 +0000 (20:20 +0000)
committerRoland McGrath <roland@gnu.org>
Sat, 25 Mar 2000 20:20:44 +0000 (20:20 +0000)
section while taking the _hurd_rlimit_lock.
* sysdeps/mach/hurd/getrlimit.c (__getrlimit): Likewise.

ChangeLog
sysdeps/mach/hurd/getrlimit.c
sysdeps/mach/hurd/setrlimit.c

index 45c0b88..406bffe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2000-03-25  Roland McGrath  <roland@baalperazim.frob.com>
+
+       * sysdeps/mach/hurd/setrlimit.c (setrlimit): Go into a critical
+       section while taking the _hurd_rlimit_lock.
+       * sysdeps/mach/hurd/getrlimit.c (__getrlimit): Likewise.
+
 2000-03-24  Roland McGrath  <roland@baalperazim.frob.com>
 
        * Makerules [$(cross-compiling) = yes] (symbolic-link-prog): Define
index a03f4e1..1dae8a6 100644 (file)
@@ -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;
 
index d2988d5..1ae2254 100644 (file)
@@ -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;
 }