| 1 |
'\" t |
| 2 |
.\" Copyright 1993, David Metcalfe <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH memccpy 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
memccpy \- copy memory area |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.B #include <string.h> |
| 16 |
.P |
| 17 |
.BR "void *memccpy(" "size_t n;" |
| 18 |
.BI " void " dest "[restrict " n "], const void " src "[restrict " n ], |
| 19 |
.BI " int " c ", size_t " n ); |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
The |
| 23 |
.BR memccpy () |
| 24 |
function copies no more than |
| 25 |
.I n |
| 26 |
bytes from |
| 27 |
memory area |
| 28 |
.I src |
| 29 |
to memory area |
| 30 |
.IR dest , |
| 31 |
stopping when the |
| 32 |
character |
| 33 |
.I c |
| 34 |
is found |
| 35 |
.RI ( c |
| 36 |
is copied). |
| 37 |
.P |
| 38 |
If the memory areas overlap, the results are undefined. |
| 39 |
.SH RETURN VALUE |
| 40 |
The |
| 41 |
.BR memccpy () |
| 42 |
function returns a pointer to the next character |
| 43 |
in |
| 44 |
.I dest |
| 45 |
after |
| 46 |
.IR c , |
| 47 |
or NULL if |
| 48 |
.I c |
| 49 |
was not found in the |
| 50 |
first |
| 51 |
.I n |
| 52 |
characters of |
| 53 |
.IR src . |
| 54 |
.SH ATTRIBUTES |
| 55 |
For an explanation of the terms used in this section, see |
| 56 |
.BR attributes (7). |
| 57 |
.TS |
| 58 |
allbox; |
| 59 |
lbx lb lb |
| 60 |
l l l. |
| 61 |
Interface Attribute Value |
| 62 |
T{ |
| 63 |
.na |
| 64 |
.nh |
| 65 |
.BR memccpy () |
| 66 |
T} Thread safety MT-Safe |
| 67 |
.TE |
| 68 |
.SH STANDARDS |
| 69 |
POSIX.1-2008. |
| 70 |
.SH HISTORY |
| 71 |
POSIX.1-2001, SVr4, 4.3BSD. |
| 72 |
.SH SEE ALSO |
| 73 |
.BR bcopy (3), |
| 74 |
.BR bstring (3), |
| 75 |
.BR memcpy (3), |
| 76 |
.BR memmove (3), |
| 77 |
.BR strcpy (3), |
| 78 |
.BR strncpy (3) |