memcpy_data(9)

memcpy_data9

Copy bytes in memory

Part of memcpy(9).

Usage

#include <sys/systm.h>

void *

memcpy(void *dst, const void *src, size_t len);

void *

memcpy_data(void *dst, const void *src, size_t len);

Overview

The memcpy() function copies len bytes from object src to object dst in a manner that preserves the provenance of pointers in the copied object (see memory_model(7) for further information). If src and dst overlap, the results are not defined. The memcpy_data() function does the same except that it does not preserve the provenance of pointers in the copied object. On CHERI targets, the validity tag of any copied capability is explicitly cleared.

Return values

The memcpy() and memcpy_data() functions return the original value of dst.

Standards

The memcpy() function conforms to ISO/IEC 9899:1990 (“ISO C90”).

History

The memcpy() function first appeared in AT&T System V UNIX and was reimplemented for 4.3BSD-Tahoe. The memcpy_data() function first appeared in FreeBSD 16.0.

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.