summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/strtoul.3
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdlib/strtoul.3')
-rw-r--r--lib/libc/stdlib/strtoul.339
1 files changed, 30 insertions, 9 deletions
diff --git a/lib/libc/stdlib/strtoul.3 b/lib/libc/stdlib/strtoul.3
index ff60016..00be953 100644
--- a/lib/libc/stdlib/strtoul.3
+++ b/lib/libc/stdlib/strtoul.3
@@ -40,8 +40,8 @@
.Dt STRTOUL 3
.Os
.Sh NAME
-.Nm strtoul , strtoull , strtouq
-.Nd "convert a string to an unsigned long, unsigned long long, or uquad_t integer"
+.Nm strtoul , strtoull , strtoumax , strtouq
+.Nd "convert a string to an unsigned long, unsigned long long, uintmax_t, or uquad_t integer"
.Sh LIBRARY
.Lb libc
.Sh SYNOPSIS
@@ -51,6 +51,9 @@
.Fn strtoul "const char *nptr" "char **endptr" "int base"
.Ft unsigned long long
.Fn strtoull "const char *nptr" "char **endptr" "int base"
+.In inttypes.h
+.Ft uintmax_t
+.Fn strtoumax "const char *nptr" "char **endptr" "int base"
.In sys/types.h
.In stdlib.h
.In limits.h
@@ -74,6 +77,14 @@ to an
.Em unsigned long long
value.
The
+.Fn strtoumax
+function
+converts the string in
+.Fa nptr
+to an
+.Em uintmax_t
+value.
+The
.Fn strtouq
function
converts the string in
@@ -144,9 +155,11 @@ is
on return, the entire string was valid.)
.Sh RETURN VALUES
The
-.Fn strtoul
+.Fn strtoul ,
+.Fn strtoull ,
+.Fn strtoumax
or
-.Fn strtoull
+.Fn strtouq
function
returns either the result of the conversion
or, if there was a leading minus sign,
@@ -155,10 +168,16 @@ unless the original (non-negated) value would overflow;
in the latter case,
.Fn strtoul
returns
-.Dv ULONG_MAX
-and
+.Dv ULONG_MAX ,
.Fn strtoull
returns
+.Dv ULLONG_MAX ,
+.Fn strtoumax
+returns
+.Dv UINTMAX_MAX
+and
+.Fn strtouq
+returns
.Dv ULLONG_MAX .
In all cases,
.Va errno
@@ -189,10 +208,12 @@ conforms to
.St -isoC .
The
.Fn strtoull
-function
-conforms to
+and
+.Fn strtoumax
+functions
+conform to
.St -isoC-99 .
The
.Bx
-.Fn strtoq
+.Fn strtouq
function is deprecated.
OpenPOWER on IntegriCloud