[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [PATCH 2/2] lib/vfscore: Add both the block and echo support



The block behaviour is needed by the python shell. Currently
uk_cink return 0 if no character is being inputted and python
uses fgets on stdin which causes the console to close
immediately. The echo behaviour is needed for feedback on the
typed input. Both features are guarded by defines (CONFIG_UK_
STDIN_BLOCKING and CONFIG_UK_STDIN_ECHO).

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
---
 lib/vfscore/stdio.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/vfscore/stdio.c b/lib/vfscore/stdio.c
index 6acbb32..ec61e3a 100644
--- a/lib/vfscore/stdio.c
+++ b/lib/vfscore/stdio.c
@@ -44,6 +44,14 @@ static ssize_t stdin_read(struct vfscore_file *vfscore_file 
__unused,
 
        read_count = ukplat_cink(buf, count);
 
+#ifdef CONFIG_UK_STDIN_BLOCKING
+       while (read_count <= 0)
+               read_count = ukplat_cink(buf, count);
+#endif
+
+#ifdef CONFIG_UK_STDIN_ECHO
+       stdout_write(vfscore_file, buf, read_count, 0);
+#endif
        return read_count;
 }
 
-- 
2.19.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.