summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/lib/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sandbox/lib/common.c')
-rw-r--r--arch/sandbox/lib/common.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/arch/sandbox/lib/common.c b/arch/sandbox/lib/common.c
index 0924c9bb9a..21ec720d7c 100644
--- a/arch/sandbox/lib/common.c
+++ b/arch/sandbox/lib/common.c
@@ -97,9 +97,7 @@ int linux_tstc(int fd)
/*
* We set the timeout here to 100us, because otherwise
* U-Boot would eat all cpu resources while waiting
- * for input. On the other hand this makes some
- * things like networking slow, because U-Boot will
- * poll this function very often.
+ * for input.
*/
ret = select(fd + 1, &rfds, NULL, NULL, &tv);
@@ -109,6 +107,15 @@ int linux_tstc(int fd)
return 0;
}
+int ctrlc(void)
+{
+ char chr;
+
+ if (linux_read_nonblock(0, &chr, 1) == 1 && chr == 3)
+ return 1;
+ return 0;
+}
+
int linux_getc(void)
{
char ret;