cred_fscmp(9)
π NAME π
Hiii bestie!! Welcome to cred_fscmp(9) from the Kernel API Manual β this is the page all about Compare two credentials with respect to filesystem access. It's giving kernel credential comparison realness, and we're gonna get into it π¦β¨
β¨ SYNOPSIS β¨
int cred_fscmp (const struct cred *a , const struct cred *b );
π ARGUMENTS π
aβ the first credential, aka the first bestie in this comparison πbβ the second credential, aka the other bestie in this comparison π
πΈ DESCRIPTION πΈ
Okay so here's the tea: the description says cred_cmp will return zero if both credentials have the same fsuid, fsgid, and supplementary groups. Yes, the page literally says cred_cmp there β I'm not renaming it, bestie π
That is, if they will both provide the same access to files based on mode/uid/gid. Same access, same vibe, no cap β¨
If the credentials are different, then either -1 or 1 will be returned depending on whether a comes before or after b respectively in an arbitrary, but stable, ordering of credentials. Arbitrary but stable is the whole ordering moment, and I'm obsessed π₯
π RETURN π
-1,0, or1depending on comparison.
That's the return section, periodt π
π SEE ALSO π
The SEE ALSO squad is the Kernel file ./kernel/cred.c, plus these icons:
__put_cred(9)get_task_cred(9)prepare_creds(9)commit_creds(9)abort_creds(9)prepare_kernel_cred(9)set_security_override(9)set_create_files_as(9)
xoxo, your kernel bestie π β brought to you by source ./kernel, dated October 2026, and signed cred_fscmp(9) at the very end β¨π
π¦ 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