|
@ -1,4 +1,4 @@ |
|
|
.\" $OpenBSD: memcpy.3,v 1.8 2011/07/25 00:38:52 schwarze Exp $ |
|
|
|
|
|
|
|
|
.\" $OpenBSD: memcpy.3,v 1.9 2013/06/04 03:02:09 deraadt Exp $ |
|
|
.\" |
|
|
.\" |
|
|
.\" Copyright (c) 1990, 1991 The Regents of the University of California. |
|
|
.\" Copyright (c) 1990, 1991 The Regents of the University of California. |
|
|
.\" All rights reserved. |
|
|
.\" All rights reserved. |
|
@ -31,7 +31,7 @@ |
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
|
|
.\" SUCH DAMAGE. |
|
|
.\" SUCH DAMAGE. |
|
|
.\" |
|
|
.\" |
|
|
.Dd $Mdocdate: July 25 2011 $ |
|
|
|
|
|
|
|
|
.Dd $Mdocdate: June 4 2013 $ |
|
|
.Dt MEMCPY 3 |
|
|
.Dt MEMCPY 3 |
|
|
.Os |
|
|
.Os |
|
|
.Sh NAME |
|
|
.Sh NAME |
|
@ -50,6 +50,9 @@ bytes from buffer |
|
|
.Fa src |
|
|
.Fa src |
|
|
to buffer |
|
|
to buffer |
|
|
.Fa dst . |
|
|
.Fa dst . |
|
|
|
|
|
If the two buffers may overlap, |
|
|
|
|
|
.Xr memmove 3 |
|
|
|
|
|
must be used instead. |
|
|
.Sh RETURN VALUES |
|
|
.Sh RETURN VALUES |
|
|
The |
|
|
The |
|
|
.Fn memcpy |
|
|
.Fn memcpy |
|
@ -74,12 +77,3 @@ function first appeared in |
|
|
.At V |
|
|
.At V |
|
|
and was reimplemented for |
|
|
and was reimplemented for |
|
|
.Bx 4.3 Tahoe . |
|
|
.Bx 4.3 Tahoe . |
|
|
.Sh CAVEATS |
|
|
|
|
|
In this implementation |
|
|
|
|
|
.Fn memcpy |
|
|
|
|
|
is implemented using |
|
|
|
|
|
.Xr bcopy 3 , |
|
|
|
|
|
and therefore the buffers may overlap. |
|
|
|
|
|
On other systems, copying overlapping buffers may produce surprises. |
|
|
|
|
|
A portable, safe solution is to use |
|
|
|
|
|
.Xr memmove 3 . |
|
|
|