xref: /csrg-svn/lib/libc/string/memcpy.3 (revision 48351)
1*48351Scael.\" Copyright (c) 1990, 1991 The Regents of the University of California.
241953Sbostic.\" All rights reserved.
341953Sbostic.\"
441953Sbostic.\" This code is derived from software contributed to Berkeley by
541953Sbostic.\" Chris Torek.
641953Sbostic.\" %sccs.include.redist.man%
741953Sbostic.\"
8*48351Scael.\"     @(#)memcpy.3	5.4 (Berkeley) 04/19/91
941953Sbostic.\"
10*48351Scael.Dd
11*48351Scael.Dt MEMCPY 3
12*48351Scael.Os
13*48351Scael.Sh NAME
14*48351Scael.Nm memcpy
15*48351Scael.Nd copy byte string
16*48351Scael.Sh SYNOPSIS
17*48351Scael.Fd #include <string.h>
18*48351Scael.Ft void *
19*48351Scael.Fn memcpy "void *dst" "const void *src" "size_t len"
20*48351Scael.Sh DESCRIPTION
21*48351ScaelThe
22*48351Scael.Fn memcpy
23*48351Scaelfunction
2441953Sbosticcopies
25*48351Scael.Fa len
2641953Sbosticbytes from string
27*48351Scael.Fa src
2841953Sbosticto string
29*48351Scael.Fa dst .
30*48351Scael.Sh RETURN VALUES
31*48351ScaelThe
32*48351Scael.Fn memcpy
33*48351Scaelfunction
34*48351Scaelreturns the original value of
35*48351Scael.Fa dst .
36*48351Scael.Sh SEE ALSO
37*48351Scael.Xr bcopy 3 ,
38*48351Scael.Xr memccpy 3 ,
39*48351Scael.Xr memmove 3 ,
40*48351Scael.Xr strcpy 3
41*48351Scael.Sh STANDARDS
42*48351ScaelThe
43*48351Scael.Fn memcpy
44*48351Scaelfunction
45*48351Scaelconforms to
46*48351Scael.St -ansiC .
47*48351Scael.Sh BUGS
4841953SbosticIn this implementation
49*48351Scael.Fn memcpy
5041953Sbosticis implemented using
51*48351Scael.Xr bcopy 3 ,
5241953Sbosticand therefore the strings may overlap.
5341953SbosticOn other systems, copying overlapping strings may produce surprises.
5441953SbosticA simpler solution is to not use
55*48351Scael.Fn memcpy .
56