I've been working on something that uses a FIFO buffer to communicate between two processes (a cgi script served by uhttpd, and a python script that's communicating with the ATmega in place of the bridge) and am running into a problem where the open system call on the FIFO completely hangs (i.e. never returns).
Here's an easy way to repro with python--under the covers python is just calling the same system functions:
import os
os.mkfifo('/tmp/foo.fifo')
# File /tmp/foo.fifo is successfully created
fd = os.open('/tmp/foo.fifo', os.O_RDONLY)
# Execution hangs at the call above!
# Also attempting python's open call with open('/tmp/foo.fifo', 'r') also fails (to be expected since it's just calling the OS's open call
Also you will notice the '/tmp/foo.fifo' is successfully created, but if you try to write to it with a command like:
echo 'foo' > /tmp/foo.fifo
You will also get a lockup and the echo command never returns.
Anyone have any ideas why this might lock up? The same code works fine on my Ubuntu machine. Does OpenWRT not support FIFOs? I googled around and couldn't find any good info or bug reports unfortunately.
As a workaround I'll look at using unix sockets for intraprocess communication--the code is a little more complex, but hopefully it works on OpenWRT.