pipe(7) Miscellaneous Information Manual pipe(7) pipe - FIFOs FIFOs ( ) . . . pipe(2) . pipe(2) . FIFO ( First In First Out) ( mkfifo(3)) open(2). FIFO . O_RDONLY O_WRONLY. fifo(7) . : FIFOs / FIFOs ( ). / FIFOs FIFOs . / FIFOs . read(2) . ( ) write(2) . / fcntl(2) F_SETFL O_NONBLOCK fifo(7) O_NONBLOCK. EAGAIN -- -- . : . read(2) ( read(2) 0). write(2) SIGPIPE . write(2) EPIPE. pipe(2) fork(2) close(2) SIGPIPE/EPIPE . lseek(2) . . write(2) O_NONBLOCK ( ). . : . Linux 2.6.11 ( 4096 i386). Linux 2.6.11 16 ( 65,536 4096 ). Linux 2.6.35 16 fcntl(2) F_GETPIPE_SZ F_SETPIPE_SZ. fcntl(2) . Linux 4.5 16 pipe-user-pages-soft. ioctl(2) int : ioctl(fd, FIONREAD, &nbytes); FIONREAD . /proc Linux : /proc/sys/fs/pipe-max-pages ( Linux 2.6.34) ( CAP_SYS_RESOURCE) . 16 ( ) . Linux 2.6.35 /proc/sys/fs/pipe-max-size. /proc/sys/fs/pipe-max-size ( 2.6.35) () CAP_SYS_RESOURCE. . . 1048576 (1 ). . write(2) EINVAL. Linux 4.9 FIFO . /proc/sys/fs/pipe-user-pages-hard ( 4.5) () ( CAP_SYS_RESOURCE CAP_SYS_ADMIN). . ( ) . /proc/sys/fs/pipe-user-pages-soft ( 4.5) () ( CAP_SYS_RESOURCE CAP_SYS_ADMIN). ( 5.14) . . 16384 1024 . 4.9 pipe-user-pages-soft pipe-user-pages-hard BUGS. PIPE_BUF POSIX.1 PIPE_BUF : . PIPE_BUF : . POSIX.1 PIPE_BUF 512 . ( PIPE_BUF 4096 .) (O_NONBLOCK) n : O_NONBLOCK n <= PIPE_BUF n write(2) n O_NONBLOCK n <= PIPE_BUF n write(2) n write(2) errno EAGAIN. O_NONBLOCK n > PIPE_BUF : write(2) write(2) write(2) n . O_NONBLOCK n > PIPE_BUF write(2) errno EAGAIN. 1 n ( " " write(2) ) . FIFO O_NONBLOCK O_ASYNC. O_ASYNC (SIGIO ) . fcntl(2) F_SETOWN. O_ASYNC FIFOs 2.6. ( ) : . POSIX.1 . . 4.9 pipe-user-pages-soft pipe-user-pages-hard fcntl(2) F_SETPIPE_SZ : () . ( ) . ( .) 4.9 . () . . 4.9 . () : (1) . (2) . (3) . . (1) (3) . 4.9 . 4.9 () () pipe(2) FIFO . mkfifo(1), dup(2), fcntl(2), open(2), pipe(2), poll(2), select(2), socketpair(2), splice(2), stat(2), tee(2), vmsplice(2), mkfifo(3), epoll(7), fifo(7) 3 . . : . 6.18 8 2026 pipe(7)