diff options
Diffstat (limited to 'src/lib/libc/string/memcpy.3')
-rw-r--r-- | src/lib/libc/string/memcpy.3 | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/src/lib/libc/string/memcpy.3 b/src/lib/libc/string/memcpy.3 index 3f4bb643c9..8df2a785b9 100644 --- a/src/lib/libc/string/memcpy.3 +++ b/src/lib/libc/string/memcpy.3 | |||
@@ -1,3 +1,5 @@ | |||
1 | .\" $OpenBSD: memcpy.3,v 1.10 2013/06/05 03:39:23 tedu Exp $ | ||
2 | .\" | ||
1 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. | 3 | .\" Copyright (c) 1990, 1991 The Regents of the University of California. |
2 | .\" All rights reserved. | 4 | .\" All rights reserved. |
3 | .\" | 5 | .\" |
@@ -13,11 +15,7 @@ | |||
13 | .\" 2. Redistributions in binary form must reproduce the above copyright | 15 | .\" 2. Redistributions in binary form must reproduce the above copyright |
14 | .\" notice, this list of conditions and the following disclaimer in the | 16 | .\" notice, this list of conditions and the following disclaimer in the |
15 | .\" documentation and/or other materials provided with the distribution. | 17 | .\" documentation and/or other materials provided with the distribution. |
16 | .\" 3. All advertising materials mentioning features or use of this software | 18 | .\" 3. Neither the name of the University nor the names of its contributors |
17 | .\" must display the following acknowledgement: | ||
18 | .\" This product includes software developed by the University of | ||
19 | .\" California, Berkeley and its contributors. | ||
20 | .\" 4. Neither the name of the University nor the names of its contributors | ||
21 | .\" may be used to endorse or promote products derived from this software | 19 | .\" may be used to endorse or promote products derived from this software |
22 | .\" without specific prior written permission. | 20 | .\" without specific prior written permission. |
23 | .\" | 21 | .\" |
@@ -33,52 +31,49 @@ | |||
33 | .\" 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 |
34 | .\" SUCH DAMAGE. | 32 | .\" SUCH DAMAGE. |
35 | .\" | 33 | .\" |
36 | .\" from: @(#)memcpy.3 5.5 (Berkeley) 6/29/91 | 34 | .Dd $Mdocdate: June 5 2013 $ |
37 | .\" $Id: memcpy.3,v 1.1.1.1 1995/10/18 08:42:21 deraadt Exp $ | ||
38 | .\" | ||
39 | .Dd June 29, 1991 | ||
40 | .Dt MEMCPY 3 | 35 | .Dt MEMCPY 3 |
41 | .Os | 36 | .Os |
42 | .Sh NAME | 37 | .Sh NAME |
43 | .Nm memcpy | 38 | .Nm memcpy |
44 | .Nd copy byte string | 39 | .Nd copy bytes |
45 | .Sh SYNOPSIS | 40 | .Sh SYNOPSIS |
46 | .Fd #include <string.h> | 41 | .In string.h |
47 | .Ft void * | 42 | .Ft void * |
48 | .Fn memcpy "void *dst" "const void *src" "size_t len" | 43 | .Fn memcpy "void *dst" "const void *src" "size_t len" |
49 | .Sh DESCRIPTION | 44 | .Sh DESCRIPTION |
50 | The | 45 | The |
51 | .Fn memcpy | 46 | .Fn memcpy |
52 | function | 47 | function copies |
53 | copies | ||
54 | .Fa len | 48 | .Fa len |
55 | bytes from string | 49 | bytes from buffer |
56 | .Fa src | 50 | .Fa src |
57 | to string | 51 | to buffer |
58 | .Fa dst . | 52 | .Fa dst . |
53 | If the two buffers may overlap, | ||
54 | .Xr memmove 3 | ||
55 | must be used instead. | ||
59 | .Sh RETURN VALUES | 56 | .Sh RETURN VALUES |
60 | The | 57 | The |
61 | .Fn memcpy | 58 | .Fn memcpy |
62 | function | 59 | function returns the original value of |
63 | returns the original value of | ||
64 | .Fa dst . | 60 | .Fa dst . |
65 | .Sh SEE ALSO | 61 | .Sh SEE ALSO |
66 | .Xr bcopy 3 , | 62 | .Xr bcopy 3 , |
67 | .Xr memccpy 3 , | 63 | .Xr memccpy 3 , |
68 | .Xr memmove 3 , | 64 | .Xr memmove 3 , |
69 | .Xr strcpy 3 | 65 | .Xr strcpy 3 , |
66 | .Xr strlcpy 3 , | ||
67 | .Xr wmemcpy 3 | ||
70 | .Sh STANDARDS | 68 | .Sh STANDARDS |
71 | The | 69 | The |
72 | .Fn memcpy | 70 | .Fn memcpy |
73 | function | 71 | function conforms to |
74 | conforms to | ||
75 | .St -ansiC . | 72 | .St -ansiC . |
76 | .Sh BUGS | 73 | .Sh HISTORY |
77 | In this implementation | 74 | The |
78 | .Fn memcpy | 75 | .Fn memcpy |
79 | is implemented using | 76 | function first appeared in |
80 | .Xr bcopy 3 , | 77 | .At V |
81 | and therefore the strings may overlap. | 78 | and was reimplemented for |
82 | On other systems, copying overlapping strings may produce surprises. | 79 | .Bx 4.3 Tahoe . |
83 | A simpler solution is to not use | ||
84 | .Fn memcpy . | ||