Is there a way to set the pipe capacity of pipes defined in a Bash (or other shell) script? Take e.g.
cmd1 | cmd2
In recent Linuxes the pipe capacity is set to 64KB by default. I know I can control the amount of data "buffered" between the two processes in two ways:
cmd1 | buffer | cmd2
F_SETPIPE_SZflag from inside
Each solution has downsides:
buffer can only be used to increase the buffer; also writes over the default pipe capacity will still require waking up the downstream command.
fcntl, as far as I know, can only be called from inside
My question is: is there a way, when the shell creates the pipe, to specify in the shell how much capacity the pipe should have?