PCAP_GETERR(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– PCAP_GETERR(3) β€” Library Functions Manual πŸ’–

✨ NAME ✨

okay bestie, say hi to pcap_geterr and pcap_perror β€” together they're the "get or print libpcap error message text" duo, and they ate. πŸ’…

🌸 SYNOPSIS 🌸

#include <pcap/pcap.h>

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

πŸ¦‹ DESCRIPTION πŸ¦‹

pcap_geterr() returns the error text pertaining to the last pcap library error. It's giving "here's the last libpcap error, bestie" energy. obsessed. ✨

⚠️ NOTE, and do not skip this: 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 β€” that pointer's valid era ends when the pcap_t closes. 😭

pcap_perror() prints the text of the last pcap library error on stderr, prefixed by prefix. So it's literally the "slap your prefix on the last libpcap error and print it to stderr" function. 🫢

πŸ‘‘ SEE ALSO πŸ‘‘


xoxo, your libpcap bestie πŸ’œ β€” this was the Library Functions Manual page PCAP_GETERR(3), dated 15 January 2016. periodt. ✨

πŸ“¦ where this page comes from