fs_umode_to_dtype(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fs_umode_to_dtype(9) β€” the Kernel API Manual moment

okay so bestie, we're in the kernel API manual (9 section, that's the kernel one, iykyk) and today's main character is fs_umode_to_dtype. she does exactly one thing and she does it slayfully.


✨ NAME ✨

fs_umode_to_dtype β€” file mode to dirent file type. that's it. that's the whole job. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

unsigned char fs_umode_to_dtype (umode_t mode );

literally just hand her a mode and she hands you back an unsigned char. no drama, no side quests. πŸ’–


🌸 ARGUMENTS 🌸

  • mode β€” the file mode you wanna convert. that's the input, bestie, that's what you're feeding her. πŸ“

πŸ‘‘ DESCRIPTION πŸ‘‘

so like, this function converts the file mode value to the directory entry type (DT_*). that's the vibe. mode in, DT_* out. she's the translator in the group chat between "file mode" and "dirent type" and honestly? she never misses. πŸ’…βœ¨


🧚 CONTEXT 🧚

any context. any. not me being flexible about it β€” she genuinely does not care where you call her from. 🌈


⭐ RETURN ⭐

here's the whole menu of what she might hand back:

  • DT_UNKNOWN β€” unknown type πŸ™ˆ
  • DT_FIFO β€” FIFO
  • DT_CHR β€” character device
  • DT_DIR β€” directory
  • DT_BLK β€” block device
  • DT_REG β€” regular file
  • DT_LNK β€” symbolic link
  • DT_SOCK β€” local-domain socket

eight whole options and every single one of them is valid. no cap. πŸ”₯


πŸ’œ SEE ALSO πŸ’œ

(her friends!! the ftype girlies!! go read them too, they're iconic 🫢)


and that's the page, bestie β€” sourced from ./fs, dated October 2026, brought to you by the fs_umode_to_dtype(9) girlies themselves. mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from