aa_vec_unique(9)
β¨ aa_vec_unique(9) β¨
okay so bestie, this is a page from the Kernel API Manual and it's literally about tidying up a list of profiles β sorting them, merging them, yeeting the dupes. it's aa_vec_unique, and it's giving "clean up your room but make it kernel code" π
πΈ NAME πΈ
aa_vec_unique β canonical sort and unique a list of profiles
like, it sorts the list into canonical order and collapses duplicates, all in one go. obsessed π«Ά
π SYNOPSIS π
int aa_vec_unique (struct aa_profile **vec , int n , int flags );
π¦ ARGUMENTS π¦
vecβ the list of profiles you want sorted and merged. that's your whole little friend group, lined up π§nβ how many refcounted profiles are in that list. important:n > 0, so don't come in here with an empty list, bestie πflagsβ the null terminator flags ofvec. yeah, it's flags, it's doing flag things π
β RETURN β
returns the number of duplicates eliminated β which is exactly the same as references put. one number, two ways of saying it, iconic π
π DESCRIPTION π
okay so here's the vibe check on this one:
if flags & VEC_FLAG_TERMINATE is true, then vec has a null terminator sitting right there at vec[n], and it will null terminate vec[n - dups]. no cap, that's the whole note π
π SEE ALSO π
bestie there are so many friends in this list, buckle up π these all live in the kernel file ./security/apparmor/label.c:
ns_cmp(9)profile_cmp(9)vec_cmp(9)aa_label_alloc(9)label_cmp(9)__aa_label_next_not_in_set(9)aa_label_is_subset(9)aa_label_is_unconfined_subset(9)__label_remove(9)__label_replace(9)__label_insert(9)__vec_find(9)__label_find(9)aa_label_remove(9)aa_label_replace(9)vec_find(9)aa_label_insert(9)aa_label_next_in_merge(9)label_merge_cmp(9)label_merge_insert(9)labelset_of_merge(9)__label_find_merge(9)aa_label_find_merge(9)aa_label_merge(9)label_compound_match(9)label_components_match(9)aa_label_match(9)aa_update_label_name(9)aa_profile_snxprint(9)aa_label_snxprint(9)aa_label_asxprint(9)aa_label_acntsxprint(9)aa_label_strn_parse(9)aa_labelset_destroy(9)__label_update(9)__labelset_update(9)__aa_labelset_update_subtree(9)
anyway that's the page π¦ it came from ./security/apparmor and it's dated October 2026 β so yeah, it's from the future, main character energy fr fr πβ¨
π¦ 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