summaryrefslogtreecommitdiff
path: root/fw/fe310/bsp/gloss/sys_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'fw/fe310/bsp/gloss/sys_read.c')
-rw-r--r--fw/fe310/bsp/gloss/sys_read.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fw/fe310/bsp/gloss/sys_read.c b/fw/fe310/bsp/gloss/sys_read.c
index 1857fc6..cc14f2a 100644
--- a/fw/fe310/bsp/gloss/sys_read.c
+++ b/fw/fe310/bsp/gloss/sys_read.c
@@ -4,11 +4,13 @@
#include "platform.h"
+#include "soc/uart.h"
+
/* Read from a file. */
ssize_t
_read(int fd, void *ptr, size_t len)
{
- if (fd != STDIN_FILENO) {
+ if ((fd != STDIN_FILENO) || !eos_uart_enabled()) {
errno = ENOSYS;
return -1;
}