我正在尝试打开一个在open命令之前创建的文件。但它在open()命令行挂起。你有什么想法吗?
if(mkfifo("test", S_IRWXU | S_IRWXG | S_IRWXO))
{
printf("File creation error.\n");
return 0;
}
// Hangs below
while (((test_fd = open("test", O_RDONLY)) == -1) && (errno == EINTR));发布于 2011-04-30 00:39:33
来自mkfifo的手册页:
Opening a FIFO for reading normally blocks until some other process opens the same FIFO for writing, and vice versa.
See fifo(7) for nonblocking handling of FIFO special files.https://stackoverflow.com/questions/5834768
复制相似问题