Similar to the problem asked a while ago on kernel 3.x, but I’m seeing it on 4.9.37. The named fifo is created with mkfifo -m 0666. On the read side it is opened with The resulting fd is passed into a call to select(). Everything works ok, till I run echo >> <fifo-name>. Now the fd appears in the read_fds
Tag: nonblocking
How to read a [nonblocking] filedescriptor of a file that is appended to (aka, like tail -f)?
Actually, I am using libev; but under the hood this is using epoll (I’m only on linux). When I add a watcher to read a file and all data has been read then I do get a call back that there is data to read, but read(2) returns 0 (EOF). At that point I have to stop the watcher or
Sending to a Datagram socket, without blocking indefinitely
We have some code to send metrics to a SOCK_DGRAM where another daemon listens and aggregates/proxies these messages. Opening the socket looks like: And at the moment we write to it like: I want to ensure the call above doesn’t block for very long (or at the very least doesn’t block indefinitely), but my understanding of unix sockets is not
C non-blocking keyboard input
I’m trying to write a program in C (on Linux) that loops until the user presses a key, but shouldn’t require a keypress to continue each loop. Is there a simple way to do this? I figure I could possibly do it with select() but that seems like a lot of work. Alternatively, is there a way to catch a