memcpy.3.patch   [plain text]


--- memcpy.3.orig	Fri May 28 17:44:25 2004
+++ memcpy.3	Fri May 28 17:45:22 2004
@@ -41,7 +41,7 @@
 .Os
 .Sh NAME
 .Nm memcpy
-.Nd copy byte string
+.Nd copy memory area
 .Sh LIBRARY
 .Lb libc
 .Sh SYNOPSIS
@@ -54,10 +54,22 @@
 function
 copies
 .Fa len
-bytes from string
+bytes from memory area
 .Fa src
-to string
+to memory area
 .Fa dst .
+If 
+.Fa src
+and 
+.Fa dst
+overlap, behavior is undefined.
+Applications in which
+.Fa src
+and 
+.Fa dst 
+might overlap should use
+.Xr memmove 3
+instead.
 .Sh RETURN VALUES
 The
 .Fn memcpy
@@ -75,17 +87,3 @@
 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.