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

# mbuf_setlen

## Declaration

```occ
void mbuf_setlen(mbuf_t mbuf, size_t len);
```

## Parameters

- `mbuf`: The mbuf.
- `len`: The new length.

## Return Value

Return Value 0 upon success otherwise the errno error.

## Discussion

Discussion Sets the length of data in this packet. Be careful to not set the length over the space available in the mbuf.
