avc_add_callback(9)
π avc_add_callback(9) β like, the Kernel API Manual era π«Ά
okay so bestie, strap in, because this one is short and sweet but it's literally all about registering a callback for security events and honestly? iconic behaviour. this is a page from the avc_add_callback(9) end of the Kernel API Manual, and yes we are absolutely gonna read it together π
β¨ NAME β¨
avc_add_callback β Register a callback for security events.
like. that's the whole vibe. you're signing a function up to get pinged when security stuff goes down. no cap. π
πΈ SYNOPSIS πΈ
int avc_add_callback (int (*callback)(u32 event) , u32 events );
copy it exactly, bestie, character for character, because the compiler does not accept vibes as an argument π
π ARGUMENTS π
callbackβ the callback function itself. your little guy. the function that gets called. it takes au32 event. slay.eventsβ the security events. this is the set of events you're registering for, so think of it as the guest list for your callback's party π
π¦ DESCRIPTION π¦
okay so here's the tea β β you call this and it registers a callback function for events in the set events. one function, one set of events, one beautiful little agreement between you and the kernel π€
and the returns? very demure, very mindful:
- returns
0on success β¨ - returns
-ENOMEMif insufficient memory exists to add the callback π
that's it. that's the whole function. lowkey obsessed with how straightforward this is. no hidden lore, no surprises, just memory permitting and you're in π
ngl, if you get -ENOMEM back it's not a you problem, it's a memory problem. the kernel just didn't have enough room to add your callback. respect the boundary π
π₯ SEE ALSO π₯
the whole friend group, fr fr β these all live in the kernel file ./security/selinux/avc.c:
avc_init(9)avc_lookup(9)avc_insert(9)avc_audit_pre_callback(9)avc_audit_post_callback(9)avc_update_node(9)avc_flush(9)avc_ss_reset(9)avc_compute_av(9)avc_perm_nonode(9)avc_has_perm_noaudit(9)avc_has_perm(9)
go read them all, i'll wait π
mwah π that's the page!! brought to you by the fine people at ./security/selinux, dated October 2026, and of course the star of the show herself, avc_add_callback(9). π§ββοΈβ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms