PCAP\_CLOSE(3PCAP) PCAP\_CLOSE(3PCAP)

# [NAME](#NAME)

pcap\_close - close a capture device or savefile

# [SYNOPSIS](#SYNOPSIS)

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

```
void pcap_close(pcap_t *p);
```

# [DESCRIPTION](#DESCRIPTION)

**pcap\_close**() closes the files associated with *p* and deallocates resources. This means that, for example, if *p* refers to a savefile that was opened with **pcap\_fopen\_offline**() or **pcap\_fopen\_offline\_with\_tstamp\_precision**(), the stream provided to the routine will be closed unless it is **stdin**.

# [SEE ALSO](#SEE_ALSO)

[**pcap**(3PCAP)](/man/os/libpcap/pcap.3PCAP), [**pcap\_open\_offline**(3PCAP)](/man/os/libpcap/pcap_open_offline.3PCAP)

12 October 2024

---

Document: pcap_close(3pcap) from libpcap 1.11.0-r0 (Chainguard OS)
Source: https://github.com/the-tcpdump-group/libpcap.git
