aboutsummaryrefslogtreecommitdiff
path: root/hexedit/slowcat.c
diff options
context:
space:
mode:
authorJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-07-12 23:40:38 -0500
committerJacques Comeaux <jacquesrcomeaux@protonmail.com>2024-07-12 23:40:38 -0500
commitd6ff9f5bda85206d163f02f7cc78e47968c434ce (patch)
treeaf3e8a4a6c8229e28f7f7c48da06276073e63d98 /hexedit/slowcat.c
parent17d59ac15b87588de2228aa768e99b5bbca4561c (diff)
Fix automated serial input
Diffstat (limited to 'hexedit/slowcat.c')
-rw-r--r--hexedit/slowcat.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hexedit/slowcat.c b/hexedit/slowcat.c
new file mode 100644
index 0000000..67725d4
--- /dev/null
+++ b/hexedit/slowcat.c
@@ -0,0 +1,11 @@
+#include <unistd.h>
+#include <stdint.h>
+
+int main() {
+ uint8_t byte;
+ while (read(STDIN_FILENO, &byte, 1)) {
+ write(STDOUT_FILENO, &byte, 1);
+ usleep(10000);
+ }
+ return 0;
+}