AU_BSM_TO_ERRNO(3)

πŸ“¦
version 1.1 Β· 2 versions
, in nixos 26.05, nixpkgs unstable

AU_BSM_TO_ERRNO(3) πŸ’…

okay bestie, we're in the Library Functions Manual and this page is absolutely giving β€œerror-number translation station.” It's AU_BSM_TO_ERRNO(3) β€” yep, that's the header, folded in right here like a little name tag. ✨

πŸŽ€ NAME πŸŽ€

au_bsm_to_errno, au_errno_to_bsm, au_strerror β€” convert between BSM and local error numbers. Three little icons, one job: translate the error-number gossip. πŸ’–

πŸ“š LIBRARY πŸ“š

Basic Security Module Library (libbsm, -lbsm). Obsessed with the dedicated library energy. 🫢

🧚 SYNOPSIS 🧚

#include <bsm/libbsm.h>

int
au_bsm_to_errno(u_char bsm_error, int *errorp);

u_char
au_errno_to_bsm(int error);

const char *
au_strerror(int bsm_error);

🌸 DESCRIPTION 🌸

These interfaces may be used to convert between the local (errno(2)) and BSM error number spaces found in BSM return tokens. Translation era, fr fr. πŸ”₯

The au_bsm_to_errno() function accepts a BSM error value, bsm_error, and converts it to an errno(2) that will be stored in the integer pointed to by errorp if successful. This call will fail if the BSM error cannot be mapped into a local error number, which may occur if the return token was generated on another operating system. So yeah, cross-OS token drama is a real possibility β€” no cap. 😭

The au_errno_to_bsm() function accepts a local errno(2) value, and returns the BSM error number for it. This call cannot fail, and instead returns a BSM error number indicating to a later decoder that the error could not be encoded. It's giving β€œI can't fail, but I can leave a note.” πŸ’…

The au_strerror() function converts a BSM error value to a string, generally by converting first to a local error number and using the local strerror(3) function, but will also work for errors that are not locally defined. Cute AND flexible? We love to see it. πŸ¦‹

😭 RETURN VALULES 😭

On success, au_bsm_to_errno() returns 0 and a converted error value; on failure, it returns -1 but does not set errno(2). Periodt β€” failure does not touch errno(2). πŸ’€

On success, au_strerror() returns a pointer to an error string; on failure it will return NULL. Big β€œstring or nothing” energy. πŸ™ˆ

πŸ” SEE ALSO πŸ”

πŸ‘‘ HISTORY πŸ‘‘

au_bsm_to_errno() and au_errno_to_bsm() were introduced in OpenBSM 1.1. Historic little icons. ⭐

πŸ’œ AUTHORS πŸ’œ

These functions were implemented by Robert Watson under contract to Apple Inc. Slay, Robert. πŸŽ€

The Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems. Respect the BSM origin story. 🌈

πŸ› BUGS πŸ›

au_strerror is unable to provide localized strings for errors not available in the local operating system. Sad little localization L, but that's the note. 😭


xoxo, this page is from source/version Debian, dated December 8, 2008, and it's the AU_BSM_TO_ERRNO(3) page. bye bestie, go translate those errors responsibly πŸ’–βœ¨

πŸ“¦ where this page comes from