fread popen hangs up NONBLOCK
来源:互联网 发布:java webform 编辑:程序博客网 时间:2024/05/20 22:37
In Linux (or any Unix-y OS), you can mark the underlying file descriptor used by popen() to be non-blocking.
#include <fcntl.h>
FILE *proc = popen("tail -f /tmp/test.txt", "r");
int fd = fileno(proc);
flags = fcntl(fd, F_GETFL, 0);
flags |= O_NONBLOCK;
fcntl(fd, F_SETFL, flags);
If there is no input available, fgets will return NULL with errno set to EWOULDBLOCK.
- fread popen hangs up NONBLOCK
- Eclipse: “Update SVN cache” hangs and locks up
- select+NONBLOCK
- select+NONBLOCK
- nonblock recvfrom
- ace nonblock
- popen()
- popen()
- popen()
- popen
- popen
- popen
- popen
- popen()
- 用readlink, popen和fread判断当前进程是否为daemon
- fread
- fread
- fread
- atmega1280上的dht11温湿度传感器
- NFS挂载嵌入式Linux根文件系统
- eployee.aspx.cs文件的完整代码
- Visual Studio 快捷键
- 短信PDU模式解码
- fread popen hangs up NONBLOCK
- winform生命周期(备忘)
- Windows服务创建、安装、卸载、重启
- [CTO俱乐部第38期]解析移动云计算 迎接技术大变迁
- 一年半多的工作总结,留个脚印
- 【java】垃圾回收机制
- ry teach
- ExtJs之Ext.data.Store
- struts.xml修改后不用再次重启tomcat