---
name: "pcap_snapshot"
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_snapshot"
---

# pcap\_snapshot(3)

get the snapshot length

## NAME

pcap\_snapshot - get the snapshot length

## SYNOPSIS

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

**int pcap\_snapshot(pcap\_t \*p);**

## DESCRIPTION

**pcap\_snapshot**() returns the snapshot length specified when [**pcap\_set\_snaplen**(3)](/pcap_set_snaplen/3.md) or [**pcap\_open\_live**(3)](/pcap_open_live/3.md) was called, for a live capture, or the snapshot length from the capture file, for a \`\`savefile''.

It must not be called on a pcap descriptor created by [**pcap\_create**(3)](/pcap_create/3.md) that has not yet been activated by [**pcap\_activate**(3)](/pcap_activate/3.md).

## RETURN VALUE

**pcap\_snapshot**() returns the snapshot length on success and **PCAP\_ERROR\_NOT\_ACTIVATED** if called on a capture handle that has been created but not activated.

## SEE ALSO

[**pcap**(3)](/pcap/3.md)
