Magellan Linux

Contents of /trunk/bash/patches/bash-3.0-ulimit.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 144 - (show annotations) (download)
Tue May 8 20:06:05 2007 UTC (17 years, 5 months ago) by niro
File size: 2659 byte(s)
-import

1 --- bash-3.0/builtins/ulimit.def 2004-08-27 17:29:19.662577512 +0100
2 +++ bash-3.0/builtins/ulimit.def 2004-08-31 12:56:27.693244884 +0100
3 @@ -35,14 +35,17 @@
4 -c the maximum size of core files created
5 -d the maximum size of a process's data segment
6 -f the maximum size of files created by the shell
7 + -i the maximum number of pending signals
8 -l the maximum size a process may lock into memory
9 -m the maximum resident set size
10 -n the maximum number of open file descriptors
11 -p the pipe buffer size
12 + -q the maximum number of bytes in POSIX message queues
13 -s the maximum stack size
14 -t the maximum amount of cpu time in seconds
15 -u the maximum number of user processes
16 -v the size of virtual memory
17 + -x the maximum number of file locks
18
19 If LIMIT is given, it is the new value of the specified resource;
20 the special LIMIT values `soft', `hard', and `unlimited' stand for
21 @@ -200,6 +203,9 @@
22 { 'd', RLIMIT_DATA, 1024, "data seg size", "kbytes" },
23 #endif
24 { 'f', RLIMIT_FILESIZE, 1024, "file size", "blocks" },
25 +#ifdef RLIMIT_SIGPENDING
26 + { 'i', RLIMIT_SIGPENDING, 1, "pending signals", (char *)NULL},
27 +#endif
28 #ifdef RLIMIT_MEMLOCK
29 { 'l', RLIMIT_MEMLOCK, 1024, "max locked memory", "kbytes" },
30 #endif
31 @@ -208,6 +214,9 @@
32 #endif /* RLIMIT_RSS */
33 { 'n', RLIMIT_OPENFILES, 1, "open files", (char *)NULL},
34 { 'p', RLIMIT_PIPESIZE, 512, "pipe size", "512 bytes" },
35 +#ifdef RLIMIT_MSGQUEUE
36 + { 'q', RLIMIT_MSGQUEUE, 1, "POSIX message queues", "bytes" },
37 +#endif
38 #ifdef RLIMIT_STACK
39 { 's', RLIMIT_STACK, 1024, "stack size", "kbytes" },
40 #endif
41 @@ -221,6 +230,9 @@
42 #ifdef RLIMIT_SWAP
43 { 'w', RLIMIT_SWAP, 1024, "swap size", "kbytes" },
44 #endif
45 +#ifdef RLIMIT_LOCKS
46 + { 'x', RLIMIT_LOCKS, 1, "file locks", (char *)NULL},
47 +#endif
48 { -1, -1, -1, (char *)NULL, (char *)NULL }
49 };
50 #define NCMDS (sizeof(limits) / sizeof(limits[0]))
51 @@ -647,11 +659,11 @@
52
53 for (i = 0; limits[i].option > 0; i++)
54 {
55 - if (get_limit (i, &softlim, &hardlim) < 0)
56 + if (get_limit (i, &softlim, &hardlim) == 0)
57 + printone (i, (mode & LIMIT_SOFT) ? softlim : hardlim, 1);
58 + else if (errno != EINVAL)
59 builtin_error ("%s: cannot get limit: %s", limits[i].description,
60 strerror (errno));
61 - else
62 - printone (i, (mode & LIMIT_SOFT) ? softlim : hardlim, 1);
63 }
64 }
65
66 @@ -670,7 +682,7 @@
67 else
68 sprintf (unitstr, "(-%c) ", limits[limind].option);
69
70 - printf ("%-18s %16s", limits[limind].description, unitstr);
71 + printf ("%-20s %16s", limits[limind].description, unitstr);
72 }
73 if (curlim == RLIM_INFINITY)
74 puts ("unlimited");