1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
3 .\" %%%LICENSE_START(GPL_NOVERSION_ONELINE)
4 .\" Distributed under GPL
7 .\" Heavily based on glibc infopages, copyright Free Software Foundation
9 .\" aeb, 2003, polished a little
10 .TH MEMPCPY 3 2014-03-18 "GNU" "Linux Programmer's Manual"
12 mempcpy, wmempcpy \- copy memory area
15 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
17 .B #include <string.h>
19 .BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n );
21 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
25 .BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
30 function is nearly identical to the
35 bytes from the object beginning at
37 into the object pointed to by
39 But instead of returning the value of
41 it returns a pointer to the byte following the last written byte.
43 This function is useful in situations where a number of objects
44 shall be copied to consecutive memory positions.
48 function is identical but takes
50 type arguments and copies
59 first appeared in glibc in version 2.1.
61 .SS Multithreading (see pthreads(7))
66 functions are thread-safe.
68 This function is a GNU extension.
72 combine(void *o1, size_t s1, void *o2, size_t s2)
74 void *result = malloc(s1 + s2);
76 mempcpy(mempcpy(result, o1, s1), o2, s2);
86 This page is part of release 3.68 of the Linux
89 A description of the project,
90 information about reporting bugs,
91 and the latest version of this page,
93 \%http://www.kernel.org/doc/man\-pages/.