Ummm.... I see where you're opening your file handle, but I don't see that you use it anywhere, unless I'm missing something.
I'm no C expert, but I believe that *only* your "fd" file descriptor will have the non-blocking option set.
Also, do you happen to have the "Reduced device drivers" box checked on the system library project associated with this code?
If so, the following comment from the uart device driver could be exactly what you're seeing:
* This implementation polls the device waiting for characters. At most it can
* only return one character, regardless of how many are requested. If the
* device is being accessed in non-blocking mode then it is possible for this
* function to return without reading any characters. In this case errno is
* set to EWOULDBLOCK.
*/
FYI: You can find the source code for this driver in the Nios II Device Drivers project from within the IDE...
Nios II Device Drivers/altera_avalon_uart/HAL/src/altera_avalon_uart.c
Cheers,
- slacker