summaryrefslogtreecommitdiffstats
path: root/sys-utils/ipcs.c
diff options
context:
space:
mode:
authorSami Kerola2012-12-16 11:43:52 +0100
committerKarel Zak2012-12-19 11:05:00 +0100
commit19b7b517b9a36ab4740ba8919d00d989c641c5e6 (patch)
tree01a8056b1e72278f7bd4fbcf4230ba6b067ecc50 /sys-utils/ipcs.c
parentipcs: add --human readable size conversion option (diff)
downloadkernel-qcow2-util-linux-19b7b517b9a36ab4740ba8919d00d989c641c5e6.tar.gz
kernel-qcow2-util-linux-19b7b517b9a36ab4740ba8919d00d989c641c5e6.tar.xz
kernel-qcow2-util-linux-19b7b517b9a36ab4740ba8919d00d989c641c5e6.zip
ipcs: add --bytes size output option
This makes the command being a little closer standard compliant. See IEEE Std 1003.1 referral link below for more information. References: http://pubs.opengroup.org/onlinepubs/009696799/utilities/ipcs.html Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/ipcs.c')
-rw-r--r--sys-utils/ipcs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys-utils/ipcs.c b/sys-utils/ipcs.c
index 66c6302e3..d611354c7 100644
--- a/sys-utils/ipcs.c
+++ b/sys-utils/ipcs.c
@@ -67,6 +67,7 @@ static void __attribute__ ((__noreturn__)) usage(FILE * out)
fputs(_(" -l, --limits show resource limits\n"), out);
fputs(_(" -u, --summary show status summary\n"), out);
fputs(_(" --human show sizes in human readable format\n"), out);
+ fputs(_(" -b, --bytes show sizes in bytes\n"), out);
fprintf(out, USAGE_MAN_TAIL("ipcs(1)"));
exit(out == stderr ? EXIT_FAILURE : EXIT_SUCCESS);
}
@@ -88,11 +89,12 @@ int main (int argc, char **argv)
{"limits", no_argument, NULL, 'l'},
{"summary", no_argument, NULL, 'u'},
{"human", no_argument, NULL, OPT_HUMAN},
+ {"bytes", no_argument, NULL, 'b'},
{"version", no_argument, NULL, 'V'},
{"help", no_argument, NULL, 'h'},
{NULL, 0, NULL, 0}
};
- char options[] = "i:mqsatpcluVh";
+ char options[] = "i:mqsatpclubVh";
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
@@ -135,6 +137,9 @@ int main (int argc, char **argv)
case OPT_HUMAN:
unit = IPC_UNIT_HUMAN;
break;
+ case 'b':
+ unit = IPC_UNIT_BYTES;
+ break;
case 'h':
usage(stdout);
case 'V':