IPQ_ERRSTR(3)

πŸ’… IPQ_ERRSTR(3) β€” like, the libipq error-handling glow-up

okay bestie, so this one lives in the Linux Programmer's Manual (section 3, the library-call girlies πŸŽ€) and it's all about libipq and how it tells you something went wrong. no cap, it's short but it eats.


🌸 NAME 🌸

ipq_errstr, ipq_perror β€” the libipq error handling routines, aka your two besties for finding out why things went sideways πŸ’–


✨ SYNOPSIS ✨

#include <linux/netfilter.h>
#include <libipq.h>

char *ipq_errstr(void);
void ipq_perror(const char *s);

πŸ¦‹ DESCRIPTION πŸ¦‹

ipq_errstr 🌈

so ipq_errstr hands you back a descriptive error message, and it builds that message off the current value of the internal ipq_errno variable. and like, every single libipq API function sets that internal variable whenever it fails β€” so it's always there holding the tea for you 🫢

ipq_perror πŸ’…

ipq_perror is the one that prints. it prints an error message to stderr that corresponds to the current value of the internal ipq_error variable, and to the global errno variable (if that one's set). the message comes prefixed with the string s, exactly as your application supplies it. and if s is NULL, the error message gets prefixed with the string "ERROR" instead β€” iconic default behavior honestly πŸ‘‘


⭐ RETURN VALUE ⭐

ipq_errstr returns an error message as outlined above. that's the whole vibe ✨


πŸ’€ BUGS πŸ’€

None known. not a single one. she's flawless, periodt 🧚


πŸ‘‘ AUTHOR πŸ‘‘

James Morris <jmorris@intercode.com.au> β€” main character energy fr fr πŸ’œ


Copyright (c) 2000-2001 Netfilter Core Team.

Distributed under the GNU General Public License. (yes, GPL, we stan 🌸)


πŸ”₯ SEE ALSO πŸ”₯

go read those next, iykyk πŸŽ€


lowkey a reminder just in case: ipq_perror is printing the internal ipq_error variable up there, not ipq_errno β€” the manpage said it that way so i'm saying it that way 😭 don't @ me

mwah πŸ’‹ that's the whole page β€” brought to you by the Linux iptables 1.2 girlies, dated 16 October 2001, still slaying in section 3 of the manual πŸ¦‹βœ¨

πŸ“¦ where this page comes from