| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | .\" $NetBSD: printf.3,v 1.57 2010/12/22 17:06:03 wiz Exp $ | | 1 | .\" $NetBSD: printf.3,v 1.58 2010/12/26 12:39:54 jnemeth Exp $ |
2 | .\" | | 2 | .\" |
3 | .\" Copyright (c) 1990, 1991, 1993 | | 3 | .\" Copyright (c) 1990, 1991, 1993 |
4 | .\" The Regents of the University of California. All rights reserved. | | 4 | .\" The Regents of the University of California. All rights reserved. |
5 | .\" | | 5 | .\" |
6 | .\" This code is derived from software contributed to Berkeley by | | 6 | .\" This code is derived from software contributed to Berkeley by |
7 | .\" Chris Torek and the American National Standards Committee X3, | | 7 | .\" Chris Torek and the American National Standards Committee X3, |
8 | .\" on Information Processing Systems. | | 8 | .\" on Information Processing Systems. |
9 | .\" | | 9 | .\" |
10 | .\" Redistribution and use in source and binary forms, with or without | | 10 | .\" Redistribution and use in source and binary forms, with or without |
11 | .\" modification, are permitted provided that the following conditions | | 11 | .\" modification, are permitted provided that the following conditions |
12 | .\" are met: | | 12 | .\" are met: |
13 | .\" 1. Redistributions of source code must retain the above copyright | | 13 | .\" 1. Redistributions of source code must retain the above copyright |
14 | .\" notice, this list of conditions and the following disclaimer. | | 14 | .\" notice, this list of conditions and the following disclaimer. |
| @@ -23,27 +23,27 @@ | | | @@ -23,27 +23,27 @@ |
23 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 23 | .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
24 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 24 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
25 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | | 25 | .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
26 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 26 | .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
27 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 27 | .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
28 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 28 | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
29 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 29 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
30 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 30 | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 31 | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
32 | .\" SUCH DAMAGE. | | 32 | .\" SUCH DAMAGE. |
33 | .\" | | 33 | .\" |
34 | .\" @(#)printf.3 8.1 (Berkeley) 6/4/93 | | 34 | .\" @(#)printf.3 8.1 (Berkeley) 6/4/93 |
35 | .\" | | 35 | .\" |
36 | .Dd December 22, 2010 | | 36 | .Dd December 26, 2010 |
37 | .Dt PRINTF 3 | | 37 | .Dt PRINTF 3 |
38 | .Os | | 38 | .Os |
39 | .Sh NAME | | 39 | .Sh NAME |
40 | .Nm printf , | | 40 | .Nm printf , |
41 | .Nm fprintf , | | 41 | .Nm fprintf , |
42 | .Nm dprintf | | 42 | .Nm dprintf |
43 | .Nm sprintf , | | 43 | .Nm sprintf , |
44 | .Nm snprintf , | | 44 | .Nm snprintf , |
45 | .Nm asprintf , | | 45 | .Nm asprintf , |
46 | .Nm vprintf , | | 46 | .Nm vprintf , |
47 | .Nm vfprintf , | | 47 | .Nm vfprintf , |
48 | .Nm vsprintf , | | 48 | .Nm vsprintf , |
49 | .Nm vdprintf , | | 49 | .Nm vdprintf , |
| @@ -119,27 +119,28 @@ and | | | @@ -119,27 +119,28 @@ and |
119 | and | | 119 | and |
120 | .Fn vasprintf | | 120 | .Fn vasprintf |
121 | write to a dynamically allocated string that is stored in | | 121 | write to a dynamically allocated string that is stored in |
122 | .Fa ret . | | 122 | .Fa ret . |
123 | .Pp | | 123 | .Pp |
124 | These functions write the output under the control of a | | 124 | These functions write the output under the control of a |
125 | .Fa format | | 125 | .Fa format |
126 | string that specifies how subsequent arguments | | 126 | string that specifies how subsequent arguments |
127 | (or arguments accessed via the variable-length argument facilities of | | 127 | (or arguments accessed via the variable-length argument facilities of |
128 | .Xr stdarg 3 ) | | 128 | .Xr stdarg 3 ) |
129 | are converted for output. | | 129 | are converted for output. |
130 | .Pp | | 130 | .Pp |
131 | .Fn vsnprintf_ss | | 131 | .Fn vsnprintf_ss |
132 | is a signal-safe standalone version that does handle floating point formats. | | 132 | is a signal-safe standalone version that does not handle |
| | | 133 | floating point formats. |
133 | .Pp | | 134 | .Pp |
134 | .Fn asprintf | | 135 | .Fn asprintf |
135 | and | | 136 | and |
136 | .Fn vasprintf | | 137 | .Fn vasprintf |
137 | return a pointer to a buffer sufficiently large to hold the | | 138 | return a pointer to a buffer sufficiently large to hold the |
138 | string in the | | 139 | string in the |
139 | .Fa ret | | 140 | .Fa ret |
140 | argument. | | 141 | argument. |
141 | This pointer should be passed to | | 142 | This pointer should be passed to |
142 | .Xr free 3 | | 143 | .Xr free 3 |
143 | to release the allocated storage when it is no longer needed. | | 144 | to release the allocated storage when it is no longer needed. |
144 | If sufficient space cannot be allocated, these functions | | 145 | If sufficient space cannot be allocated, these functions |
145 | will return \-1 and set | | 146 | will return \-1 and set |