NAME |LIBRARY |SYNOPSIS |DESCRIPTION |RETURN VALUE |ERRORS |STANDARDS |HISTORY |SEE ALSO |COLOPHON | |
F_GETPIPE_SZ(2const)F_GETPIPE_SZ(2const)F_GETPIPE_SZ, F_SETPIPE_SZ - get/set the capacity of a pipe
Standard C library (libc,-lc)
#define _GNU_SOURCE#include <fcntl.h>int fcntl(intfd, F_SETPIPE_SZ, intarg);int fcntl(intfd, F_GETPIPE_SZ);
F_SETPIPE_SZ Change the capacity of the pipe referred to byfd to be at leastarg bytes. An unprivileged process can adjust the pipe capacity to any value between the system page size and the limit defined in/proc/sys/fs/pipe-max-size (seeproc_sys_fs(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/proc/sys/fs/pipe-max-size yield the errorEPERM; a privileged process (CAP_SYS_RESOURCE) can override the limit. When allocating the buffer for the pipe, the kernel may use a capacity larger thanarg, 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. Attempting to set the pipe capacity smaller than the amount of buffer space currently used to store data produces the errorEBUSY. 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.F_GETPIPE_SZ Return (as the function result) the capacity of the pipe referred to byfd.
The pipe capacity. On error, -1 is returned, anderrno is set to indicate the error.
Seefcntl(2).EBUSYop isF_SETPIPE_SZand the new pipe capacity specified inarg is smaller than the amount of buffer space currently used to store data in the pipe.EPERMop isF_SETPIPE_SZand the soft or hard user pipe limit has been reached; seepipe(7).
Linux.
Linux 2.6.35.
fcntl(2)
This page is part of theman-pages (Linux kernel and C library user-space interface documentation) project. Information about the project can be found at ⟨https://www.kernel.org/doc/man-pages/⟩. If you have a bug report for this manual page, see ⟨https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/CONTRIBUTING⟩. This page was obtained from the tarball man-pages-6.15.tar.gz fetched from ⟨https://mirrors.edge.kernel.org/pub/linux/docs/man-pages/⟩ on 2025-08-11. If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up- to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which isnot part of the original manual page), send a mail to man-pages@man7.orgLinux man-pages 6.15 2025-07-20F_GETPIPE_SZ(2const)Pages that refer to this page:fcntl(2)
HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface. For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere. Hosting byjambit GmbH. | ![]() |