diff options
Diffstat (limited to 'src/lib/libc/stdlib/strtoul.3')
| -rw-r--r-- | src/lib/libc/stdlib/strtoul.3 | 29 |
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 |
| 63 | value. | 69 | value. |
| 64 | The | 70 | The |
| 65 | .Fn strtouq | 71 | .Fn strtoull |
| 66 | function converts the string in | 72 | function converts the string in |
| 67 | .Fa nptr | 73 | .Fa nptr |
| 68 | to a | 74 | to an |
| 69 | .Li u_quad_t | 75 | .Li unsigned long long |
| 70 | value. | 76 | value. |
| 77 | The | ||
| 78 | .Fn strtouq | ||
| 79 | function is a deprecated equivalent of | ||
| 80 | .Fn strtoull | ||
| 81 | and is provided for backwards compatibility with legacy programs. | ||
| 71 | The conversion is done according to the given | 82 | The conversion is done according to the given |
| 72 | .Fa base , | 83 | .Fa base , |
| 73 | which must be a number between 2 and 36 inclusive | 84 | which must be a number between 2 and 36 inclusive |
| @@ -148,6 +159,14 @@ and sets the global variable | |||
| 148 | to | 159 | to |
| 149 | .Er ERANGE . | 160 | .Er ERANGE . |
| 150 | .Pp | 161 | .Pp |
| 162 | The | ||
| 163 | .Fn strtoull | ||
| 164 | function has identical return values except that | ||
| 165 | .Dv ULLONG_MIN | ||
| 166 | and | ||
| 167 | .Dv ULLONG_MAX | ||
| 168 | are used to indicate underflow and overflow respectively. | ||
| 169 | .Pp | ||
| 151 | There is no way to determine if | 170 | There is no way to determine if |
| 152 | .Fn strtoul | 171 | .Fn strtoul |
| 153 | has processed a negative number (and returned an unsigned value) short of | 172 | has processed a negative number (and returned an unsigned value) short of |
