ioctl_fs(2)

ioctl_fs πŸ’…

okay bestie, welcome to ioctl_fs(2) β€” the little corner of the System Calls Manual where the filesystem does its ~thing~. no cap, it's literally just "filesystem operations" and that's the whole NAME vibe ✨


🌸 LIBRARY

Standard C library (libc, -lc) 🫢


✨ SYNOPSIS

#include <linux/fs.h>  /* Definition of op constants */
#include <sys/ioctl.h>

int ioctl(int fd, unsigned long op, ...);

so you pull in <linux/fs.h> for the op constants (the comment fr says "Definition of op constants" πŸ’–), plus <sys/ioctl.h>, and then you're calling ioctl with your file descriptor fd, that unsigned long op, and the ... does whatever it wants, iykyk.


πŸ¦‹ DESCRIPTION

The following op values are available. πŸ‘‘

πŸŽ€ Share some of the data of one file with another file

it's giving ✨sharing is caring✨ β€” you're passing around some of the data of one file to another file. iconic behavior honestly.

πŸ“ Operations for inode flags

the inode flags girlies ~get~ and ~set~, main character energy πŸŽ€

🌈 Get or set a filesystem label

naming your filesystem? slay. reading its name back? also slay. πŸ’œ

⭐ Get and/or clear page flags

peeking at page flags and/or clearing them β€” multi-tasking queen πŸ‘‘


πŸ’€ RETURN VALUE

On success, a nonnegative value is returned. 🫢

On error, -1 is returned, and errno is set to indicate the error. (so like, always check errno, bestie, don't just rawdog the return value 😭)


πŸ‘‘ STANDARDS

Linux. that's it, that's the standard. periodt. πŸ’…


πŸ”₯ SEE ALSO


okay that's the whole page, you ate it up fr fr 🧚✨ this was Linux man-pages 6.20, dated 2025-05-17, and yes, ioctl_fs(2) really is the whole name up at the top. go forth and ioctl responsibly, my love πŸ«ΆπŸ’–πŸŒˆ

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms