Thread (3 messages) 3 messages, 2 authors, 2024-12-23

Re: ioctl_pipe(2): SYNOPSIS: $1

From: Alejandro Colomar <alx@kernel.org>
Date: 2024-12-23 21:29:59

Hi Cyril,

On Mon, Dec 16, 2024 at 11:23:44AM GMT, Cyril Hrubis wrote:
Hi!
quoted
quoted
The manual page ioctl_pipe(2) has this synopsis:

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

Which says the $1 is an array of int (the type is declared as int[1]).
However, this is incorrect, since the first argument is of course a
plain int, a single file descriptor.  Would you mind revising the page?
That looks indeed wrong, I suppose that we need just 'int pipefd' there.

And looking at the kernel both pipe file descriptors seems to get the
exact same fops so it shouldn't matter on which end we call the ioctl().
Thanks!  I've applied the patch below.

Have a lovely night!
Alex

<https://www.alejandro-colomar.es/src/alx/linux/man-pages/man-pages.git/commit/?h=contrib&id=b199d102db5be24e0ac88eb6879e3e3b6e0ea722>
	commit b199d102db5be24e0ac88eb6879e3e3b6e0ea722 (HEAD -> contrib, alx/contrib)
	Author: Alejandro Colomar [off-list ref]
	Date:   Mon Dec 23 22:25:54 2024 +0100

	    man/man2/ioctl_pipe.2: SYNOPSIS: Fix $1, which is not an array parameter
	    
	    Link: <https://lore.kernel.org/linux-man/20241214180423.2thsuyyfosrlyajb@devuan/T/#u (local)>
	    Reported-by: Alejandro Colomar [off-list ref]
	    Suggested-by: Cyril Hrubis [off-list ref]
	    Cc: David Howells [off-list ref]
	    Signed-off-by: Alejandro Colomar [off-list ref]

	diff --git a/man/man2/ioctl_pipe.2 b/man/man2/ioctl_pipe.2
	index 5f5c42652..fc15e1511 100644
	--- a/man/man2/ioctl_pipe.2
	+++ b/man/man2/ioctl_pipe.2
	@@ -10,8 +10,8 @@ .SH SYNOPSIS
	 .BR "#include <linux/watch_queue.h>" "  /* Definition of " IOC_WATCH_QUEUE_ "* */"
	 .B #include <sys/ioctl.h>
	 .P
	-.BI "int ioctl(int " pipefd "[1], IOC_WATCH_QUEUE_SET_SIZE, int " size );
	-.BI "int ioctl(int " pipefd "[1], IOC_WATCH_QUEUE_SET_FILTER,"
	+.BI "int ioctl(int " pipefd ", IOC_WATCH_QUEUE_SET_SIZE, int " size );
	+.BI "int ioctl(int " pipefd ", IOC_WATCH_QUEUE_SET_FILTER,"
	 .BI "          struct watch_notification_filter *" filter );
	 .fi
	 .SH DESCRIPTION
-- 
Cyril Hrubis
chrubis@suse.cz
-- 
<https://www.alejandro-colomar.es/>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help