expand_number(3) parses suffixes, not prefixes.

While here, tidy the opening sentence a bit.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D20791
This commit is contained in:
John Baldwin 2019-07-20 16:03:54 +00:00
parent 87c39157c6
commit 72a52ef8c4

View File

@ -25,7 +25,7 @@
.\" .\"
.\" $FreeBSD$ .\" $FreeBSD$
.\" .\"
.Dd August 15, 2010 .Dd July 20, 2019
.Dt EXPAND_NUMBER 3 .Dt EXPAND_NUMBER 3
.Os .Os
.Sh NAME .Sh NAME
@ -42,11 +42,10 @@
.Sh DESCRIPTION .Sh DESCRIPTION
The The
.Fn expand_number .Fn expand_number
function unformats the function parses the
.Fa buf .Fa buf
string and stores a unsigned 64-bit quantity at address pointed out by the string and stores a unsigned 64-bit quantity at
.Fa num .Fa *num .
argument.
.Pp .Pp
The The
.Fn expand_number .Fn expand_number
@ -54,9 +53,9 @@ function
is case-insensitive and is case-insensitive and
follows the SI power of two convention. follows the SI power of two convention.
.Pp .Pp
The prefixes are: The suffixes are:
.Bl -column "Prefix" "Description" "1000000000000000000" -offset indent .Bl -column "Suffix" "Description" "1000000000000000000" -offset indent
.It Sy "Prefix" Ta Sy "Description" Ta Sy "Multiplier" .It Sy "Suffix" Ta Sy "Description" Ta Sy "Multiplier"
.It Li K Ta No kilo Ta 1024 .It Li K Ta No kilo Ta 1024
.It Li M Ta No mega Ta 1048576 .It Li M Ta No mega Ta 1048576
.It Li G Ta No giga Ta 1073741824 .It Li G Ta No giga Ta 1073741824
@ -74,7 +73,7 @@ function will fail if:
.It Bq Er EINVAL .It Bq Er EINVAL
The given string contains no digits. The given string contains no digits.
.It Bq Er EINVAL .It Bq Er EINVAL
An unrecognized prefix was given. An unrecognized suffix was given.
.It Bq Er ERANGE .It Bq Er ERANGE
Result doesn't fit into 64 bits. Result doesn't fit into 64 bits.
.El .El