profile_cmp(9)
π profile_cmp(9) β or, "how do we even order these profiles bestie"
okay so this page lives in the Kernel API Manual (section 9, kernel-adjacent girlies rise) and it's all about profile_cmp β the lil function that decides how profiles get ordered in a set. Think of it as the vibe-check bouncer for the set ordering line π
β¨ NAME β¨
profile_cmp β profile comparison for set ordering π«Ά
πΈ SYNOPSIS πΈ
int profile_cmp (struct aa_profile *a , struct aa_profile *b );
π ARGUMENTS π
aβ the profile to compare (and likeβ¦ it is NOT NULL, bestie, do not come for her with a NULL, she will not survive it π)bβ the other profile to compare (also NOT NULL, same energy, no NULLs allowed periodt π)
β RETURN β
the return value is giving "three-way comparison" and here's the whole tea:
<0whena < b==0whena == b>0whena > b
like yes, that's it, that's the whole slay β sign of the result tells you who ranks first π₯
π SEE ALSO π
this is the friend group, the whole squad, the group chat, and honestly they're all iconic. Kernel file ./security/apparmor/label.c is where the source lives btw:
ns_cmp(9)vec_cmp(9)aa_vec_unique(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)
π‘ tiny reminder bestie:aandbare both marked NOT NULL, so no funny business, no sneaky NULLs, mkay? the docs said it in all caps for a reason π
okay that's the whole page, and before you go β the source path is ./security/apparmor and this edition is dated October 2026 π so like, yes, a little time-travel moment, we love that for us. mwah, go order some profiles ππ¦
π¦ 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