Loading...
string/memcpy.3 Libc-763.13 Libc-262
--- Libc/Libc-763.13/string/memcpy.3
+++ Libc/Libc-262/string/memcpy.3
@@ -13,6 +13,10 @@
 .\" 2. Redistributions in binary form must reproduce the above copyright
 .\"    notice, this list of conditions and the following disclaimer in the
 .\"    documentation and/or other materials provided with the distribution.
+.\" 3. All advertising materials mentioning features or use of this software
+.\"    must display the following acknowledgement:
+.\"	This product includes software developed by the University of
+.\"	California, Berkeley and its contributors.
 .\" 4. Neither the name of the University nor the names of its contributors
 .\"    may be used to endorse or promote products derived from this software
 .\"    without specific prior written permission.
@@ -30,61 +34,53 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)memcpy.3	8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/string/memcpy.3,v 1.9 2009/04/07 13:42:53 trasz Exp $
+.\" $FreeBSD: src/lib/libc/string/memcpy.3,v 1.6 2001/10/01 16:09:00 ru Exp $
 .\"
 .Dd June 4, 1993
 .Dt MEMCPY 3
 .Os
 .Sh NAME
 .Nm memcpy
-.Nd copy memory area
+.Nd copy byte string
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
 .In string.h
 .Ft void *
-.Fo memcpy
-.Fa "void *restrict s1"
-.Fa "const void *restrict s2"
-.Fa "size_t n"
-.Fc
+.Fn memcpy "void *dst" "const void *src" "size_t len"
 .Sh DESCRIPTION
 The
 .Fn memcpy
 function
 copies
-.Fa n
-bytes from memory area
-.Fa s2
-to memory area
-.Fa s1 .
-If 
-.Fa s1
-and 
-.Fa s2
-overlap, behavior is undefined.
-Applications in which
-.Fa s1
-and 
-.Fa s2 
-might overlap should use
-.Xr memmove 3
-instead.
+.Fa len
+bytes from string
+.Fa src
+to string
+.Fa dst .
 .Sh RETURN VALUES
 The
 .Fn memcpy
 function
 returns the original value of
-.Fa s1 .
+.Fa dst .
 .Sh SEE ALSO
 .Xr bcopy 3 ,
 .Xr memccpy 3 ,
 .Xr memmove 3 ,
-.Xr strcpy 3 ,
-.Xr wmemcpy 3
+.Xr strcpy 3
 .Sh STANDARDS
 The
 .Fn memcpy
 function
 conforms to
 .St -isoC .
+.Sh BUGS
+In this implementation
+.Fn memcpy
+is implemented using
+.Xr bcopy 3 ,
+and therefore the strings may overlap.
+On other systems, copying overlapping strings may produce surprises.
+A simpler solution is to not use
+.Fn memcpy .