PCAP_GETERR(3PCAP)

πŸ“¦
version 1.10.7 Β· 2 versions
  • 1.10.7 Β· alpine 3.22, alpine 3.23, alpine 3.24, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 1.11.0 Β· arch rolling
, in alpine 3.22, alpine 3.23, alpine 3.24, centos-stream 10, centos-stream 9, debian bookworm, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’– (PCAP_GETERR(3PCAP))

pcap_geterr, pcap_perror β€” get or print libpcap error message text. πŸ’…

✨ SYNOPSIS ✨

#include <pcap/pcap.h>

char *pcap_geterr(pcap_t *p);
void pcap_perror(pcap_t *p, const char *prefix);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so pcap_geterr() returns the error text pertaining to the last pcap library error. that's its whole thing. ✨

⚠️ NOTE bestie: the pointer it returns will no longer point to a valid error message string after the pcap_t passed to it is closed. you must use or copy the string before closing the pcap_t. no cap, do not let that pointer vibe-check you after close. 😭

pcap_perror() prints the text of the last pcap library error on stderr, prefixed by prefix. it's giving β€œput a little label on the error” energy. πŸŽ€

🌈 SEE ALSO 🌈

  • pcap(3PCAP) β€” the main character page, go say hi 🫢

xoxo, your libpcap bestie πŸ’– β€” dated 15 January 2016, from the PCAP_GETERR(3PCAP) manual page. mwah πŸ“

πŸ“¦ where this page comes from