Read() not returning after /dev/uioX is closed

Hi,

I am rewriting a lot of the PRU app loader in go. Anyways, to wait for an interrupt one must read from /dev/uioX. I basically have a background thread that is always reading from it, but unfortunately, when I close the file, the read does not return.

With normal files, read would return when an FD is closed. (in fact, I tried my code with other files and it worked just fine).

Perhaps there’s something I missed with the UIO docs or maybe its a kernel bug?

Here’s a test case that demonstrates it:

https://gist.github.com/mikelikespie/10945232

Thanks,
Mike