From c73d67730ab2dedcdc1b171947392eecc94ba6dd Mon Sep 17 00:00:00 2001 From: trasz Date: Thu, 4 Feb 2016 15:21:01 +0000 Subject: Add 't' and 'p' postfixes to dd(1). MFC after: 1 month Sponsored by: The FreeBSD Foundation --- bin/dd/args.c | 8 ++++++++ bin/dd/dd.1 | 7 +++++-- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/dd/args.c b/bin/dd/args.c index 21e4aa1..1cbf3b3 100644 --- a/bin/dd/args.c +++ b/bin/dd/args.c @@ -383,6 +383,14 @@ postfix_to_mult(const char expr) case 'g': mult = 1 << 30; break; + case 'T': + case 't': + mult = (uintmax_t)1 << 40; + break; + case 'P': + case 'p': + mult = (uintmax_t)1 << 50; + break; case 'W': case 'w': mult = sizeof(int); diff --git a/bin/dd/dd.1 b/bin/dd/dd.1 index 0908642..4047cdc 100644 --- a/bin/dd/dd.1 +++ b/bin/dd/dd.1 @@ -32,7 +32,7 @@ .\" @(#)dd.1 8.2 (Berkeley) 1/13/94 .\" $FreeBSD$ .\" -.Dd August 28, 2014 +.Dd February 4, 2016 .Dt DD 1 .Os .Sh NAME @@ -332,10 +332,13 @@ If the number ends with a .Dq Li k , .Dq Li m , .Dq Li g , +.Dq Li t , +.Dq Li p , or .Dq Li w , the -number is multiplied by 512, 1024 (1K), 1048576 (1M), 1073741824 (1G) +number is multiplied by 512, 1024 (1K), 1048576 (1M), 1073741824 (1G), +1099511627776 (1T), 1125899906842624 (1P) or the number of bytes in an integer, respectively. Two or more numbers may be separated by an .Dq Li x -- cgit v1.1