summaryrefslogtreecommitdiffstats
path: root/sys-utils
diff options
context:
space:
mode:
authorKarel Zak2015-07-20 12:05:32 +0200
committerKarel Zak2015-07-20 12:05:32 +0200
commit79f4c272cf7628e50f562885578061f841c220cd (patch)
tree47b46e192906c0a8ddca99bf69bac7100ac3e072 /sys-utils
parentlsipc: default to --global (diff)
downloadkernel-qcow2-util-linux-79f4c272cf7628e50f562885578061f841c220cd.tar.gz
kernel-qcow2-util-linux-79f4c272cf7628e50f562885578061f841c220cd.tar.xz
kernel-qcow2-util-linux-79f4c272cf7628e50f562885578061f841c220cd.zip
ipcmk: support <size>{K,M,G,...}
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils')
-rw-r--r--sys-utils/ipcmk.12
-rw-r--r--sys-utils/ipcmk.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/sys-utils/ipcmk.1 b/sys-utils/ipcmk.1
index 48e34bff0..19b7532e8 100644
--- a/sys-utils/ipcmk.1
+++ b/sys-utils/ipcmk.1
@@ -18,6 +18,8 @@ Resources can be specified with these options:
Create a shared memory segment of
.I size
bytes.
+The \fIsize\fR argument may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, etc. (the
+"iB" is optional, e.g., "K" has the same meaning as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, etc.
.TP
.BR \-Q , " \-\-queue"
Create a message queue.
diff --git a/sys-utils/ipcmk.c b/sys-utils/ipcmk.c
index ff768c701..d79071c8d 100644
--- a/sys-utils/ipcmk.c
+++ b/sys-utils/ipcmk.c
@@ -107,7 +107,7 @@ int main(int argc, char **argv)
while((opt = getopt_long(argc, argv, "hM:QS:p:Vh", longopts, NULL)) != -1) {
switch(opt) {
case 'M':
- size = strtou64_or_err(optarg, _("failed to parse size"));
+ size = strtosize_or_err(optarg, _("failed to parse size"));
ask_shm = 1;
break;
case 'Q':