Pipe buffer size is 4k or 64k?

后端 未结 5 1870
轻奢々
轻奢々 2020-11-28 04:46

I read in multiple places that the default buffer size for a pipe is 4kB (for instance, here), and my ulimit -a tends to confirm that statement:



        
5条回答
  •  被撕碎了的回忆
    2020-11-28 05:12

    It's programmable now


    As of Linux 2.6.35 you can use fcntl(2) with the F_SETPIPE_SZ operation to set the pipe buffer up to /proc/sys/fs/pipe-max-size. This is by default 1 MB; see proc(5).

提交回复
热议问题