summaryrefslogtreecommitdiff
path: root/ports/posix/src
diff options
context:
space:
mode:
authorAditya Naik2020-08-03 14:42:06 -0400
committerAditya Naik2020-08-03 14:42:06 -0400
commit11a52e4e88bcad1e6bddcf02f78e1cc5eaaec508 (patch)
treed7f725c30e618994a0650607ede73ab3efc72c67 /ports/posix/src
parent81b3f3d5336eab67e8eb21bb4011e552f3895a4e (diff)
RTOS skeleton with (UNIX) POSIX calls. Reorg of stream files
Diffstat (limited to 'ports/posix/src')
-rw-r--r--ports/posix/src/stream_stdio.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/ports/posix/src/stream_stdio.c b/ports/posix/src/stream_stdio.c
new file mode 100644
index 0000000..efa4b13
--- /dev/null
+++ b/ports/posix/src/stream_stdio.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include "stream_stdio.h"
+#include "stream.h"
+
+int stdio_read(uint8_t* buf, size_t count, void **vptr, void *sptr)
+{
+ int x;
+ for (x = 0; x < count; x++) {
+ scanf("%c", &buf[x]);
+ }
+ return 0;
+}
+
+int stdio_write(uint8_t* buf, size_t count, void **vptr, void *sptr)
+{
+ printf("%s\n", buf);
+ return 0;
+}