]> granicus.if.org Git - spl/commitdiff
Fix bcopy() to allow memory area overlap
authorRicardo M. Correia <ricardo.correia@oracle.com>
Tue, 20 Jul 2010 20:48:51 +0000 (13:48 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 20 Jul 2010 20:48:53 +0000 (13:48 -0700)
Under Solaris bcopy() allows overlapping memory areas so we
must use memmove() instead of memcpy().

Signed-off-by: Ricardo M. Correia <ricardo.correia@oracle.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
include/sys/sysmacros.h

index eccfee34d15b08edf7443c249267261e1b13cc56..eded9abc0539232ffd8fc81b423fe4af0b781621 100644 (file)
 /* Map some simple functions.
  */
 #define bzero(ptr,size)                        memset(ptr,0,size)
-#define bcopy(src,dest,size)           memcpy(dest,src,size)
+#define bcopy(src,dest,size)           memmove(dest,src,size)
 #define bcmp(src,dest,size)            memcmp((src), (dest), (size_t)(size))
 
 /* Dtrace probes do not exist in the linux kernel */