---
name: "pcap_set_buffer_size"
section: "3pcap"
platform: "linux"
package: "libpcap"
version: "1.11.0-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux", "macos"]
url: "https://new.carta.tech/pcap_set_buffer_size/3pcap"
---

# pcap\_set\_buffer\_size(3pcap)

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**(3PCAP), **pcap\_create**(3PCAP), **pcap\_activate**(3PCAP)
