LINUX标准io默认都是阻塞的
2011-12-21 11:31
232 查看
#include <stdio.h> #include <fcntl.h> #include <unistd.h> int main() { int s_in, s_out, s_err; s_in= fcntl(STDIN_FILENO, F_GETFL); s_out= fcntl(STDOUT_FILENO, F_GETFL); s_err= fcntl(STDERR_FILENO, F_GETFL); if (O_NONBLOCK == s_in) printf("stdin is nonblock\n"); else printf("stdin is block\n"); if (O_NONBLOCK == s_out) printf("stdout is nonblock\n"); else printf("stdout is block\n"); if (O_NONBLOCK == s_err) printf("stderror is nonblock\n"); else printf("stderror is block\n"); }
相关文章推荐
- 五种IO 模式——阻塞(默认IO模式),非阻塞(常用语管道),IO多路复用(IO多路复用的应用场景),信号IO,异步IO
- 五种I/O 模式——阻塞(默认IO模式),非阻塞(常用语管道),I/O多路复用(IO多路复用的应用场景),信号I/O,异步I/O
- 五种I/O 模式——阻塞(默认IO模式),非阻塞(常用语管道),I/O多路复用(IO多路复用的应用场景),信号I/O,异步I/O
- 五种I/O 模式——阻塞(默认IO模式),非阻塞(常用语管道),I/O多路复用(IO多路复用的应用场景),信号I/O,异步I/O
- 五种I/O 模式—阻塞(默认IO模式),非阻塞,I/O多路复用,信号I/O,异步I/O
- 五种I/O 模式——阻塞(默认IO模式),非阻塞(常用语管道),I/O多路复用(IO多路复用的应用场景),信号I/O,异步I/O
- 五种I/O 模式——阻塞(默认IO模式),非阻塞(常用语管道),I/O多路复用(IO多路复用的应用场景),信号I/O,异步I/O
- 五种I/O 模式——阻塞(默认IO模式),非阻塞(常用语管道),I/O多路复用(IO多路复用的应用场景),信号I/O,异步I/O
- 五种IO 模式——阻塞(默认IO模式),非阻塞(常用语管道),IO多路复用(IO多路复用的应用场景),信号IO,异步IO
- 五种IO 模式——阻塞(默认IO模式),非阻塞(常用语管道),IO多路复用(IO多路复用的应用场景),信号IO,异步IO
- 五种I/O 模式——阻塞(默认IO模式),非阻塞(常用语管道),I/O多路复用(IO多路复用的应用场景),信号I/O,异步I/O
- 五种IO 模式——阻塞(默认IO模式),非阻塞(常用语管道),IO多路复用(IO多路复用的应用场景),信号IO,异步IO
- 五种I/O 模式——阻塞(默认IO模式),非阻塞(常用语管道),I/O多路复用(IO多路复用的应用场景),信号I/O,异步I/O
- 五种IO 模式——阻塞(默认IO模式),非阻塞(常用语管道),IO多路复用(IO多路复用的应用场景),信号IO,异步IO
- 五种I/O 模式——阻塞(默认IO模式),非阻塞(常用语管道),I/O多路复用(IO多路复用的应用场景),信号I/O,异步I/O
- IO - 同步,异步,阻塞,非阻塞 (亡羊补牢篇)
- 【转载】高性能IO设计 & Java NIO & 同步/异步 阻塞/非阻塞 Reactor/Proactor
- 异步同步与阻塞非阻塞 及java IO、java newIO、java AIO之间的关系
- JAVA基础知识之网络编程——-关于阻塞IO/非阻塞IO/同步IO/异步IO的一些参考文章
- 同步与异步IO、阻塞与非阻塞IO