c - 在 CentOS 上增加管道内部缓冲区大小

标签 c linux multithreading ipc pipe

我正在使用异步管道进行进程间通信(为了简化我删除了错误检查)

int pipe_fd[2];
pipe(pipe_fd);
int fdflags = fcntl(pipe_fd[1], F_GETFL, 0);
fdflags |= O_NONBLOCK;
fcntl(pipe_fd[1], F_SETFL, fdflags);

我正在寻找增加管道内部缓冲区大小的方法。 我知道可以使用 Kernel >= 2.6.35 通过以下方式:

fcntl(fd, F_SETPIPE_SZ, size);

或写信给:

/proc/sys/fs/pipe-max-size

但我正在使用内核 2.6.18 开发 CentOS 5。 是否可以使用内核 2.6.18 增加管道内部缓冲区大小?如果是,该怎么做?

最佳答案

在CentoS 5的内核中,一个管道固定为64KB

关于c - 在 CentOS 上增加管道内部缓冲区大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10376180/

相关文章:

c++ - 在 Visual Studio 2010 的 C++ 中使用 lapack C header 的错误

linux - ELF 动态加载程序符号查找顺序

java - 如何计算多线程程序的运行时间?

java - Java 中的多线程不考虑套接字超时?

c++ - C++11 theads 的最基本并行化失败

C 编程找到 C89 的输出吗?

c++ - 如何进行无分支数字循环?

C初学者: How to copy the arguments from *argv[] to an array of strings using a while loop?

linux - Kurento 媒体服务器在安装时自动创建一个额外的帐户 "kurento"

linux - 单个命令查找文件、压缩并移动到不同位置、删除原始文件