]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
ipcmk: support <size>{K,M,G,...}
authorKarel Zak <kzak@redhat.com>
Mon, 20 Jul 2015 10:05:32 +0000 (12:05 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 20 Jul 2015 10:05:32 +0000 (12:05 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/ipcmk.1
sys-utils/ipcmk.c

index 48e34bff00086e446dc3f2f94295ebb344e293be..19b7532e85c96a78101f4570901ee7b6e055d536 100644 (file)
@@ -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.
index ff768c701a2a935f844af132b78ec22b0beea281..d79071c8d97efd30a1d61d4ff778349e7979fcc1 100644 (file)
@@ -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':