]> git.saurik.com Git - apple/libc.git/blobdiff - string/FreeBSD/memcpy.3
Libc-1044.40.1.tar.gz
[apple/libc.git] / string / FreeBSD / memcpy.3
index b34bc17a029c15d92918299f21f1177497ba2104..a58e8daa41ad8fb783bf39dd0938815a9045cee0 100644 (file)
 .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 dst"
+.Fa "const void *restrict src"
+.Fa "size_t n"
+.Fc
 .Sh DESCRIPTION
 The
 .Fn memcpy
 function
 copies
-.Fa len
-bytes from string
+.Fa n
+bytes from memory area
 .Fa src
-to string
+to memory area
 .Fa dst .
+If 
+.Fa dst
+and 
+.Fa src
+overlap, behavior is undefined.
+Applications in which
+.Fa dst
+and 
+.Fa src 
+might overlap should use
+.Xr memmove 3
+instead.
 .Sh RETURN VALUES
 The
 .Fn memcpy
@@ -72,17 +88,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.
-Programs intended to be portable should use
-.Xr memmove 3
-when
-.Fa src
-and
-.Fa dst
-may overlap.