aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorOmar Rizwan <omar@omar.website>2020-12-31 18:47:24 -0800
committerOmar Rizwan <omar@omar.website>2020-12-31 18:47:24 -0800
commit8bff4e0857997c7cd64fdae1625c010a252c0873 (patch)
tree860f3680c5aef877d121a9185dfa2368cf0de3e7 /fs
parent08c280118e039c2bd72d87fd29873cd4f698c5f6 (diff)
delete vestigial test-native.c, improve md
Diffstat (limited to 'fs')
-rw-r--r--fs/test-native.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/fs/test-native.c b/fs/test-native.c
deleted file mode 100644
index c53df29..0000000
--- a/fs/test-native.c
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-
-int main() {
- FILE *log = fopen("log.txt", "w");
- fprintf(log, "hello\n"); fflush(log);
-
- for (;;) {
- char *outMsg = "{\"text\":\"This is a response message\"}";
- unsigned int outLen = strlen(outMsg);
- char *bOutLen = (char *)&outLen;
- write(1, bOutLen, 4); // 1 is stdout
- write(1, outMsg, outLen);
- fflush(stdout);
- fprintf(log, "wrote msg\n"); fflush(log);
-
- char bInLen[4];
- read(0, bInLen, 4); // 0 is stdin
- unsigned int inLen = *(unsigned int *)bInLen;
- char *inMsg = (char *)malloc(inLen);
- read(0, inMsg, inLen);
- inMsg[inLen] = '\0';
- fprintf(log, "msg: [%s]\n", inMsg); fflush(log);
- free(inMsg);
-
- }
- return 0;
-}