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