Browse Source

remove some incredible lies about overlapping buffers

ok guenther
OPENBSD_5_4
deraadt 11 years ago
parent
commit
8d8738cfc7
2 changed files with 10 additions and 22 deletions
  1. +5
    -11
      src/lib/libc/string/memcpy.3
  2. +5
    -11
      src/lib/libc/string/wmemcpy.3

+ 5
- 11
src/lib/libc/string/memcpy.3 View File

@ -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 .

+ 5
- 11
src/lib/libc/string/wmemcpy.3 View File

@ -1,4 +1,4 @@
.\" $OpenBSD: wmemcpy.3,v 1.3 2011/07/25 00:38:53 schwarze Exp $
.\" $OpenBSD: wmemcpy.3,v 1.4 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 WMEMCPY 3 .Dt WMEMCPY 3
.Os .Os
.Sh NAME .Sh NAME
@ -50,6 +50,9 @@ wide characters from buffer
.Fa src .Fa src
to buffer to buffer
.Fa dst . .Fa dst .
If the two buffers may overlap,
.Xr wmemmove 3
must be used instead.
.Sh RETURN VALUES .Sh RETURN VALUES
The The
.Fn wmemcpy .Fn wmemcpy
@ -74,12 +77,3 @@ function was ported from
.Nx .Nx
and first appeared in and first appeared in
.Ox 3.8 . .Ox 3.8 .
.Sh CAVEATS
In this implementation
.Fn wmemcpy
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 wmemmove 3 .

Loading…
Cancel
Save