PCAP\_STRERROR(3PCAP) PCAP\_STRERROR(3PCAP)

# [NAME](#NAME)

pcap\_strerror - convert an errno value to a string

# [SYNOPSIS](#SYNOPSIS)

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

```
const char *pcap_strerror(int error);
```

# [DESCRIPTION](#DESCRIPTION)

This function returns an error message string corresponding to *error*. It uses either [**strerror**(3)](/man/os/libpcap/strerror.3) or its thread-safe variant if one is available, which currently is the case in every supported OS.

# [BACKWARD COMPATIBILITY](#BACKWARD_COMPATIBILITY)

This function was not thread-safe in libpcap before 1.8.1 on Windows and in libpcap before 1.10.5 on all other OSes.

# [SEE ALSO](#SEE_ALSO)

[**pcap**(3PCAP)](/man/os/libpcap/pcap.3PCAP), [**pcap\_geterr**(3PCAP)](/man/os/libpcap/pcap_geterr.3PCAP)

26 August 2024

---

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