summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/strtoul.3
diff options
context:
space:
mode:
authormillert <>2002-06-29 00:20:11 +0000
committermillert <>2002-06-29 00:20:11 +0000
commit6adefe10f90940abb77fbd207bd42c11497679b9 (patch)
treeb09c3b0aa815c3c77e8a7c20492b1d18817cd32b /src/lib/libc/stdlib/strtoul.3
parente08f871ca434f7bd4986a8b654059f32fda1e02a (diff)
downloadopenbsd-6adefe10f90940abb77fbd207bd42c11497679b9.tar.gz
openbsd-6adefe10f90940abb77fbd207bd42c11497679b9.tar.bz2
openbsd-6adefe10f90940abb77fbd207bd42c11497679b9.zip
Replace strtou?q() with the more standard strtou?ll(), using weak
aliases to fake up strtou?q(). espie@ OK.
Diffstat (limited to 'src/lib/libc/stdlib/strtoul.3')
-rw-r--r--src/lib/libc/stdlib/strtoul.329
1 files changed, 24 insertions, 5 deletions
diff --git a/src/lib/libc/stdlib/strtoul.3 b/src/lib/libc/stdlib/strtoul.3
index 61269bc900..6d55de4d7a 100644
--- a/src/lib/libc/stdlib/strtoul.3
+++ b/src/lib/libc/stdlib/strtoul.3
@@ -33,21 +33,27 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 34.\" SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: strtoul.3,v 1.9 2002/04/30 16:31:42 mpech Exp $ 36.\" $OpenBSD: strtoul.3,v 1.10 2002/06/29 00:20:11 millert Exp $
37.\" 37.\"
38.Dd June 25, 1992 38.Dd June 25, 1992
39.Dt STRTOUL 3 39.Dt STRTOUL 3
40.Os 40.Os
41.Sh NAME 41.Sh NAME
42.Nm strtoul , 42.Nm strtoul ,
43.Nm strtoull ,
43.Nm strtouq 44.Nm strtouq
44.Nd convert a string to an unsigned long or uquad_t integer 45.Nd convert a string to an unsigned long or unsigned long long integer
45.Sh SYNOPSIS 46.Sh SYNOPSIS
46.Fd #include <stdlib.h> 47.Fd #include <stdlib.h>
47.Fd #include <limits.h> 48.Fd #include <limits.h>
48.Ft unsigned long 49.Ft unsigned long
49.Fn strtoul "const char *nptr" "char **endptr" "int base" 50.Fn strtoul "const char *nptr" "char **endptr" "int base"
50.Pp 51.Pp
52.Fd #include <stdlib.h>
53.Fd #include <limits.h>
54.Ft unsigned long long
55.Fn strtoull "const char *nptr" "char **endptr" "int base"
56.Pp
51.Fd #include <sys/types.h> 57.Fd #include <sys/types.h>
52.Fd #include <stdlib.h> 58.Fd #include <stdlib.h>
53.Fd #include <limits.h> 59.Fd #include <limits.h>
@@ -62,12 +68,17 @@ to an
62.Li unsigned long 68.Li unsigned long
63value. 69value.
64The 70The
65.Fn strtouq 71.Fn strtoull
66function converts the string in 72function converts the string in
67.Fa nptr 73.Fa nptr
68to a 74to an
69.Li u_quad_t 75.Li unsigned long long
70value. 76value.
77The
78.Fn strtouq
79function is a deprecated equivalent of
80.Fn strtoull
81and is provided for backwards compatibility with legacy programs.
71The conversion is done according to the given 82The conversion is done according to the given
72.Fa base , 83.Fa base ,
73which must be a number between 2 and 36 inclusive 84which must be a number between 2 and 36 inclusive
@@ -148,6 +159,14 @@ and sets the global variable
148to 159to
149.Er ERANGE . 160.Er ERANGE .
150.Pp 161.Pp
162The
163.Fn strtoull
164function has identical return values except that
165.Dv ULLONG_MIN
166and
167.Dv ULLONG_MAX
168are used to indicate underflow and overflow respectively.
169.Pp
151There is no way to determine if 170There is no way to determine if
152.Fn strtoul 171.Fn strtoul
153has processed a negative number (and returned an unsigned value) short of 172has processed a negative number (and returned an unsigned value) short of