On 4/24/22 4:26 PM, Alexey via Bug reports for the GNU Bourne Again SHell
wrote:
My pipe size is 4kb, but...
ulimit -p
8
{ file /proc/self/fd/0; } <<<"$(dd if=/dev/urandom bs=1
count=$((4096*16)))"
/proc/self/fd/0: symbolic link to pipe:[1427240]
{ file /proc/self/fd/0; } <<<"$(dd if=/dev/urandom bs=1
count=$((4096*17)))"
/proc/self/fd/0: symbolic link to /tmp/sh-thd.Npifok (deleted)
Only from size 65Kb it's became a file. BASH 5.1.16
It's a good question. There's no system call for the kernel to report the
`pipe size', which is a fluid concept. There are only a couple of shells
that syntheize a value for it: bash and ksh93. Bash uses the value of
PIPE_BUF, which is defined on POSIX systems as the maximum number of bytes
that can be written to a pipe atomically. That's the 4096 number. The pipe
capacity is the number of bytes that can be written to the pipe -- by any
process -- without being read, before writes block or fail. That's 64K on
Linux.
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/