summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/memcpy.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/memcpy.3')
-rw-r--r--src/lib/libc/string/memcpy.351
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
50The 45The
51.Fn memcpy 46.Fn memcpy
52function 47function copies
53copies
54.Fa len 48.Fa len
55bytes from string 49bytes from buffer
56.Fa src 50.Fa src
57to string 51to buffer
58.Fa dst . 52.Fa dst .
53If the two buffers may overlap,
54.Xr memmove 3
55must be used instead.
59.Sh RETURN VALUES 56.Sh RETURN VALUES
60The 57The
61.Fn memcpy 58.Fn memcpy
62function 59function returns the original value of
63returns 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
71The 69The
72.Fn memcpy 70.Fn memcpy
73function 71function conforms to
74conforms to
75.St -ansiC . 72.St -ansiC .
76.Sh BUGS 73.Sh HISTORY
77In this implementation 74The
78.Fn memcpy 75.Fn memcpy
79is implemented using 76function first appeared in
80.Xr bcopy 3 , 77.At V
81and therefore the strings may overlap. 78and was reimplemented for
82On other systems, copying overlapping strings may produce surprises. 79.Bx 4.3 Tahoe .
83A simpler solution is to not use
84.Fn memcpy .