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.349
1 files changed, 25 insertions, 24 deletions
diff --git a/src/lib/libc/string/memcpy.3 b/src/lib/libc/string/memcpy.3
index 3f4bb643c9..e95d670ad9 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.8 2011/07/25 00:38:52 schwarze 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,15 +31,12 @@
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: July 25 2011 $
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.Fd #include <string.h>
47.Ft void * 42.Ft void *
@@ -49,36 +44,42 @@
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 .
59.Sh RETURN VALUES 53.Sh RETURN VALUES
60The 54The
61.Fn memcpy 55.Fn memcpy
62function 56function returns the original value of
63returns the original value of
64.Fa dst . 57.Fa dst .
65.Sh SEE ALSO 58.Sh SEE ALSO
66.Xr bcopy 3 , 59.Xr bcopy 3 ,
67.Xr memccpy 3 , 60.Xr memccpy 3 ,
68.Xr memmove 3 , 61.Xr memmove 3 ,
69.Xr strcpy 3 62.Xr strcpy 3 ,
63.Xr strlcpy 3 ,
64.Xr wmemcpy 3
70.Sh STANDARDS 65.Sh STANDARDS
71The 66The
72.Fn memcpy 67.Fn memcpy
73function 68function conforms to
74conforms to
75.St -ansiC . 69.St -ansiC .
76.Sh BUGS 70.Sh HISTORY
71The
72.Fn memcpy
73function first appeared in
74.At V
75and was reimplemented for
76.Bx 4.3 Tahoe .
77.Sh CAVEATS
77In this implementation 78In this implementation
78.Fn memcpy 79.Fn memcpy
79is implemented using 80is implemented using
80.Xr bcopy 3 , 81.Xr bcopy 3 ,
81and therefore the strings may overlap. 82and therefore the buffers may overlap.
82On other systems, copying overlapping strings may produce surprises. 83On other systems, copying overlapping buffers may produce surprises.
83A simpler solution is to not use 84A portable, safe solution is to use
84.Fn memcpy . 85.Xr memmove 3 .