PMIERRSTR(3)

πŸ“¦
version 7.2.2 Β· 3 versions
, in arch rolling, centos-stream 10, fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ’– PMIERRSTR πŸ’–

ok so bestie, meet pmiErrStr and pmiErrStr_r β€” they take a LOGIMPORT error code and turn it into an actual human-readable string. that's the whole job. iconic of them tbh. πŸŽ€


✨ NAME ✨

pmiErrStr, pmiErrStr_r β€” convert a LOGIMPORT error code into a string πŸ’…


🌸 C SYNOPSIS 🌸

#include <pcp/pmapi.h>
#include <pcp/import.h>

const char *pmiErrStr(int code);
char *pmiErrStr_r(int code, char buf, int buflen);
cc ... -lpcp_import -lpcp

πŸ¦‹ Perl SYNOPSIS πŸ¦‹

use PCP::LogImport;

pmiErrStr($code);

πŸ’œ DESCRIPTION πŸ’œ

okok so this is part of the Performance Co-Pilot Log Import API (peep LOGIMPORT(3) for the lore), and pmiErrStr does the cutest little glow-up ever: it takes error codes that the other routines in the Log Import library hand back to you and translates them into printable error messages. like, real words. sentences. we love a translator era. ✨

code would normally have a negative value, ngl. and here's the special case you need to know about, no cap: if code is -1, then the error code returned from the last routine called in the LOGIMPORT library for this context gets used instead. so it's like "idk just tell me what just went wrong" energy and honestly? relatable. 🫢

pmiErrStr_r does the exact same thing but lowkey more polite about memory β€” it stores the result in a buffer you supply, called buf, of length buflen. and bestie, that buffer should have room for at least PMI_MAXERRMSGLEN bytes. don't skimp, the string needs space to breathe. πŸ’€

the set of possible error codes and messages is all the ones defined by pmErrStr(3) and PCPIntro(3), plus the additional ones defined in <pcp/import.h> whose error code names are of the form PMI_ERR_.... that's the whole roster. periodt. πŸ‘‘


🌈 SEE ALSO 🌈


mwah πŸ’‹ that's the page, bestie β€” brought to you by Performance Co-Pilot (that's the PCP girlies, you know the ones) and filed under PMIERRSTR(3). go forth and read your error messages like the main character you are. πŸ’–βœ¨

πŸ“¦ where this page comes from