anon_inode_create_getfd(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– anon_inode_create_getfd(9) πŸ’–

okay so welcome to the Kernel API Manual page for anon_inode_create_getfd β€” manual name folded in like a cute little sticker πŸŽ€. This one is lowkey the β€œnew anon inode, who dis?” energy, and every detail is coming with us. no cap πŸ’…


🌸 NAME 🌸

anon_inode_create_getfd β€” like anon_inode_getfd(), but it creates a new !S_PRIVATE anon inode instead of reusing the singleton anon inode, and it calls the inode_init_security_anon() LSM hook. periodt ✨

πŸ¦‹ SYNOPSIS πŸ¦‹

int anon_inode_create_getfd (const char *name , const struct
       file_operations *fops , void *priv , int flags , const struct inode
       *context_inode );

🫢 ARGUMENTS 🫢

  • name [in] β€” name of the "class" of the new file. yes bestie, that’s literally the label πŸŽ€
  • fops [in] β€” file operations for the new file.
  • priv [in] β€” private data for the new file; it will be the file’s private_data.
  • flags [in] β€” flags. iconic, no extra notes in the source πŸ’…
  • context_inode [in] β€” the logical relationship with the new inode; optional.

πŸ’œ DESCRIPTION πŸ’œ

Create a new anonymous inode and file pair. this can be done for two reasons:

  • for the inode to have its own security context, so that LSMs can enforce policy on the inode's creation;
  • if the caller needs a unique inode, for example in order to customize the size returned by fstat.

The LSM may use context_inode in inode_init_security_anon, but a reference to it is not held. like, do not assume you’re holding a ref, bestie β€” that is the whole note 😭

It returns a newly created file descriptor or an error code. slay when it works, error code when it doesn’t 🌈

🌟 SEE ALSO 🌟


mwah πŸ’‹ β€” this page is from ./fs, dated October 2026, and it’s the anon_inode_create_getfd(9) moment. byeeee πŸ¦‹

πŸ“¦ where this page comes from