PR_SET_IO_FLUSHER(2const)

πŸ’– PR_SET_IO_FLUSHER β€” change the IO_FLUSHER state πŸ’–

okay bestie, welcome to the PR_SET_IO_FLUSHER(2const) page 🌸 she's from section 2const of the Linux man-pages, and she's very niche but honestly? iconic.


πŸŽ€ LIBRARY

Standard C library (libc, -lc) ✨


πŸ¦‹ SYNOPSIS

#include <linux/prctl.h>  /* Definition of PR_* constants */
#include <sys/prctl.h>

int prctl(PR_SET_IO_FLUSHER, long state, 0L, 0L, 0L);

so the vibe here is: you're calling prctl with PR_SET_IO_FLUSHER as the first arg, your state as a long, and then literally three 0Ls just chillin there. no notes πŸ’…


✨ DESCRIPTION ✨

so here's the tea πŸ“ if a user process is involved in the block layer or filesystem I/O path, and it can allocate memory while processing I/O requests, it must set state to 1. that puts the process into the IO_FLUSHER state πŸ‘‘ which grants it special treatment so it can keep making progress while it's allocating memory. no cap, this is the priority-lane situation.

if state is 0, the process clears the IO_FLUSHER state and the default behavior is used. back to being a regular civilian πŸ™ˆ

⚠️ heads up bestie: the calling process must have the CAP_SYS_RESOURCE capability. no cap, no entry.

the IO_FLUSHER state is inherited by a child process created via fork(2) 🍼 and it is preserved across execve(2). so it follows you around, lowkey clingy but in a useful way πŸ’œ

examples of IO_FLUSHER applications are FUSE daemons 🫢, SCSI device emulation daemons, and daemons that perform error handling β€” like multipath path recovery applications. yeah, the serious infrastructure girlies πŸ’€πŸ”₯


πŸ”₯ RETURN VALUE

  • on success, 0 is returned ✨ slay
  • on error, -1 is returned, and errno is set to indicate the error 😭

😭 ERRORS

  • EINVAL β€” state is not a valid value. (it's giving "girl what is that number" πŸ’€)

🌈 STANDARDS

Linux. 🐧 periodt.


πŸ‘‘ HISTORY

Linux 5.6. so she's a relative newcomer, born 2020, already carrying the whole I/O path on her back πŸ’…


🌸 SEE ALSO


okay that's the whole page bestie, you ate πŸŽ€ mwah πŸ’–

sign-off time: this lil rewrite is brought to you by Linux man-pages 6.20, dated 2026-02-08, for PR_SET_IO_FLUSHER(2const) ⭐ go forth and allocate memory while processing I/O requests responsibly, iykyk πŸ¦‹

πŸ“¦ 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