diff options
| author | Alejandro Colomar <alx@kernel.org> | 2025-07-13 01:28:43 +0200 |
|---|---|---|
| committer | Alejandro Colomar <alx@kernel.org> | 2025-07-20 00:42:57 +0200 |
| commit | 21ea050fc6155f2af8c72e5681cf7b1e3881db9e (patch) | |
| tree | aaf133a9ff693d65a3078d981a5c4dcd5427f845 | |
| parent | 50660de0687d83ff38e12945ca7362d3834181b0 (diff) | |
| download | man-pages-21ea050fc6155f2af8c72e5681cf7b1e3881db9e.tar.gz | |
man/man2/fcntl.2, man/man2const/F_GETPIPE_SZ.2const: Split F_{G,S}ETPIPE_SZ from fcntl(2)
Signed-off-by: Alejandro Colomar <alx@kernel.org>
| -rw-r--r-- | man/man2/fcntl.2 | 69 | ||||
| -rw-r--r-- | man/man2const/F_GETPIPE_SZ.2const | 96 |
2 files changed, 99 insertions, 66 deletions
diff --git a/man/man2/fcntl.2 b/man/man2/fcntl.2 index ef2b053b22..1c5c3bdf12 100644 --- a/man/man2/fcntl.2 +++ b/man/man2/fcntl.2 @@ -1169,49 +1169,9 @@ See .BR inotify (7). .SS Changing the capacity of a pipe .TP -.BR F_SETPIPE_SZ "\~(\f[I]int\f[]; since Linux 2.6.35)" -Change the capacity of the pipe referred to by -.I fd -to be at least -.I arg -bytes. -An unprivileged process can adjust the pipe capacity to any value -between the system page size and the limit defined in -.I /proc/sys/fs/pipe\-max\-size -(see -.BR proc (5)). -Attempts to set the pipe capacity below the page size are silently -rounded up to the page size. -Attempts by an unprivileged process to set the pipe capacity above the limit in -.I /proc/sys/fs/pipe\-max\-size -yield the error -.BR EPERM ; -a privileged process -.RB ( CAP_SYS_RESOURCE ) -can override the limit. -.IP -When allocating the buffer for the pipe, -the kernel may use a capacity larger than -.IR arg , -if that is convenient for the implementation. -(In the current implementation, -the allocation is the next higher power-of-two page-size multiple -of the requested size.) -The actual capacity (in bytes) that is set is returned as the function result. -.IP -Attempting to set the pipe capacity smaller than the amount -of buffer space currently used to store data produces the error -.BR EBUSY . -.IP -Note that because of the way the pages of the pipe buffer -are employed when data is written to the pipe, -the number of bytes that can be written may be less than the nominal size, -depending on the size of the writes. -.TP -.BR F_GETPIPE_SZ "\~(\f[I]void\f[]; since Linux 2.6.35)" -Return (as the function result) the capacity of the pipe referred to by -.IR fd . -.\" +.BR F_SETPIPE_SZ (2const) +.TQ +.BR F_GETPIPE_SZ (2const) .SS File Sealing File seals limit the set of allowed operations on a given file. For each seal that is set on a file, @@ -1467,11 +1427,6 @@ for traditional .B SIGIO behavior. .TP -.B F_GETPIPE_SZ -.TQ -.B F_SETPIPE_SZ -The pipe capacity. -.TP .B F_GET_SEALS A bit mask identifying the seals that have been set for the inode referred to by @@ -1508,15 +1463,6 @@ type of lock requested. .B EBUSY .I op is -.B F_SETPIPE_SZ -and the new pipe capacity specified in -.I arg -is smaller than the amount of buffer space currently -used to store data in the pipe. -.TP -.B EBUSY -.I op -is .BR F_ADD_SEALS , .I arg includes @@ -1611,13 +1557,6 @@ does not refer to a directory. .TP .B EPERM .I op -is -.B F_SETPIPE_SZ -and the soft or hard user pipe limit has been reached; see -.BR pipe (7). -.TP -.B EPERM -.I op was .BR F_ADD_SEALS , but @@ -1636,8 +1575,6 @@ POSIX.1-2008. .P .BR F_GETOWN_EX , .BR F_SETOWN_EX , -.BR F_SETPIPE_SZ , -.BR F_GETPIPE_SZ , .BR F_GETSIG , .BR F_SETSIG , .BR F_NOTIFY , diff --git a/man/man2const/F_GETPIPE_SZ.2const b/man/man2const/F_GETPIPE_SZ.2const new file mode 100644 index 0000000000..9ae2643ed5 --- /dev/null +++ b/man/man2const/F_GETPIPE_SZ.2const @@ -0,0 +1,96 @@ +.\" Copyright, the authors of the Linux man-pages project +.\" +.\" SPDX-License-Identifier: Linux-man-pages-copyleft +.\" +.TH F_GETPIPE_SZ 2const (date) "Linux man-pages (unreleased)" +.SH NAME +F_GETPIPE_SZ, +F_SETPIPE_SZ +\- +get/set the capacity of a pipe +.SH LIBRARY +Standard C library +.RI ( libc ,\~ \-lc ) +.SH SYNOPSIS +.nf +.B #define _GNU_SOURCE +.B #include <fcntl.h> +.P +.BI "int fcntl(int " fd ", F_SETPIPE_SZ, int " arg ); +.BI "int fcntl(int " fd ", F_GETPIPE_SZ);" +.fi +.SH DESCRIPTION +.TP +.BR F_SETPIPE_SZ "\~(\f[I]int\f[]; since Linux 2.6.35)" +Change the capacity of the pipe referred to by +.I fd +to be at least +.I arg +bytes. +An unprivileged process can adjust the pipe capacity to any value +between the system page size and the limit defined in +.I /proc/sys/fs/pipe\-max\-size +(see +.BR proc (5)). +Attempts to set the pipe capacity below the page size are silently +rounded up to the page size. +Attempts by an unprivileged process to set the pipe capacity above the limit in +.I /proc/sys/fs/pipe\-max\-size +yield the error +.BR EPERM ; +a privileged process +.RB ( CAP_SYS_RESOURCE ) +can override the limit. +.IP +When allocating the buffer for the pipe, +the kernel may use a capacity larger than +.IR arg , +if that is convenient for the implementation. +(In the current implementation, +the allocation is the next higher power-of-two page-size multiple +of the requested size.) +The actual capacity (in bytes) that is set is returned as the function result. +.IP +Attempting to set the pipe capacity smaller than the amount +of buffer space currently used to store data produces the error +.BR EBUSY . +.IP +Note that because of the way the pages of the pipe buffer +are employed when data is written to the pipe, +the number of bytes that can be written may be less than the nominal size, +depending on the size of the writes. +.TP +.BR F_GETPIPE_SZ "\~(\f[I]void\f[]; since Linux 2.6.35)" +Return (as the function result) the capacity of the pipe referred to by +.IR fd . +.SH RETURN VALUE +The pipe capacity. +.P +On error, \-1 is returned, and +.I errno +is set to indicate the error. +.SH ERRORS +See +.BR fcntl (2). +.TP +.B EBUSY +.I op +is +.B F_SETPIPE_SZ +and the new pipe capacity specified in +.I arg +is smaller than the amount of buffer space currently +used to store data in the pipe. +.TP +.B EPERM +.I op +is +.B F_SETPIPE_SZ +and the soft or hard user pipe limit has been reached; see +.BR pipe (7). +.SH STANDARDS +Linux. +.SH HISTORY +Linux. +.SH SEE ALSO +.BR fcntl (2) |
