set_classid(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

Okay bestie, welcome to set_classid(9) from the Kernel API Manual β€” the little helper that sets a cgroupv1 net_cls classid. That's the whole vibe: classid, set, slay. πŸ’…

✨ SYNOPSIS ✨

This is the entire signature β€” no secret extra args, no plot twist:

int set_classid (void );

πŸŽ€ ARGUMENTS πŸŽ€

  • void β€” no arguments. Literally none, bestie. The function takes nothing. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

So what does it actually do? It writes the classid into the cgroup work dir's net_cls.classid file, so that later on socket tagging can be triggered. That's the whole point, and it is iconic.

It leverages the current pid as the classid, which ensures unique identification. Yes: current pid becomes the classid, unique-id energy only. πŸ‘‘

On success, it returns 0; otherwise, on failure, it returns 1. If there is a failure, it prints the error to stderr. No silent-failure nonsense here β€” stderr gets the tea. 😭

🌸 SEE ALSO 🌸

Kernel file: ./tools/testing/selftests/bpf/cgroup_helpers.c

Then go say hi to the whole friend group:


Signed, sealed, delivered, no cap: source/version ./tools/testing/selftests/bpf, date October 2026. πŸ’–βœ¨

πŸ“¦ where this page comes from