Debian Codegraph @

upstream/debian-trixie/man2/ioctl_pipe.2

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