diff options
| author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-04-28 11:25:11 +0200 |
|---|---|---|
| committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-04-28 11:25:11 +0200 |
| commit | 93f0b39a0712f3247349f1590757484ca18e725e (patch) | |
| tree | 77702402cb3af3a2355f3fb390c4e13cefff8832 /shell | |
| parent | 57e1b0ad5ebd77705841fbcd01a79f2552fbab8e (diff) | |
| download | busybox-w32-93f0b39a0712f3247349f1590757484ca18e725e.tar.gz busybox-w32-93f0b39a0712f3247349f1590757484ca18e725e.tar.bz2 busybox-w32-93f0b39a0712f3247349f1590757484ca18e725e.zip | |
ash,hush: ulimit: add -i RLIMIT_SIGPENDING, -q RLIMIT_MSGQUEUE
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@googlemail.com>
Diffstat (limited to 'shell')
| -rw-r--r-- | shell/shell_common.c | 22 |
1 files 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[] = { | |||
| 344 | { RLIMIT_NICE, 0, "scheduling priority" }, // -e | 344 | { RLIMIT_NICE, 0, "scheduling priority" }, // -e |
| 345 | { RLIMIT_FSIZE, 9, "file size (blocks)" }, // -f | 345 | { RLIMIT_FSIZE, 9, "file size (blocks)" }, // -f |
| 346 | #define LIMIT_F_IDX 3 | 346 | #define LIMIT_F_IDX 3 |
| 347 | #ifdef RLIMIT_SIGPENDING | ||
| 348 | { RLIMIT_SIGPENDING, 0, "pending signals" }, // -i | ||
| 349 | #endif | ||
| 347 | #ifdef RLIMIT_MEMLOCK | 350 | #ifdef RLIMIT_MEMLOCK |
| 348 | { RLIMIT_MEMLOCK, 10, "max locked memory (kb)" }, // -l | 351 | { RLIMIT_MEMLOCK, 10, "max locked memory (kb)" }, // -l |
| 349 | #endif | 352 | #endif |
| @@ -353,6 +356,9 @@ static const struct limits limits_tbl[] = { | |||
| 353 | #ifdef RLIMIT_NOFILE | 356 | #ifdef RLIMIT_NOFILE |
| 354 | { RLIMIT_NOFILE, 0, "open files" }, // -n | 357 | { RLIMIT_NOFILE, 0, "open files" }, // -n |
| 355 | #endif | 358 | #endif |
| 359 | #ifdef RLIMIT_MSGQUEUE | ||
| 360 | { RLIMIT_MSGQUEUE, 0, "POSIX message queues (bytes)" }, // -q | ||
| 361 | #endif | ||
| 356 | #ifdef RLIMIT_RTPRIO | 362 | #ifdef RLIMIT_RTPRIO |
| 357 | { RLIMIT_RTPRIO, 0, "real-time priority" }, // -r | 363 | { RLIMIT_RTPRIO, 0, "real-time priority" }, // -r |
| 358 | #endif | 364 | #endif |
| @@ -372,16 +378,17 @@ static const struct limits limits_tbl[] = { | |||
| 372 | { RLIMIT_LOCKS, 0, "file locks" }, // -x | 378 | { RLIMIT_LOCKS, 0, "file locks" }, // -x |
| 373 | #endif | 379 | #endif |
| 374 | }; | 380 | }; |
| 375 | // bash also has these: | 381 | // bash also shows: |
| 376 | //pending signals (-i) 61858 //RLIMIT_SIGPENDING | ||
| 377 | //pipe size (512 bytes, -p) 8 | 382 | //pipe size (512 bytes, -p) 8 |
| 378 | //POSIX message queues (bytes, -q) 819200 //RLIMIT_MSGQUEUE | ||
| 379 | 383 | ||
| 380 | static const char limit_chars[] ALIGN1 = | 384 | static const char limit_chars[] ALIGN1 = |
| 381 | "c" | 385 | "c" |
| 382 | "d" | 386 | "d" |
| 383 | "e" | 387 | "e" |
| 384 | "f" | 388 | "f" |
| 389 | #ifdef RLIMIT_SIGPENDING | ||
| 390 | "i" | ||
| 391 | #endif | ||
| 385 | #ifdef RLIMIT_MEMLOCK | 392 | #ifdef RLIMIT_MEMLOCK |
| 386 | "l" | 393 | "l" |
| 387 | #endif | 394 | #endif |
| @@ -391,6 +398,9 @@ static const char limit_chars[] ALIGN1 = | |||
| 391 | #ifdef RLIMIT_NOFILE | 398 | #ifdef RLIMIT_NOFILE |
| 392 | "n" | 399 | "n" |
| 393 | #endif | 400 | #endif |
| 401 | #ifdef RLIMIT_MSGQUEUE | ||
| 402 | "q" | ||
| 403 | #endif | ||
| 394 | #ifdef RLIMIT_RTPRIO | 404 | #ifdef RLIMIT_RTPRIO |
| 395 | "r" | 405 | "r" |
| 396 | #endif | 406 | #endif |
| @@ -417,6 +427,9 @@ static const char ulimit_opt_string[] ALIGN1 = "-HSa" | |||
| 417 | "d::" | 427 | "d::" |
| 418 | "e::" | 428 | "e::" |
| 419 | "f::" | 429 | "f::" |
| 430 | #ifdef RLIMIT_SIGPENDING | ||
| 431 | "i::" | ||
| 432 | #endif | ||
| 420 | #ifdef RLIMIT_MEMLOCK | 433 | #ifdef RLIMIT_MEMLOCK |
| 421 | "l::" | 434 | "l::" |
| 422 | #endif | 435 | #endif |
| @@ -426,6 +439,9 @@ static const char ulimit_opt_string[] ALIGN1 = "-HSa" | |||
| 426 | #ifdef RLIMIT_NOFILE | 439 | #ifdef RLIMIT_NOFILE |
| 427 | "n::" | 440 | "n::" |
| 428 | #endif | 441 | #endif |
| 442 | #ifdef RLIMIT_MSGQUEUE | ||
| 443 | "q::" | ||
| 444 | #endif | ||
| 429 | #ifdef RLIMIT_RTPRIO | 445 | #ifdef RLIMIT_RTPRIO |
| 430 | "r::" | 446 | "r::" |
| 431 | #endif | 447 | #endif |
