Bug 129800 - bash does not provide support for new limits in 2.6 kernel
Summary: bash does not provide support for new limits in 2.6 kernel
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: bash
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-08-12 19:24 UTC by Ulrich Drepper
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version: 3.0-9
Clone Of:
Environment:
Last Closed: 2004-08-31 11:57:13 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Add missing limit support (1.23 KB, patch)
2004-08-12 19:26 UTC, Ulrich Drepper
no flags Details | Diff
better patch, this time which help text also update (1.84 KB, patch)
2004-08-12 19:38 UTC, Ulrich Drepper
no flags Details | Diff

Description Ulrich Drepper 2004-08-12 19:24:40 UTC
Description of problem:
There are currently three resources limits the 2.6 kernel knows about
bash does not provide access to using the ulimit builtin.  Support
should be added.

Version-Release number of selected component (if applicable):
bash-3.0-4.i386

How reproducible:
always

Steps to Reproduce:
1.ulimit -a
2.compare with kernel resource list
3.
  
Actual results:
no file lock count, signal pending, POSIX message queue limits

Expected results:
all limits covered

Additional info:
I'll attach a patch for adding the support.  I have submitted the
patch also to the bash mailing list.  We should hold off a bit to get
feedback from the maintainer since the letters used to denote the
limits need to be in sync.  Otherwise we might be incompatible with
the upstream code.

Comment 1 Ulrich Drepper 2004-08-12 19:26:02 UTC
Created attachment 102667 [details]
Add missing limit support

Comment 2 Ulrich Drepper 2004-08-12 19:38:00 UTC
Created attachment 102670 [details]
better patch, this time which help text also update

Comment 3 Tim Waugh 2004-08-27 16:49:06 UTC
I switched locks to -x as Chet suggested.

Comment 4 Ulrich Drepper 2004-08-28 18:11:50 UTC
Use this on top of the other thread.  ulimit -a should not complain
and the -x change is also there.


diff -u builtins/ulimit.def builtins/ulimit.def
--- builtins/ulimit.def 2004-08-12 12:36:22.452624256 -0700
+++ builtins/ulimit.def 2004-08-28 11:00:38.000000000 -0700
@@ -39,13 +39,13 @@
     -l the maximum size a process may lock into memory
     -m the maximum resident set size
     -n the maximum number of open file descriptors
-    -o the maximum number of file locks
     -p the pipe buffer size
     -q the maximum number of bytes in POSIX message queues
     -s the maximum stack size
     -t the maximum amount of cpu time in seconds
     -u the maximum number of user processes
     -v the size of virtual memory
+    -x the maximum number of file locks
  
 If LIMIT is given, it is the new value of the specified resource;
 the special LIMIT values `soft', `hard', and `unlimited' stand for
@@ -213,9 +213,6 @@
   { 'm',       RLIMIT_RSS,   1024,     "max memory size",     
"kbytes" },
 #endif /* RLIMIT_RSS */
   { 'n',       RLIMIT_OPENFILES, 1,    "open files",           (char
*)NULL},
-#ifdef RLIMIT_LOCKS
-  { 'o',       RLIMIT_LOCKS, 1,        "file locks",           (char
*)NULL},
-#endif
   { 'p',       RLIMIT_PIPESIZE, 512,   "pipe size",            "512
bytes" },
 #ifdef RLIMIT_MSGQUEUE
   { 'q',       RLIMIT_MSGQUEUE, 1,     "POSIX message queues", "bytes" },
@@ -233,6 +230,9 @@
 #ifdef RLIMIT_SWAP
   { 'w',       RLIMIT_SWAP,    1024,   "swap size",           
"kbytes" },
 #endif
+#ifdef RLIMIT_LOCKS
+  { 'x',       RLIMIT_LOCKS, 1,        "file locks",           (char
*)NULL},
+#endif
   { -1, -1, -1, (char *)NULL, (char *)NULL }
 };
 #define NCMDS  (sizeof(limits) / sizeof(limits[0]))
@@ -659,11 +659,11 @@
  
   for (i = 0; limits[i].option > 0; i++)
     {
-      if (get_limit (i, &softlim, &hardlim) < 0)
+      if (get_limit (i, &softlim, &hardlim) == 0)
+       printone (i, (mode & LIMIT_SOFT) ? softlim : hardlim, 1);
+      else if (errno != EINVAL)
        builtin_error ("%s: cannot get limit: %s", limits[i].description,
                                                   strerror (errno));
-      else
-       printone (i, (mode & LIMIT_SOFT) ? softlim : hardlim, 1);
     }
 }
  


Comment 5 Ulrich Drepper 2004-08-28 18:12:26 UTC
Should have reopened to get the change made...

Comment 6 Tim Waugh 2004-08-31 11:57:13 UTC
Thanks.


Note You need to log in before you can comment on or make changes to this bug.