---
name: "memcpy_data"
section: "9"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/memcpy/9"
---

# memcpy\_data(9)

copy bytes in memory

Part of [memcpy(9)](/memcpy/9.md).

## NAME

**memcpy**, **memcpy\_data** – copy bytes in memory

## SYNOPSIS

**#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*);

## DESCRIPTION

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)](/memory_model/7.md) 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*.

## SEE ALSO

[bcopy(9)](/bcopy/9.md), [memmove(9)](/memmove/9.md), [memmove\_data(9)](/memmove_data/9.md)

## 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.
