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 2015-03-02 "GNU" "Linux Programmer's Manual"
12 mempcpy, wmempcpy \- copy memory area
15 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
16 .B #include <string.h>
18 .BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n );
20 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
23 .BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
28 function is nearly identical to the
33 bytes from the object beginning at
35 into the object pointed to by
37 But instead of returning the value of
39 it returns a pointer to the byte following the last written byte.
41 This function is useful in situations where a number of objects
42 shall be copied to consecutive memory positions.
46 function is identical but takes
48 type arguments and copies
57 first appeared in glibc in version 2.1.
59 For an explanation of the terms used in this section, see
65 Interface Attribute Value
69 T} Thread safety MT-Safe
72 This function is a GNU extension.
76 combine(void *o1, size_t s1, void *o2, size_t s2)
78 void *result = malloc(s1 + s2);
80 mempcpy(mempcpy(result, o1, s1), o2, s2);