xref: /original-bsd/lib/libc/string/memcpy.3 (revision 04dd0305)
1.\" Copyright (c) 1990, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to Berkeley by
5.\" Chris Torek and the American National Standards Committee X3,
6.\" on Information Processing Systems.
7.\"
8.\" %sccs.include.redist.man%
9.\"
10.\"     @(#)memcpy.3	8.1 (Berkeley) 06/04/93
11.\"
12.Dd
13.Dt MEMCPY 3
14.Os
15.Sh NAME
16.Nm memcpy
17.Nd copy byte string
18.Sh SYNOPSIS
19.Fd #include <string.h>
20.Ft void *
21.Fn memcpy "void *dst" "const void *src" "size_t len"
22.Sh DESCRIPTION
23The
24.Fn memcpy
25function
26copies
27.Fa len
28bytes from string
29.Fa src
30to string
31.Fa dst .
32.Sh RETURN VALUES
33The
34.Fn memcpy
35function
36returns the original value of
37.Fa dst .
38.Sh SEE ALSO
39.Xr bcopy 3 ,
40.Xr memccpy 3 ,
41.Xr memmove 3 ,
42.Xr strcpy 3
43.Sh STANDARDS
44The
45.Fn memcpy
46function
47conforms to
48.St -ansiC .
49.Sh BUGS
50In this implementation
51.Fn memcpy
52is implemented using
53.Xr bcopy 3 ,
54and therefore the strings may overlap.
55On other systems, copying overlapping strings may produce surprises.
56A simpler solution is to not use
57.Fn memcpy .
58