]> git.saurik.com Git - apple/libc.git/blob - stdlib/FreeBSD/atol.3.patch
6ad817701abd67786a30e6f4dc3f45b1654df60a
[apple/libc.git] / stdlib / FreeBSD / atol.3.patch
1 --- atol.3.orig 2010-02-08 16:26:10.000000000 -0800
2 +++ atol.3 2010-02-13 21:01:28.000000000 -0800
3 @@ -36,7 +36,8 @@
4 .Dt ATOL 3
5 .Os
6 .Sh NAME
7 -.Nm atol , atoll
8 +.Nm atol , atoll ,
9 +.Nm atol_l , atoll_l
10 .Nd convert
11 .Tn ASCII
12 string to
13 @@ -49,14 +50,19 @@ integer
14 .Sh SYNOPSIS
15 .In stdlib.h
16 .Ft long
17 -.Fn atol "const char *nptr"
18 +.Fn atol "const char *str"
19 .Ft "long long"
20 -.Fn atoll "const char *nptr"
21 +.Fn atoll "const char *str"
22 +.In xlocale.h
23 +.Ft long
24 +.Fn atol_l "const char *str" "locale_t loc"
25 +.Ft "long long"
26 +.Fn atoll_l "const char *str" "locale_t loc"
27 .Sh DESCRIPTION
28 The
29 .Fn atol
30 function converts the initial portion of the string pointed to by
31 -.Fa nptr
32 +.Fa str
33 to
34 .Vt long
35 integer
36 @@ -64,12 +70,12 @@ representation.
37 .Pp
38 It is equivalent to:
39 .Pp
40 -.Dl "strtol(nptr, (char **)NULL, 10);"
41 +.Dl "strtol(str, (char **)NULL, 10);"
42 .Pp
43 The
44 .Fn atoll
45 function converts the initial portion of the string pointed to by
46 -.Fa nptr
47 +.Fa str
48 to
49 .Vt "long long"
50 integer
51 @@ -77,8 +83,28 @@ representation.
52 .Pp
53 It is equivalent to:
54 .Pp
55 -.Dl "strtoll(nptr, (char **)NULL, 10);"
56 -.Sh COMPATIBILITY
57 +.Dl "strtoll(str, (char **)NULL, 10);"
58 +.Pp
59 +While the
60 +.Fn atol
61 +and
62 +.Fn atoll
63 +functions use the current locale, the
64 +.Fn atol_l
65 +and
66 +.Fn atoll_l
67 +functions may be passed locales directly. See
68 +.Xr xlocale 3
69 +for more information.
70 +.Sh IMPLEMENTATION NOTES
71 +The
72 +.Fn atol ,
73 +.Fn atoll ,
74 +.Fn atol_l ,
75 +and
76 +.Fn atoll_l
77 +functions are thread-safe and async-cancel-safe.
78 +.Pp
79 The
80 .Fx
81 implementations of the
82 @@ -121,7 +147,8 @@ on an error.
83 .Xr atoi 3 ,
84 .Xr strtod 3 ,
85 .Xr strtol 3 ,
86 -.Xr strtoul 3
87 +.Xr strtoul 3 ,
88 +.Xr xlocale 3
89 .Sh STANDARDS
90 The
91 .Fn atol