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.333
1 files changed, 13 insertions, 20 deletions
diff --git a/src/lib/libc/string/memcpy.3 b/src/lib/libc/string/memcpy.3
index 3f4bb643c9..1deb03631b 100644
--- a/src/lib/libc/string/memcpy.3
+++ b/src/lib/libc/string/memcpy.3
@@ -13,11 +13,7 @@
13.\" 2. Redistributions in binary form must reproduce the above copyright 13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\" notice, this list of conditions and the following disclaimer in the 14.\" notice, this list of conditions and the following disclaimer in the
15.\" documentation and/or other materials provided with the distribution. 15.\" documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software 16.\" 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 17.\" may be used to endorse or promote products derived from this software
22.\" without specific prior written permission. 18.\" without specific prior written permission.
23.\" 19.\"
@@ -33,15 +29,14 @@
33.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
35.\" 31.\"
36.\" from: @(#)memcpy.3 5.5 (Berkeley) 6/29/91 32.\" $OpenBSD: memcpy.3,v 1.7 2007/05/31 19:19:32 jmc Exp $
37.\" $Id: memcpy.3,v 1.1.1.1 1995/10/18 08:42:21 deraadt Exp $
38.\" 33.\"
39.Dd June 29, 1991 34.Dd $Mdocdate: May 31 2007 $
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,34 @@
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
70.Sh STANDARDS 64.Sh STANDARDS
71The 65The
72.Fn memcpy 66.Fn memcpy
73function 67function conforms to
74conforms to
75.St -ansiC . 68.St -ansiC .
76.Sh BUGS 69.Sh BUGS
77In this implementation 70In this implementation
78.Fn memcpy 71.Fn memcpy
79is implemented using 72is implemented using
80.Xr bcopy 3 , 73.Xr bcopy 3 ,
81and therefore the strings may overlap. 74and therefore the buffers may overlap.
82On other systems, copying overlapping strings may produce surprises. 75On other systems, copying overlapping buffers may produce surprises.
83A simpler solution is to not use 76A simpler solution is to not use
84.Fn memcpy . 77.Fn memcpy .