Bug 129800 - bash does not provide support for new limits in 2.6 kernel
bash does not provide support for new limits in 2.6 kernel
Product: Fedora
Classification: Fedora
Component: bash (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
Depends On:
  Show dependency treegraph
Reported: 2004-08-12 15:24 EDT by Ulrich Drepper
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

See Also:
Fixed In Version: 3.0-9
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-31 07:57:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Ulrich Drepper 2004-08-12 15:24:40 EDT
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):

How reproducible:

Steps to Reproduce:
1.ulimit -a
2.compare with kernel resource list
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 15:26:02 EDT
Created attachment 102667 [details]
Add missing limit support
Comment 2 Ulrich Drepper 2004-08-12 15:38:00 EDT
Created attachment 102670 [details]
better patch, this time which help text also update
Comment 3 Tim Waugh 2004-08-27 12:49:06 EDT
I switched locks to -x as Chet suggested.
Comment 4 Ulrich Drepper 2004-08-28 14:11:50 EDT
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
-  { 'o',       RLIMIT_LOCKS, 1,        "file locks",           (char
   { 'p',       RLIMIT_PIPESIZE, 512,   "pipe size",            "512
bytes" },
   { 'q',       RLIMIT_MSGQUEUE, 1,     "POSIX message queues", "bytes" },
@@ -233,6 +230,9 @@
   { 'w',       RLIMIT_SWAP,    1024,   "swap size",           
"kbytes" },
+  { 'x',       RLIMIT_LOCKS, 1,        "file locks",           (char
   { -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 14:12:26 EDT
Should have reopened to get the change made...
Comment 6 Tim Waugh 2004-08-31 07:57:13 EDT

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