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.
Created attachment 102667 [details] Add missing limit support
Created attachment 102670 [details] better patch, this time which help text also update
I switched locks to -x as Chet suggested.
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); } }
Should have reopened to get the change made...
Thanks.