]> git.saurik.com Git - apple/libc.git/blob - string/FreeBSD/memcpy.3.patch
Libc-763.11.tar.gz
[apple/libc.git] / string / FreeBSD / memcpy.3.patch
1 --- memcpy.3.bsdnew 2009-11-18 18:24:32.000000000 -0800
2 +++ memcpy.3 2009-11-18 18:24:32.000000000 -0800
3 @@ -37,29 +37,45 @@
4 .Os
5 .Sh NAME
6 .Nm memcpy
7 -.Nd copy byte string
8 +.Nd copy memory area
9 .Sh LIBRARY
10 .Lb libc
11 .Sh SYNOPSIS
12 .In string.h
13 .Ft void *
14 -.Fn memcpy "void *dst" "const void *src" "size_t len"
15 +.Fo memcpy
16 +.Fa "void *restrict s1"
17 +.Fa "const void *restrict s2"
18 +.Fa "size_t n"
19 +.Fc
20 .Sh DESCRIPTION
21 The
22 .Fn memcpy
23 function
24 copies
25 -.Fa len
26 -bytes from string
27 -.Fa src
28 -to string
29 -.Fa dst .
30 +.Fa n
31 +bytes from memory area
32 +.Fa s2
33 +to memory area
34 +.Fa s1 .
35 +If
36 +.Fa s1
37 +and
38 +.Fa s2
39 +overlap, behavior is undefined.
40 +Applications in which
41 +.Fa s1
42 +and
43 +.Fa s2
44 +might overlap should use
45 +.Xr memmove 3
46 +instead.
47 .Sh RETURN VALUES
48 The
49 .Fn memcpy
50 function
51 returns the original value of
52 -.Fa dst .
53 +.Fa s1 .
54 .Sh SEE ALSO
55 .Xr bcopy 3 ,
56 .Xr memccpy 3 ,
57 @@ -72,17 +88,3 @@ The
58 function
59 conforms to
60 .St -isoC .
61 -.Sh BUGS
62 -In this implementation
63 -.Fn memcpy
64 -is implemented using
65 -.Xr bcopy 3 ,
66 -and therefore the strings may overlap.
67 -On other systems, copying overlapping strings may produce surprises.
68 -Programs intended to be portable should use
69 -.Xr memmove 3
70 -when
71 -.Fa src
72 -and
73 -.Fa dst
74 -may overlap.