diff options
Diffstat (limited to 'util-linux/ipcs.c')
-rw-r--r-- | util-linux/ipcs.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/util-linux/ipcs.c b/util-linux/ipcs.c index 1404930d4..7092ecd92 100644 --- a/util-linux/ipcs.c +++ b/util-linux/ipcs.c | |||
@@ -15,26 +15,10 @@ | |||
15 | //config: The ipcs utility is used to provide information on the currently | 15 | //config: The ipcs utility is used to provide information on the currently |
16 | //config: allocated System V interprocess (IPC) objects in the system. | 16 | //config: allocated System V interprocess (IPC) objects in the system. |
17 | 17 | ||
18 | //applet:IF_IPCS(APPLET(ipcs, BB_DIR_USR_BIN, BB_SUID_DROP)) | 18 | //applet:IF_IPCS(APPLET_NOEXEC(ipcs, ipcs, BB_DIR_USR_BIN, BB_SUID_DROP, ipcs)) |
19 | 19 | ||
20 | //kbuild:lib-$(CONFIG_IPCS) += ipcs.o | 20 | //kbuild:lib-$(CONFIG_IPCS) += ipcs.o |
21 | 21 | ||
22 | //usage:#define ipcs_trivial_usage | ||
23 | //usage: "[[-smq] -i shmid] | [[-asmq] [-tcplu]]" | ||
24 | //usage:#define ipcs_full_usage "\n\n" | ||
25 | //usage: " -i Show specific resource" | ||
26 | //usage: "\nResource specification:" | ||
27 | //usage: "\n -m Shared memory segments" | ||
28 | //usage: "\n -q Message queues" | ||
29 | //usage: "\n -s Semaphore arrays" | ||
30 | //usage: "\n -a All (default)" | ||
31 | //usage: "\nOutput format:" | ||
32 | //usage: "\n -t Time" | ||
33 | //usage: "\n -c Creator" | ||
34 | //usage: "\n -p Pid" | ||
35 | //usage: "\n -l Limits" | ||
36 | //usage: "\n -u Summary" | ||
37 | |||
38 | /* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */ | 22 | /* X/OPEN tells us to use <sys/{types,ipc,sem}.h> for semctl() */ |
39 | /* X/OPEN tells us to use <sys/{types,ipc,msg}.h> for msgctl() */ | 23 | /* X/OPEN tells us to use <sys/{types,ipc,msg}.h> for msgctl() */ |
40 | /* X/OPEN tells us to use <sys/{types,ipc,shm}.h> for shmctl() */ | 24 | /* X/OPEN tells us to use <sys/{types,ipc,shm}.h> for shmctl() */ |
@@ -585,6 +569,22 @@ static void print_sem(int semid) | |||
585 | bb_putchar('\n'); | 569 | bb_putchar('\n'); |
586 | } | 570 | } |
587 | 571 | ||
572 | //usage:#define ipcs_trivial_usage | ||
573 | //usage: "[[-smq] -i shmid] | [[-asmq] [-tcplu]]" | ||
574 | //usage:#define ipcs_full_usage "\n\n" | ||
575 | //usage: " -i Show specific resource" | ||
576 | //usage: "\nResource specification:" | ||
577 | //usage: "\n -m Shared memory segments" | ||
578 | //usage: "\n -q Message queues" | ||
579 | //usage: "\n -s Semaphore arrays" | ||
580 | //usage: "\n -a All (default)" | ||
581 | //usage: "\nOutput format:" | ||
582 | //usage: "\n -t Time" | ||
583 | //usage: "\n -c Creator" | ||
584 | //usage: "\n -p Pid" | ||
585 | //usage: "\n -l Limits" | ||
586 | //usage: "\n -u Summary" | ||
587 | |||
588 | int ipcs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 588 | int ipcs_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
589 | int ipcs_main(int argc UNUSED_PARAM, char **argv) | 589 | int ipcs_main(int argc UNUSED_PARAM, char **argv) |
590 | { | 590 | { |
@@ -632,6 +632,10 @@ int ipcs_main(int argc UNUSED_PARAM, char **argv) | |||
632 | flags |= flag_msg | flag_shm | flag_sem; | 632 | flags |= flag_msg | flag_shm | flag_sem; |
633 | bb_putchar('\n'); | 633 | bb_putchar('\n'); |
634 | 634 | ||
635 | if (flags & flag_msg) { | ||
636 | do_msg(); | ||
637 | bb_putchar('\n'); | ||
638 | } | ||
635 | if (flags & flag_shm) { | 639 | if (flags & flag_shm) { |
636 | do_shm(); | 640 | do_shm(); |
637 | bb_putchar('\n'); | 641 | bb_putchar('\n'); |
@@ -640,9 +644,5 @@ int ipcs_main(int argc UNUSED_PARAM, char **argv) | |||
640 | do_sem(); | 644 | do_sem(); |
641 | bb_putchar('\n'); | 645 | bb_putchar('\n'); |
642 | } | 646 | } |
643 | if (flags & flag_msg) { | ||
644 | do_msg(); | ||
645 | bb_putchar('\n'); | ||
646 | } | ||
647 | fflush_stdout_and_exit(EXIT_SUCCESS); | 647 | fflush_stdout_and_exit(EXIT_SUCCESS); |
648 | } | 648 | } |