summaryrefslogtreecommitdiff
blob: 8202b95d276972bb9423a162f39e08eaaeba72ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
Ripped from Fedora

--- bash-3.0/builtins/ulimit.def
+++ bash-3.0/builtins/ulimit.def
@@ -34,15 +34,20 @@
     -a	all current limits are reported
     -c	the maximum size of core files created
     -d	the maximum size of a process's data segment
+    -e	the maximum scheduling priority (`nice')
     -f	the maximum size of files created by the shell
+    -i	the maximum number of pending signals
     -l	the maximum size a process may lock into memory
     -m	the maximum resident set size
     -n	the maximum number of open file descriptors
     -p	the pipe buffer size
+    -q	the maximum number of bytes in POSIX message queues
+    -r	the maximum rt priority
     -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
@@ -199,7 +204,13 @@
 #ifdef RLIMIT_DATA
   { 'd',	RLIMIT_DATA,  1024,	"data seg size",	"kbytes" },
 #endif
+#ifdef RLIMIT_NICE
+  { 'e',	RLIMIT_NICE, 1,		"max nice",		(char *)NULL},
+#endif /* RLIMIT_NICE */
   { 'f',	RLIMIT_FILESIZE, 1024,	"file size",		"blocks" },
+#ifdef RLIMIT_SIGPENDING
+  { 'i',	RLIMIT_SIGPENDING, 1,	"pending signals",	(char *)NULL},
+#endif
 #ifdef RLIMIT_MEMLOCK
   { 'l',	RLIMIT_MEMLOCK, 1024,	"max locked memory",	"kbytes" },
 #endif
@@ -208,6 +219,12 @@
 #endif /* RLIMIT_RSS */
   { 'n',	RLIMIT_OPENFILES, 1,	"open files",		(char *)NULL},
   { 'p',	RLIMIT_PIPESIZE, 512,	"pipe size", 		"512 bytes" },
+#ifdef RLIMIT_MSGQUEUE
+  { 'q',	RLIMIT_MSGQUEUE, 1,	"POSIX message queues",	"bytes" },
+#endif
+#ifdef RLIMIT_RTPRIO
+  { 'r',	RLIMIT_RTPRIO, 1,	"max rt priority",	(char *)NULL},
+#endif /* RLIMIT_RTPRIO */
 #ifdef RLIMIT_STACK
   { 's',	RLIMIT_STACK, 1024,	"stack size",		"kbytes" },
 #endif
@@ -221,6 +238,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]))
@@ -647,11 +667,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);
     }
 }
 
@@ -670,7 +690,7 @@
       else
         sprintf (unitstr, "(-%c) ", limits[limind].option);
 
-      printf ("%-18s %16s", limits[limind].description, unitstr);
+      printf ("%-20s %16s", limits[limind].description, unitstr);
     }
   if (curlim == RLIM_INFINITY)
     puts ("unlimited");
--- bash-3.0/doc/bashref.texi
+++ bash-3.0/doc/bashref.texi
@@ -3793,7 +3793,7 @@
 @item ulimit
 @btindex ulimit
 @example
-ulimit [-acdflmnpstuvSH] [@var{limit}]
+ulimit [-acdeflmnpqrstuvxSH] [@var{limit}]
 @end example
 @code{ulimit} provides control over the resources available to processes
 started by the shell, on systems that allow such control.  If an
@@ -3814,9 +3814,15 @@
 @item -d
 The maximum size of a process's data segment.
 
+@item -e
+The maximum scheduling priority.
+
 @item -f
 The maximum size of files created by the shell.
 
+@item -i
+The maximum number of pending signals.
+
 @item -l
 The maximum size that may be locked into memory.
 
@@ -3829,6 +3835,12 @@
 @item -p
 The pipe buffer size.
 
+@item -q
+The maximum number of bytes in POSIX message queues.
+
+@item -r
+The maximum RT priority.
+
 @item -s
 The maximum stack size.
 
@@ -3841,6 +3853,9 @@
 @item -v
 The maximum amount of virtual memory available to the process.
 
+@item -x
+The maximum amount of file locks.
+
 @end table
 
 If @var{limit} is given, it is the new value of the specified resource;
--- bash-3.0/doc/bash.1
+++ bash-3.0/doc/bash.1
@@ -8362,7 +8362,7 @@
 returns true if any of the arguments are found, false if
 none are found.
 .TP
-\fBulimit\fP [\fB\-SHacdflmnpstuv\fP [\fIlimit\fP]]
+\fBulimit\fP [\fB\-SHacdefilmnpqrstuvx\fP [\fIlimit\fP]]
 Provides control over the resources available to the shell and to
 processes started by it, on systems that allow such control.
 The \fB\-H\fP and \fB\-S\fP options specify that the hard or soft limit is
@@ -8398,9 +8398,15 @@
 .B \-d
 The maximum size of a process's data segment
 .TP
+.B \-e
+The maximum scheduling priority (`nice')
+.TP
 .B \-f
 The maximum size of files created by the shell
 .TP
+.B \-i
+The maximum number of pending signals
+.TP
 .B \-l
 The maximum size that may be locked into memory
 .TP
@@ -8414,6 +8420,12 @@
 .B \-p
 The pipe size in 512-byte blocks (this may not be set)
 .TP
+.B \-q
+The maximum number of bytes in POSIX message queues
+.TP
+.B \-r
+The maximum rt priority
+.TP
 .B \-s
 The maximum stack size
 .TP
@@ -8425,6 +8437,9 @@
 .TP
 .B \-v
 The maximum amount of virtual memory available to the shell
+.TP
+.B \-x
+The maximum number of file locks
 .PD
 .PP
 If