about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/Builtins/rlimits.awk2
-rw-r--r--Src/Builtins/rlimits.c36
-rw-r--r--Src/Builtins/rlimits.mdd2
3 files changed, 36 insertions, 4 deletions
diff --git a/Src/Builtins/rlimits.awk b/Src/Builtins/rlimits.awk
index b96941125..418206a66 100644
--- a/Src/Builtins/rlimits.awk
+++ b/Src/Builtins/rlimits.awk
@@ -53,6 +53,7 @@ BEGIN {limidx = 0}
 	    if (limnam == "MSGQUEUE") { msg[limnum] = "Nmsgqueue" }
 	    if (limnam == "NICE") { msg[limnum] = "Nnice" }
 	    if (limnam == "RTPRIO") { msg[limnum] = "Nrt_priority" }
+	    if (limnam == "RTTIME") { msg[limnum] = "Urt_time" }
         }
     }
 }
@@ -99,6 +100,7 @@ END {
 	    if(limtype == "M") { limtype = "MEMORY" }
 	    if(limtype == "N") { limtype = "NUMBER" }
 	    if(limtype == "T") { limtype = "TIME" }
+	    if(limtype == "U") { limtype = "MICROSECONDS" }
 	}
 	printf("\tZLIMTYPE_%s,\n", limtype)
     }
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c
index ffcb92052..73bbe10f1 100644
--- a/Src/Builtins/rlimits.c
+++ b/Src/Builtins/rlimits.c
@@ -36,6 +36,7 @@ enum {
     ZLIMTYPE_MEMORY,
     ZLIMTYPE_NUMBER,
     ZLIMTYPE_TIME,
+    ZLIMTYPE_MICROSECONDS,
     ZLIMTYPE_UNKNOWN
 };
 
@@ -113,10 +114,37 @@ showlimitvalue(int lim, rlim_t val)
 	   seconds. */
 	printf("%d:%02d:%02d\n", (int)(val / 3600),
 	       (int)(val / 60) % 60, (int)(val % 60));
+    } else if (limtype[lim] == ZLIMTYPE_MICROSECONDS) {
+	/* microseconds */
+# ifdef RLIM_T_IS_QUAD_T
+	printf("%qdus\n", val);
+# else
+#  ifdef RLIM_T_IS_LONG_LONG
+	printf("%lldus\n", val);
+#  else
+#   ifdef RLIM_T_IS_UNSIGNED
+	printf("%luus\n", val);
+#   else
+	printf("%ldus\n", val);
+#   endif /* RLIM_T_IS_UNSIGNED */
+#  endif /* RLIM_T_IS_LONG_LONG */
+# endif /* RLIM_T_IS_QUAD_T */
     } else if (limtype[lim] == ZLIMTYPE_NUMBER ||
 	       limtype[lim] == ZLIMTYPE_UNKNOWN) {
 	/* pure numeric resource */
-	printf("%d\n", (int)val);
+# ifdef RLIM_T_IS_QUAD_T
+	printf("%qd\n", val);
+# else
+#  ifdef RLIM_T_IS_LONG_LONG
+	printf("%lld\n", val);
+#  else
+#   ifdef RLIM_T_IS_UNSIGNED
+	printf("%lu\n", val);
+#   else
+	printf("%ld\n", val);
+#   endif /* RLIM_T_IS_UNSIGNED */
+#  endif /* RLIM_T_IS_LONG_LONG */
+# endif /* RLIM_T_IS_QUAD_T */
     } else if (val >= 1024L * 1024L)
 	/* memory resource -- display with `K' or `M' modifier */
 # ifdef RLIM_T_IS_QUAD_T
@@ -125,7 +153,7 @@ showlimitvalue(int lim, rlim_t val)
 	printf("%qdkB\n", val / 1024L);
 # else
 #  ifdef RLIM_T_IS_LONG_LONG
-    printf("%lldMB\n", val / (1024L * 1024L));
+	printf("%lldMB\n", val / (1024L * 1024L));
     else
 	printf("%lldkB\n", val / 1024L);
 #  else
@@ -539,7 +567,9 @@ bin_limit(char *nam, char **argv, Options ops, UNUSED(int func))
 		    return 1;
 		}
 	    }
-	} else if (limtype[lim] == ZLIMTYPE_NUMBER || limtype[lim] == ZLIMTYPE_UNKNOWN) {
+	} else if (limtype[lim] == ZLIMTYPE_NUMBER ||
+		   limtype[lim] == ZLIMTYPE_UNKNOWN ||
+		   limtype[lim] == ZLIMTYPE_MICROSECONDS) {
 	    /* pure numeric resource -- only a straight decimal number is
 	    permitted. */
 	    char *t = s;
diff --git a/Src/Builtins/rlimits.mdd b/Src/Builtins/rlimits.mdd
index ca9fa8b84..9e6e9e598 100644
--- a/Src/Builtins/rlimits.mdd
+++ b/Src/Builtins/rlimits.mdd
@@ -14,7 +14,7 @@ rlimits.o rlimits..o: rlimits.h
 rlimits.h: rlimits.awk @RLIMITS_INC_H@
 	$(AWK) -f $(sdir)/rlimits.awk @RLIMITS_INC_H@ /dev/null > rlimits.h
 	@if grep ZLIMTYPE_UNKNOWN rlimits.h >/dev/null; then \
-	    echo >&2 WARNING: unknown limits: mail rlimits.h to developers; \
+	    echo >&2 WARNING: unknown limits: mail Src/Builtins/rlimits.h to developers; \
 	else :; fi
 
 clean-here: clean.rlimits