Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: glibc rlimits change
- X-seq: zsh-workers 14419
- From: Clint Adams <clint@xxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: glibc rlimits change
- Date: Mon, 21 May 2001 13:00:38 -0400
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
In 2.2.3, rlimits are defined like this:
enum __rlimit_resource
{
/* Per-process CPU limit, in seconds. */
RLIMIT_CPU = 0,
#define RLIMIT_CPU RLIMIT_CPU
/* Largest file that can be created, in bytes. */
RLIMIT_FSIZE = 1,
#define RLIMIT_FSIZE RLIMIT_FSIZE
and so on.
Index: Src/Builtins/rlimits.awk
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Builtins/rlimits.awk,v
retrieving revision 1.2
diff -u -r1.2 rlimits.awk
--- Src/Builtins/rlimits.awk 2001/03/26 15:59:38 1.2
+++ Src/Builtins/rlimits.awk 2001/05/21 16:58:58
@@ -6,7 +6,7 @@
#
BEGIN {limidx = 0}
-/^[\t ]*(#[\t ]*define[\t _]*RLIMIT_[A-Z_]*[\t ]*[0-9][0-9]*|RLIMIT_[A-Z_]*,[\t ]*)/ {
+/^[\t ]*(#[\t ]*define[\t _]*RLIMIT_[A-Z_]*[\t ]*[0-9][0-9]*|RLIMIT_[A-Z_]*,[\t ]*|RLIMIT_[A-Z_]*[\t ]*=[\t ]*[0-9][0-9]*,[\t ]*)/ {
limindex = index($0, "RLIMIT_")
limtail = substr($0, limindex, 80)
split(limtail, tmp)
@@ -18,6 +18,11 @@
limindex = index($0, ",")
limnam = substr(limnam, 1, limindex-1)
}
+ if (limnum == "=") {
+ limnum = limidx++
+ limindex = index($0, ",")
+ limnam = substr(limnam, 1, limindex-1)
+ }
limrev[limnam] = limnum
if (lim[limnum] == "") {
lim[limnum] = limnam
@@ -52,6 +57,12 @@
# in case of GNU libc
/^[\t ]*RLIM_NLIMITS[\t ]*=[\t ]*RLIMIT_NLIMITS/ {
nlimits = limidx
+}
+/^[\t ]*RLIM_NLIMITS[\t ]*=[\t ]*[0-9][0-9]*/ {
+ limindex = index($0, "=")
+ limtail = substr($0, limindex, 80)
+ split(limtail, tmp)
+ nlimits = tmp[2]
}
END {
Messages sorted by:
Reverse Date,
Date,
Thread,
Author