12a6b7db3Sskrll /* Implement the mempcpy function.
2*f22f0ef4Schristos    Copyright (C) 2003-2022 Free Software Foundation, Inc.
32a6b7db3Sskrll    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.
42a6b7db3Sskrll 
52a6b7db3Sskrll This file is part of the libiberty library.
62a6b7db3Sskrll Libiberty is free software; you can redistribute it and/or
72a6b7db3Sskrll modify it under the terms of the GNU Library General Public
82a6b7db3Sskrll License as published by the Free Software Foundation; either
92a6b7db3Sskrll version 2 of the License, or (at your option) any later version.
102a6b7db3Sskrll 
112a6b7db3Sskrll Libiberty is distributed in the hope that it will be useful,
122a6b7db3Sskrll but WITHOUT ANY WARRANTY; without even the implied warranty of
132a6b7db3Sskrll MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
142a6b7db3Sskrll Library General Public License for more details.
152a6b7db3Sskrll 
162a6b7db3Sskrll You should have received a copy of the GNU Library General Public
172a6b7db3Sskrll License along with libiberty; see the file COPYING.LIB.  If
182a6b7db3Sskrll not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
192a6b7db3Sskrll Boston, MA 02110-1301, USA.  */
202a6b7db3Sskrll 
212a6b7db3Sskrll /*
222a6b7db3Sskrll 
2305caefcfSchristos @deftypefn Supplemental void* mempcpy (void *@var{out}, const void *@var{in}, @
2405caefcfSchristos   size_t @var{length})
252a6b7db3Sskrll 
262a6b7db3Sskrll Copies @var{length} bytes from memory region @var{in} to region
272a6b7db3Sskrll @var{out}.  Returns a pointer to @var{out} + @var{length}.
282a6b7db3Sskrll 
292a6b7db3Sskrll @end deftypefn
302a6b7db3Sskrll 
312a6b7db3Sskrll */
322a6b7db3Sskrll 
332a6b7db3Sskrll #include <ansidecl.h>
342a6b7db3Sskrll #include <stddef.h>
352a6b7db3Sskrll 
36*f22f0ef4Schristos extern void *memcpy (void *, const void *, size_t);
372a6b7db3Sskrll 
38*f22f0ef4Schristos void *
mempcpy(void * dst,const void * src,size_t len)39*f22f0ef4Schristos mempcpy (void *dst, const void *src, size_t len)
402a6b7db3Sskrll {
412a6b7db3Sskrll   return (char *) memcpy (dst, src, len) + len;
422a6b7db3Sskrll }
43