AU_BSM_TO_FCNTL_CMD(3)
π AU_BSM_TO_FCNTL_CMD(3) β like, the whole libbsm fcntl-command translator situation
okay so bestie, welcome to AU_BSM_TO_FCNTL_CMD(3), a page from the Library Functions Manual (section 3, the library-calls girlies β¨). This is the one about converting between BSM and local fcntl(2) command values. Two little functions, one very important job. Let's get into it π
πΈ NAME πΈ
au_bsm_to_fcntl_cmd, au_fcntl_cmd_to_bsm β they convert between BSM and local fcntl(2) command values. That's it, that's the whole vibe π«
π LIBRARY π
Basic Security Module Library (libbsm, -lbsm). Link her in and you're good to go π«Ά
β¨ SYNOPSIS β¨
#include <bsm/libbsm.h>
int
au_bsm_to_fcntl_cmd(u_short bsm_fcntl_cmd, int *local_fcntl_cmdp);
u_short
au_fcntl_cmd_to_bsm(int local_fcntl_cmd);
look at them. so small. so purposeful. main character energy fr ππ
π¦ DESCRIPTION π¦
These interfaces lowkey exist for one reason: converting between the local and BSM fcntl(2) command values. Two directions, two functions, no drama.
π au_bsm_to_fcntl_cmd() β BSM β‘οΈ local
She takes a BSM command value, bsm_fcntl_cmd, and converts it into a local command value (the kind you'd pass to fcntl(2)). If it works, that converted value gets stored in the integer pointed to by local_fcntl_cmdp. π
β οΈ Heads up: this call fails if the BSM command value can't be mapped into a local fcntl(2) command value. And like, that can genuinely happen β it may occur if the command token was generated on another operating system. so not her fault, it's a whole cross-OS situation π
π au_fcntl_cmd_to_bsm() β local β‘οΈ BSM
She takes a local fcntl(2) command value and hands you back the BSM fcntl(2) command value for it. And get this: this call cannot fail. iconic. π
Instead of failing, she returns a BSM command value that tells a later decoder "hey bestie, this command value could not be encoded." no cap, that's the whole mechanism π§
π₯ RETURN VALUES π₯
- On success,
au_bsm_to_fcntl_cmd()returns0and a converted command value. slay β - On failure, it returns
-1β but it does not seterrno(2). so don't go checkingerrnofor answers, she's not giving you any π
π SEE ALSO π
fcntl(2), au_bsm_to_domain(3), au_bsm_to_socket_type(3), au_domain_to_bsm(3), au_socket_type_to_bsm(3), libbsm(3)
the whole friend group, honestly π«Άβ¨
β HISTORY β
au_bsm_to_domain() and au_domain_to_bsm() were introduced in OpenBSM 1.1.
(yes, that's literally what it says up in here β we're just reporting the facts, don't come for me ππ)
π AUTHORS π
These functions were implemented by Stacey Son under contract to Apple Inc. β go off, Stacey ππ
The Basic Security Module (BSM) interface to audit records and audit event stream format were defined by Sun Microsystems. absolute legends, fr fr π
and that's the page, bestie!! π source/version: Debian, dated March 5, 2009 β yes she's an old queen and she's still serving πβ¨ see u in the next manpage, mwah π¦
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2009 Apple Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms