]> git.saurik.com Git - apple/libc.git/blobdiff - string/memcpy.3
Libc-498.1.7.tar.gz
[apple/libc.git] / string / memcpy.3
index 311fbec2da824846be843abd2e958039f2ca8bc1..326680d9ce37d7c256d063f6297d81b4cc5a520c 100644 (file)
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)memcpy.3   8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/string/memcpy.3,v 1.6 2001/10/01 16:09:00 ru Exp $
+.\" $FreeBSD: src/lib/libc/string/memcpy.3,v 1.7 2002/01/07 06:03:37 dd Exp $
 .\"
 .Dd June 4, 1993
 .Dt MEMCPY 3
 .Os
 .Sh NAME
 .Nm memcpy
-.Nd copy byte string
+.Nd copy memory area
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
 .In string.h
 .Ft void *
-.Fn memcpy "void *dst" "const void *src" "size_t len"
+.Fo memcpy
+.Fa "void *restrict s1"
+.Fa "const void *restrict s2"
+.Fa "size_t n"
+.Fc
 .Sh DESCRIPTION
 The
 .Fn memcpy
 function
 copies
-.Fa len
-bytes from string
-.Fa src
-to string
-.Fa dst .
+.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.
 .Sh RETURN VALUES
 The
 .Fn memcpy
 function
 returns the original value of
-.Fa dst .
+.Fa s1 .
 .Sh SEE ALSO
 .Xr bcopy 3 ,
 .Xr memccpy 3 ,
@@ -75,12 +91,3 @@ The
 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 .