[git commit] ash, hush: ulimit: add -i RLIMIT_SIGPENDING, -q RLIMIT_MSGQUEUE

Denys Vlasenko vda.linux at googlemail.com
Sun Apr 28 09:25:11 UTC 2019


commit: https://git.busybox.net/busybox/commit/?id=93f0b39a0712f3247349f1590757484ca18e725e
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
limits_tbl                                           104     120     +16
ulimit_opt_string                                     44      50      +6
limit_chars                                           14      16      +2
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 3/0 up/down: 24/0)               Total: 24 bytes
   text	   data	    bss	    dec	    hex	filename
 981996	    485	   7296	 989777	  f1a51	busybox_old
 982065	    485	   7296	 989846	  f1a96	busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/shell_common.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/shell/shell_common.c b/shell/shell_common.c
index cc518d54b..da3165329 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -344,6 +344,9 @@ static const struct limits limits_tbl[] = {
 	{ RLIMIT_NICE,		0,	"scheduling priority" },     // -e
 	{ RLIMIT_FSIZE,		9,	"file size (blocks)" },      // -f
 #define LIMIT_F_IDX     3
+#ifdef RLIMIT_SIGPENDING
+	{ RLIMIT_SIGPENDING,	0,	"pending signals" },         // -i
+#endif
 #ifdef RLIMIT_MEMLOCK
 	{ RLIMIT_MEMLOCK,	10,	"max locked memory (kb)" },  // -l
 #endif
@@ -353,6 +356,9 @@ static const struct limits limits_tbl[] = {
 #ifdef RLIMIT_NOFILE
 	{ RLIMIT_NOFILE,	0,	"open files" },              // -n
 #endif
+#ifdef RLIMIT_MSGQUEUE
+	{ RLIMIT_MSGQUEUE,	0,	"POSIX message queues (bytes)" }, // -q
+#endif
 #ifdef RLIMIT_RTPRIO
 	{ RLIMIT_RTPRIO,	0,	"real-time priority" },      // -r
 #endif
@@ -372,16 +378,17 @@ static const struct limits limits_tbl[] = {
 	{ RLIMIT_LOCKS,		0,	"file locks" },              // -x
 #endif
 };
-// bash also has these:
-//pending signals                 (-i) 61858   //RLIMIT_SIGPENDING
+// bash also shows:
 //pipe size            (512 bytes, -p) 8
-//POSIX message queues     (bytes, -q) 819200  //RLIMIT_MSGQUEUE
 
 static const char limit_chars[] ALIGN1 =
 			"c"
 			"d"
 			"e"
 			"f"
+#ifdef RLIMIT_SIGPENDING
+			"i"
+#endif
 #ifdef RLIMIT_MEMLOCK
 			"l"
 #endif
@@ -391,6 +398,9 @@ static const char limit_chars[] ALIGN1 =
 #ifdef RLIMIT_NOFILE
 			"n"
 #endif
+#ifdef RLIMIT_MSGQUEUE
+			"q"
+#endif
 #ifdef RLIMIT_RTPRIO
 			"r"
 #endif
@@ -417,6 +427,9 @@ static const char ulimit_opt_string[] ALIGN1 = "-HSa"
 			"d::"
 			"e::"
 			"f::"
+#ifdef RLIMIT_SIGPENDING
+			"i::"
+#endif
 #ifdef RLIMIT_MEMLOCK
 			"l::"
 #endif
@@ -426,6 +439,9 @@ static const char ulimit_opt_string[] ALIGN1 = "-HSa"
 #ifdef RLIMIT_NOFILE
 			"n::"
 #endif
+#ifdef RLIMIT_MSGQUEUE
+			"q::"
+#endif
 #ifdef RLIMIT_RTPRIO
 			"r::"
 #endif


More information about the busybox-cvs mailing list