[PATCH] pipe.2: Add mention of O_NOTIFICATION_PIPE flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Cyril Hrubis <chrubis@xxxxxxx>

This adds very basic information about the notification pipe that have
been added into Linux 5.8.

There is some description about the interface at:

https://www.kernel.org/doc/html/latest/watch_queue.html

(I think that there is at least on bug in that page, since the
notification pipe has to be opened with O_NOTIFICATION_PIPE which is
defined to O_EXCL not O_TMPFILE)

The ENOPKG error should be clear from this header (see
watch_queue_init() at the end):

https://github.com/torvalds/linux/blob/5bfc75d92efd494db37f5c4c173d3639d4772966/include/linux/watch_queue.h

TODO:

Where to place the info about the structures and ioctls()? Does that
belong into pipe.2 as well?

Signed-off-by: Cyril Hrubis <chrubis@xxxxxxx>
---
 man2/pipe.2 | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/man2/pipe.2 b/man2/pipe.2
index 41a482f37..7d4db0323 100644
--- a/man2/pipe.2
+++ b/man2/pipe.2
@@ -149,6 +149,14 @@ referred to by the new file descriptors.
 Using this flag saves extra calls to
 .BR fcntl (2)
 to achieve the same result.
+.TP
+.BR O_NOTIFICATION_PIPE
+Since Linux 5.8,
+.\" commit c73be61cede5882f9605a852414db559c0ebedfd
+general notification mechanims is build on the top of the pipe where kernel
+splices notification messages into pipes opened by userspace. The owner of the
+pipe has to tell the kernel which sources of events to watch and filters can also
+be applied to select which subevents should be placed into the pipe.
 .SH RETURN VALUE
 On success, zero is returned.
 On error, \-1 is returned,
@@ -191,6 +199,15 @@ The system-wide limit on the total number of open files has been reached.
 The user hard limit on memory that can be allocated for pipes
 has been reached and the caller is not privileged; see
 .BR pipe (7).
+.TP
+.B ENOPKG
+.RB ( pipe2 ())
+.B O_NOTIFICATION_PIPE
+was passed in
+.IR flags
+and support for notifications
+.RB ( CONFIG_WATCH_QUEUE )
+is not compiled into the kernel.
 .SH VERSIONS
 .BR pipe2 ()
 was added to Linux in version 2.6.27;
-- 
2.34.1




[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux