summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorderaadt <>2013-06-04 03:02:09 +0000
committerderaadt <>2013-06-04 03:02:09 +0000
commit3c06c9f91ba98ce2cdea4031cbaf6c10a938902b (patch)
treec3c3d9b25876f08668d7f5d5da30a651f9aba647 /src
parentd3a69c8dead085c1a0135b03bc222fdb763b8053 (diff)
downloadopenbsd-3c06c9f91ba98ce2cdea4031cbaf6c10a938902b.tar.gz
openbsd-3c06c9f91ba98ce2cdea4031cbaf6c10a938902b.tar.bz2
openbsd-3c06c9f91ba98ce2cdea4031cbaf6c10a938902b.zip
remove some incredible lies about overlapping buffers
ok guenther
Diffstat (limited to 'src')
-rw-r--r--src/lib/libc/string/memcpy.316
-rw-r--r--src/lib/libc/string/wmemcpy.316
2 files changed, 10 insertions, 22 deletions
diff --git a/src/lib/libc/string/memcpy.3 b/src/lib/libc/string/memcpy.3
index e95d670ad9..51c458ee3e 100644
--- a/src/lib/libc/string/memcpy.3
+++ b/src/lib/libc/string/memcpy.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: memcpy.3,v 1.8 2011/07/25 00:38:52 schwarze Exp $ 1.\" $OpenBSD: memcpy.3,v 1.9 2013/06/04 03:02:09 deraadt Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
4.\" All rights reserved. 4.\" All rights reserved.
@@ -31,7 +31,7 @@
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
33.\" 33.\"
34.Dd $Mdocdate: July 25 2011 $ 34.Dd $Mdocdate: June 4 2013 $
35.Dt MEMCPY 3 35.Dt MEMCPY 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -50,6 +50,9 @@ bytes from buffer
50.Fa src 50.Fa src
51to buffer 51to buffer
52.Fa dst . 52.Fa dst .
53If the two buffers may overlap,
54.Xr memmove 3
55must be used instead.
53.Sh RETURN VALUES 56.Sh RETURN VALUES
54The 57The
55.Fn memcpy 58.Fn memcpy
@@ -74,12 +77,3 @@ function first appeared in
74.At V 77.At V
75and was reimplemented for 78and was reimplemented for
76.Bx 4.3 Tahoe . 79.Bx 4.3 Tahoe .
77.Sh CAVEATS
78In this implementation
79.Fn memcpy
80is implemented using
81.Xr bcopy 3 ,
82and therefore the buffers may overlap.
83On other systems, copying overlapping buffers may produce surprises.
84A portable, safe solution is to use
85.Xr memmove 3 .
diff --git a/src/lib/libc/string/wmemcpy.3 b/src/lib/libc/string/wmemcpy.3
index 1102640ad4..4bbab2909f 100644
--- a/src/lib/libc/string/wmemcpy.3
+++ b/src/lib/libc/string/wmemcpy.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: wmemcpy.3,v 1.3 2011/07/25 00:38:53 schwarze Exp $ 1.\" $OpenBSD: wmemcpy.3,v 1.4 2013/06/04 03:02:09 deraadt Exp $
2.\" 2.\"
3.\" Copyright (c) 1990, 1991 The Regents of the University of California. 3.\" Copyright (c) 1990, 1991 The Regents of the University of California.
4.\" All rights reserved. 4.\" All rights reserved.
@@ -31,7 +31,7 @@
31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE. 32.\" SUCH DAMAGE.
33.\" 33.\"
34.Dd $Mdocdate: July 25 2011 $ 34.Dd $Mdocdate: June 4 2013 $
35.Dt WMEMCPY 3 35.Dt WMEMCPY 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -50,6 +50,9 @@ wide characters from buffer
50.Fa src 50.Fa src
51to buffer 51to buffer
52.Fa dst . 52.Fa dst .
53If the two buffers may overlap,
54.Xr wmemmove 3
55must be used instead.
53.Sh RETURN VALUES 56.Sh RETURN VALUES
54The 57The
55.Fn wmemcpy 58.Fn wmemcpy
@@ -74,12 +77,3 @@ function was ported from
74.Nx 77.Nx
75and first appeared in 78and first appeared in
76.Ox 3.8 . 79.Ox 3.8 .
77.Sh CAVEATS
78In this implementation
79.Fn wmemcpy
80is implemented using
81.Xr bcopy 3 ,
82and therefore the buffers may overlap.
83On other systems, copying overlapping buffers may produce surprises.
84A portable, safe solution is to use
85.Xr wmemmove 3 .