Debian Codegraph @

upstream/debian-unstable/man2/ioctl_pipe.2

raw
1 .\" Copyright 2022, Cyril Hrubis <[email protected]>
2 .\" Copyright, the authors of the Linux man-pages project
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH ioctl_pipe 2 2026-02-08 "Linux man-pages 6.18"
7 .SH NAME
8 ioctl_pipe \- ioctl() operations for general notification mechanism
9 .SH SYNOPSIS
10 .nf
11 .BR "#include <linux/watch_queue.h>" " /* Definition of " IOC_WATCH_QUEUE_ "* */"
12 .B #include <sys/ioctl.h>
13 .P
14 .BI "int ioctl(int " pipefd ", IOC_WATCH_QUEUE_SET_SIZE, int " size );
15 .BI "int ioctl(int " pipefd ", IOC_WATCH_QUEUE_SET_FILTER,"
16 .BI " struct watch_notification_filter *" filter );
17 .fi
18 .SH DESCRIPTION
19 The following
20 .BR ioctl (2)
21 operations are provided to set up general notification queue parameters.
22 The notification queue is built on the top of a
23 .BR pipe (2)
24 opened with the
25 .B O_NOTIFICATION_PIPE
26 flag.
27 .TP
28 .BR IOC_WATCH_QUEUE_SET_SIZE " (since Linux 5.8)"
29 .\" commit c73be61cede5882f9605a852414db559c0ebedfd
30 Preallocates the pipe buffer memory so that
31 it can fit
32 .I size
33 notification messages.
34 Currently,
35 .I size
36 must be between 1 and 512.
37 .TP
38 .BR IOC_WATCH_QUEUE_SET_FILTER " (since Linux 5.8)"
39 .\" commit c73be61cede5882f9605a852414db559c0ebedfd
40 Watch queue filter can limit events that are received.
41 Filters are passed in a
42 .I struct watch_notification_filter
43 and each filter is described by a
44 .I struct watch_notification_type_filter
45 structure.
46 .IP
47 .in +4n
48 .EX
49 struct watch_notification_filter {
50 __u32 nr_filters;
51 __u32 __reserved;
52 struct watch_notification_type_filter filters[];
53 };
54 \&
55 struct watch_notification_type_filter {
56 __u32 type;
57 __u32 info_filter;
58 __u32 info_mask;
59 __u32 subtype_filter[8];
60 };
61 .EE
62 .in
63 .SH SEE ALSO
64 .BR pipe (2),
65 .BR ioctl (2)