1 .\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
2 .\" Distributed under GPL
3 .\" Heavily based on glibc infopages, copyright Free Software Foundation
5 .\" aeb, 2003, polished a little
7 .\" Japanese Version Copyright (c) 2004 Yuichi SATO
8 .\" all rights reserved.
9 .\" Translated Sat Aug 28 07:40:33 JST 2004
10 .\" by Yuichi SATO <ysato444@yahoo.co.jp>
12 .TH MEMPCPY 3 2008-08-11 "GNU" "Linux Programmer's Manual"
15 .\"O mempcpy, wmempcpy \- copy memory area
16 mempcpy, wmempcpy \- ¥á¥â¥êÎΰè¤ò¥³¥Ô¡¼¤¹¤ë
20 .B #define _GNU_SOURCE
22 .B #include <string.h>
24 .BI "void *mempcpy(void *" dest ", const void *" src ", size_t " n );
26 .B #define _GNU_SOURCE
30 .BI "wchar_t *wmempcpy(wchar_t *" dest ", const wchar_t *" src ", size_t " n );
36 .\"O function is nearly identical to the
42 ´Ø¿ô¤È¤Û¤ÜƱ°ì¤Ç¤¢¤ë¡£
45 .\"O bytes from the object beginning at
47 .\"O into the object pointed to by
51 ¤Ç»Ï¤Þ¤ë¥ª¥Ö¥¸¥§¥¯¥È¤«¤é
55 ¤Ç»Ø¤µ¤ì¤ë¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥³¥Ô¡¼¤¹¤ë¡£
56 .\"O But instead of returning the value of
58 .\"O it returns a pointer to the byte following the last written byte.
61 ¤ÎÃͤòÊÖ¤¹¤Î¤Ç¤Ï¤Ê¤¯¡¢
62 ºÇ¸å¤Ë½ñ¤¹þ¤Þ¤ì¤¿¥Ð¥¤¥È¤Î¸å¤Ë³¤¯¥Ð¥¤¥È¤Ø¤Î¥Ý¥¤¥ó¥¿¤òÊÖ¤¹¡£
64 .\"O This function is useful in situations where a number of objects
65 .\"O shall be copied to consecutive memory positions.
66 ¤³¤Î´Ø¿ô¤Ï¤¤¤¯¤Ä¤«¤Î¥ª¥Ö¥¸¥§¥¯¥È¤¬
67 Ϣ³Ū¤Ê¥á¥â¥ê¤Î¾ì½ê¤Ë¥³¥Ô¡¼¤µ¤ì¤ë¤è¤¦¤Ê¾õ¶·¤ÇÌò¤ËΩ¤Ä¡£
71 .\"O function is identical but takes
73 .\"O type arguments and copies
77 ´Ø¿ô¤Ï¤³¤Î´Ø¿ô¤ÈƱ¤¸¤Ç¤¢¤ë¤¬¡¢
81 ¥ï¥¤¥Éʸ»úÎó¤ò¥³¥Ô¡¼¤¹¤ë¡£
82 .\"O .SH "RETURN VALUE"
88 .\"O first appeared in glibc in version 2.1.
90 ¤Ï glibc ¥Ð¡¼¥¸¥ç¥ó 2.1 ¤Ç½é¤á¤ÆÅо줷¤¿¡£
91 .\"O .SH "CONFORMING TO"
93 .\"O This function is a GNU extension.
94 ¤³¤Î´Ø¿ô¤Ï GNU ¤Ë¤ª¤±¤ë³ÈÄ¥¤Ç¤¢¤ë¡£
99 combine (void *o1, size_t s1, void *o2, size_t s2)
101 void *result = malloc(s1 + s2);
103 mempcpy(mempcpy(result, o1, s1), o2, s2);
113 .BR feature_test_macros (7)