Forum Discussion
Altera_Forum
Honored Contributor
21 years agoWhere is fcntl
alt_avalon_uart_read() and alt_avalon_uart_write() routines support a 'O_NONBLOCK' parameter. I'd like to control this flag from my code using the following function: static vo...
Altera_Forum
Honored Contributor
21 years agoUnfortunately the function fcntl() is not implemented by the Altera HAL. The Altera HAL is a minimal C runtime environment, and so doesn't support the complete POSIX spec. If you want to use functions like this you will need to use an environment that provides a more comprehensive POSIX implementation. For example both the ucLinux and eCos operating systems contain this function. Both of these are available for download through this forum.
If you want a single-threaded C runtime environment that includes POSIX file I/O then eCos can be configured in this way (i.e. without a scheduler). That may be an option to consider, depending on your memory budget. With the Altera HAL, you will need to set a file descriptor into non-blocking mode at open time.