about summary refs log tree commit diff
path: root/Src/Builtins
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Builtins')
-rw-r--r--Src/Builtins/rlimits.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/Src/Builtins/rlimits.c b/Src/Builtins/rlimits.c
index f8167a106..505b024e4 100644
--- a/Src/Builtins/rlimits.c
+++ b/Src/Builtins/rlimits.c
@@ -222,8 +222,21 @@ printulimit(int lim, int hard, int head)
     /* display the limit */
     if (limit == RLIM_INFINITY)
 	printf("unlimited\n");
-    else
-	printf("%ld\n", (long)limit);
+    else {
+# ifdef RLIM_T_IS_QUAD_T
+	printf("%qd\n", limit);
+# else
+#  ifdef RLIM_T_IS_LONG_LONG
+	printf("%lld\n", limit);
+#  else
+#   ifdef RLIM_T_IS_UNSIGNED
+	printf("%lu\n", limit);
+#   else
+	printf("%ld\n", limit);
+#   endif /* RLIM_T_IS_UNSIGNED */
+#  endif /* RLIM_T_IS_LONG_LONG */
+# endif /* RLIM_T_IS_QUAD_T */
+    }
 }
 
 /* limit: set or show resource limits.  The variable hard indicates *