2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
|
|
|
.\" Distributed under GPL
|
2009-03-10 09:09:21 +00:00
|
|
|
.\" Heavily based on glibc infopages, copyright Free Software Foundation
|
2004-11-03 13:51:07 +00:00
|
|
|
.\"
|
|
|
|
.\" aeb, 2003, polished a little
|
2008-08-12 10:23:04 +00:00
|
|
|
.TH MEMPCPY 3 2008-08-12 "GNU" "Linux Programmer's Manual"
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH NAME
|
|
|
|
mempcpy, wmempcpy \- copy memory area
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.nf
|
getresuid.2, mremap.2, poll.2, remap_file_pages.2, setresuid.2, splice.2, sync_file_range.2, syscall.2, tee.2, vmsplice.2, INFINITY.3, aio_init.3, asprintf.3, assert_perror.3, basename.3, bsd_signal.3, canonicalize_file_name.3, clog10.3, crypt.3, dl_iterate_phdr.3, dlopen.3, encrypt.3, exp10.3, fcloseall.3, fenv.3, fopencookie.3, ftw.3, getaddrinfo_a.3, getloadavg.3, getutent.3, grantpt.3, hsearch.3, lseek64.3, memmem.3, mempcpy.3, pow10.3, program_invocation_name.3, ptsname.3, putgrent.3, sched_getcpu.3, sincos.3, strchr.3, strfry.3, strnlen.3, strptime.3, strstr.3, strverscmp.3, swab.3, sysv_signal.3, tsearch.3, unlockpt.3, wcwidth.3: Add reference to feature_test_macros(7)
Some pages simply list feature test macro requirements in
the form:
#define #GNU_SOURCE
#include <someheader.h>
For these pages, add a "See feature_test_macros(7)" comment
on the "#define" line.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-31 04:31:47 +00:00
|
|
|
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
|
2004-11-03 13:51:07 +00:00
|
|
|
.br
|
|
|
|
.B #include <string.h>
|
|
|
|
.sp
|
|
|
|
.BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n );
|
|
|
|
.sp
|
getresuid.2, mremap.2, poll.2, remap_file_pages.2, setresuid.2, splice.2, sync_file_range.2, syscall.2, tee.2, vmsplice.2, INFINITY.3, aio_init.3, asprintf.3, assert_perror.3, basename.3, bsd_signal.3, canonicalize_file_name.3, clog10.3, crypt.3, dl_iterate_phdr.3, dlopen.3, encrypt.3, exp10.3, fcloseall.3, fenv.3, fopencookie.3, ftw.3, getaddrinfo_a.3, getloadavg.3, getutent.3, grantpt.3, hsearch.3, lseek64.3, memmem.3, mempcpy.3, pow10.3, program_invocation_name.3, ptsname.3, putgrent.3, sched_getcpu.3, sincos.3, strchr.3, strfry.3, strnlen.3, strptime.3, strstr.3, strverscmp.3, swab.3, sysv_signal.3, tsearch.3, unlockpt.3, wcwidth.3: Add reference to feature_test_macros(7)
Some pages simply list feature test macro requirements in
the form:
#define #GNU_SOURCE
#include <someheader.h>
For these pages, add a "See feature_test_macros(7)" comment
on the "#define" line.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-31 04:31:47 +00:00
|
|
|
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
|
2004-11-03 13:51:07 +00:00
|
|
|
.br
|
|
|
|
.B #include <wchar.h>
|
|
|
|
.sp
|
|
|
|
.BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
|
|
|
|
.fi
|
|
|
|
.SH DESCRIPTION
|
2007-04-12 22:42:49 +00:00
|
|
|
The
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR mempcpy ()
|
2004-11-03 13:51:07 +00:00
|
|
|
function is nearly identical to the
|
2007-05-12 00:30:29 +00:00
|
|
|
.BR memcpy (3)
|
2007-04-12 22:42:49 +00:00
|
|
|
function.
|
|
|
|
It copies
|
|
|
|
.I n
|
2004-11-03 13:51:07 +00:00
|
|
|
bytes from the object beginning at
|
2007-04-12 22:42:49 +00:00
|
|
|
.I src
|
|
|
|
into the object pointed to by
|
|
|
|
.IR dest .
|
|
|
|
But instead of returning the value of
|
2004-11-03 13:51:07 +00:00
|
|
|
.I dest
|
|
|
|
it returns a pointer to the byte following the last written byte.
|
|
|
|
.PP
|
|
|
|
This function is useful in situations where a number of objects
|
|
|
|
shall be copied to consecutive memory positions.
|
|
|
|
.PP
|
|
|
|
The
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR wmempcpy ()
|
2005-06-22 07:19:03 +00:00
|
|
|
function is identical but takes
|
|
|
|
.I wchar_t
|
|
|
|
type arguments and copies
|
2004-11-03 13:51:07 +00:00
|
|
|
.I n
|
|
|
|
wide characters.
|
|
|
|
.SH "RETURN VALUE"
|
2007-07-09 21:43:01 +00:00
|
|
|
\fIdest\fP + \fIn\fP.
|
2008-08-11 20:10:18 +00:00
|
|
|
.SH VERSIONS
|
|
|
|
.BR mempcpy ()
|
|
|
|
first appeared in glibc in version 2.1.
|
2007-05-19 04:30:20 +00:00
|
|
|
.SH "CONFORMING TO"
|
|
|
|
This function is a GNU extension.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "EXAMPLE"
|
|
|
|
.nf
|
|
|
|
void *
|
2007-04-12 22:42:49 +00:00
|
|
|
combine(void *o1, size_t s1, void *o2, size_t s2)
|
2007-04-05 14:17:54 +00:00
|
|
|
{
|
2007-06-13 22:02:09 +00:00
|
|
|
void *result = malloc(s1 + s2);
|
|
|
|
if (result != NULL)
|
|
|
|
mempcpy(mempcpy(result, o1, s1), o2, s2);
|
|
|
|
return result;
|
2004-11-03 13:51:07 +00:00
|
|
|
}
|
|
|
|
.fi
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
.BR memccpy (3),
|
|
|
|
.BR memcpy (3),
|
|
|
|
.BR memmove (3),
|
getresuid.2, intro.2, mremap.2, open.2, poll.2, posix_fadvise.2, pread.2, remap_file_pages.2, setresuid.2, signal.2, splice.2, sync_file_range.2, tee.2, vmsplice.2, INFINITY.3, asprintf.3, assert_perror.3, basename.3, bsd_signal.3, canonicalize_file_name.3, clog10.3, crypt.3, dl_iterate_phdr.3, dlopen.3, dprintf.3, encrypt.3, exp10.3, fcloseall.3, fenv.3, ffs.3, fmemopen.3, fopencookie.3, ftw.3, getdate.3, getline.3, getloadavg.3, getopt.3, getsubopt.3, getutent.3, grantpt.3, hsearch.3, intro.3, lseek64.3, memmem.3, mempcpy.3, mq_receive.3, mq_send.3, posix_fallocate.3, pow10.3, program_invocation_name.3, ptsname.3, putgrent.3, readdir.3, sigset.3, sincos.3, stpcpy.3, stpncpy.3, strchr.3, strfry.3, strnlen.3, strptime.3, strsignal.3, strstr.3, strverscmp.3, swab.3, sysv_signal.3, tsearch.3, unlocked_stdio.3, unlockpt.3, wcpcpy.3, wcpncpy.3, wcsdup.3, wcwidth.3: SEE ALSO: Remove redundant reference to feature_test_macros(7)
Reported-by: Florian Lehmann <flo.lehmann@googlemail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2010-10-31 05:05:22 +00:00
|
|
|
.BR wmemcpy (3)
|