Libprocstat printing warnings & errors

From: Andrew Wood <andrew1tree_at_gmail.com>
Date: Mon, 11 Aug 2025 16:18:52 UTC
Hi all,

Is it normal that a library will print errors/warnings in addition to setting an error/errno value on functions whose purpose isn't printing? I've been working with libprocstat lately and the program I'm writing is prone to checking processes that no longer exist a lot of the time (but is built to handle this), but I'm disappointed about the fact that I've seemingly got to choose between having my stderr riddled with warnings and disabling my ability to use the err/warn function suite (by calling err_set_file to set it to /dev/null). I'd much prefer if there were a separate function for finding out what an error was, like perhaps a procstat_strerror function? It seems perfectly doable given the state tracking that's already done in the procstat struct. Are there any design considerations to explain why a data-fetching would choose to print warnings without any request to, rather than let the programmer decide whether it's worth printing anything? Is this something I could change and make a PR for and just let any discussion over it happen there, or is there some person or group I need to talk to about this?

Apologies if this isn't the right spot to vent about this, I'm not sure where the proper place is.