添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
int fd_pipe = open("/run/some/pipe", O_RDWR);
// here i need to set timeout for 3 seconds somehow, if can't write, code will continue...
write(fd_pipe, something, strlen(something));
// continue executing..
thanks Also here -> https://cboard.cprogramming.com/c-programming/178802-timeout-write-linux-pipe.html
Also, http://www.catb.org/esr/faqs/smart-questions.html#forum That isn't what you asked for. You asked for a write timeout.
That code waits for the socket to be writeable before attempting the write. But some OS' (like BSD) are always ready to write.
That write is a blocking write, and you have your write timeout problem all over again.
Have you considered trying to implement what I suggested? I'm not going to write the code for you. Last edited on