label_cmp(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… label_cmp(9) β€” yes bestie, we're in the Kernel API Manual for this one

Okay so picture this: you're deep in the kernel, you've got a bunch of labels, and you need to know which one comes first. That's the whole gig. label_cmp is literally the label comparison for set ordering β€” it's the function that tells the sorting gods how to line aa_label structs up. ✨


🌸 NAME 🌸

label_cmp β€” label comparison for set ordering

Like, that's it. That's the function. It compares labels so sets can be ordered. No cap. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int label_cmp (const struct aa_label *a , const struct aa_label *b );

πŸ’– ARGUMENTS πŸ’–

  • a β€” label to compare. NOT NULL, bestie, I'm serious. Do not pass NULL here, that's not the vibe. πŸ™ˆ
  • b β€” the other label to compare. Also NOT NULL. Both of them. Non-negotiable. πŸ’€

⭐ RETURN ⭐

The return value is giving comparison-function classic:

  • <0 if a < b
  • ==0 if a == b
  • >0 if a > b

So basically the standard three-state thing β€” negative, zero, positive. Iconic behaviour, zero surprises. πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

Okay this list is long long, so buckle up, we're going on a tour of AppArmor label internals. πŸ’œ

That's the whole squad, fr fr. 🫢


Friendly reminder from your girl: a and b are both NOT NULL. Passing NULL is not a slay, it's a crash waiting to happen. πŸ™ˆ

✨ mwah, that's the page ✨ this little number lives in ./security/apparmor and it's dated October 2026 β€” so go forth, compare those labels, and stay hydrated. πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from