---
name: "pcap_set_buffer_size"
section: "3"
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/pcap_set_buffer_size"
---

# pcap\_set\_buffer\_size(3)

set the buffer size for a not-yet-activated capture handle

## NAME

pcap\_set\_buffer\_size - set the buffer size for a not-yet-activated capture handle

## SYNOPSIS

```
#include <pcap/pcap.h>
```

**int pcap\_set\_buffer\_size(pcap\_t \*p, int buffer\_size);**

## DESCRIPTION

**pcap\_set\_buffer\_size**() **sets the buffer size that will be used on a capture handle when** **the handle is activated to** *buffer\_size*, **which is in units of bytes.**

## RETURN VALUE

**pcap\_set\_buffer\_size**() **returns** **0** **on success or** **PCAP\_ERROR\_ACTIVATED** **if called on a capture handle that has been activated.**

## SEE ALSO

[**pcap**(3)](/pcap/3.md), [**pcap\_create**(3)](/pcap_create/3.md), [**pcap\_activate**(3)](/pcap_activate/3.md)
