---
title: mbuf_copydata
framework: Kernel
role: symbol
role_heading: Function
platforms: [macOS 10.4+]
path: kernel/1535784-mbuf_copydata
---

# mbuf_copydata

## Declaration

```occ
errno_t mbuf_copydata(const mbuf_t mbuf, size_t offset, size_t length, void *out_data);
```

## Parameters

- `mbuf`: The mbuf chain to copy data out of.
- `offset`: The offset in to the mbuf to start copying.
- `length`: The number of bytes to copy.
- `out_data`: A pointer to the location where the data will be copied.

## Return Value

Return Value 0 upon success otherwise the errno error.

## Discussion

Discussion Copies data out of an mbuf in to a specified buffer. If the data is stored in a chain of mbufs, the data will be copied from each mbuf in the chain until length bytes have been copied.
