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 2021-03-22 "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 *restrict " dest ", const void *restrict " src \
21 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
24 .BI "wchar_t *wmempcpy(wchar_t *restrict " dest \
25 ", const wchar_t *restrict " src ,
31 function is nearly identical to the
36 bytes from the object beginning at
38 into the object pointed to by
40 But instead of returning the value of
42 it returns a pointer to the byte following the last written byte.
44 This function is useful in situations where a number of objects
45 shall be copied to consecutive memory positions.
49 function is identical but takes
51 type arguments and copies
60 first appeared in glibc in version 2.1.
62 For an explanation of the terms used in this section, see
70 Interface Attribute Value
74 T} Thread safety MT-Safe
80 This function is a GNU extension.
84 combine(void *o1, size_t s1, void *o2, size_t s2)
86 void *result = malloc(s1 + s2);
88 mempcpy(mempcpy(result, o1, s1), o2, s2);