简体   繁体   中英

poll() and read() “resource temporarily unavailable”

I have a problem about read() with "resource temporarily unavailable". I'm using PIPE as a IPC between threads.

In my program, reading thread checks if PIPE has a data using poll() , and then read() from PIPE. But, sometimes read() returns -1 with following error.

resource temporarily unavailable

I have no idea why read() return error after poll() check.

您可能已将管道fd设置为非阻塞模式O_NONBLOCK,并且在空文件上进行读取时,它将返回EAGAIN。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM