ioctl_pipe(2)

πŸ’– ioctl_pipe β€” the manual, but make it a group chat πŸ’–

okay bestie, so this is the ioctl_pipe(2) page from the System Calls Manual section. it's short, it's sweet, it's giving "niche kernel knowledge", and we're gonna devour it. πŸ“


✨ NAME ✨

ioctl_pipe β€” literally just the ioctl() operations for the general notification mechanism. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

no cap, you're gonna need these headers first:

#include <linux/watch_queue.h>  /* Definition of IOC_WATCH_QUEUE_* */
#include <sys/ioctl.h>

int ioctl(int pipefd, IOC_WATCH_QUEUE_SET_SIZE, int size);
int ioctl(int pipefd, IOC_WATCH_QUEUE_SET_FILTER,
          struct watch_notification_filter *filter);

🌸 DESCRIPTION 🌸

so here's the tea β˜• β€” these ioctl(2) operations exist so you can set up your general notification queue parameters. and where does this notification queue live? on top of a pipe(2) that you opened with the O_NOTIFICATION_PIPE flag. iconic behaviour, honestly.


πŸ’… IOC_WATCH_QUEUE_SET_SIZE (since Linux 5.8)

this one preallocates the pipe buffer memory so it can fit size notification messages. πŸ’Ύ

heads up bestie: right now, size must be between 1 and 512. no in-between nonsense, no going feral with big numbers. 512 is the ceiling, periodt.

🫢 IOC_WATCH_QUEUE_SET_FILTER (since Linux 5.8)

a watch queue filter can limit the events that get received β€” like a bouncer for your kernel events, only letting the ones you care about through. πŸšͺ✨

filters get passed in a struct watch_notification_filter, and each individual filter inside is described by a struct watch_notification_type_filter. two structs, bestie, one job. 🧚

struct watch_notification_filter {
        __u32   nr_filters;
        __u32   __reserved;
        struct watch_notification_type_filter filters[];
};

struct watch_notification_type_filter {
        __u32   type;
        __u32   info_filter;
        __u32   info_mask;
        __u32   subtype_filter[8];
};

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie!! πŸ’œ lowkey a masterpiece of minimalism, highkey essential if you're messing with notification queues. go read the SEE ALSO's, they're the supporting cast and they ate. πŸ’…

this has been Linux man-pages 6.20, dated 2026-02-08 β€” mwah, sleep well, drink water, and always close your file descriptors. πŸŽ€βœ¨

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