summaryrefslogtreecommitdiff
path: root/cmd/srv9p/main.c
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-09-26 19:36:54 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-09-26 19:36:54 -0600
commit71e1a86a033c380f85dd300d788af63bfef25bab (patch)
tree07aa53d5a933ba51535a78972edbfe0cd95a31c5 /cmd/srv9p/main.c
parentf5da707e77ee954b12f3c961012e4f40fa4e1bd3 (diff)
wip reorg
Diffstat (limited to 'cmd/srv9p/main.c')
-rw-r--r--cmd/srv9p/main.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/cmd/srv9p/main.c b/cmd/srv9p/main.c
new file mode 100644
index 0000000..822a9ea
--- /dev/null
+++ b/cmd/srv9p/main.c
@@ -0,0 +1,18 @@
+#include <error.h>
+#include <stdio.h>
+
+#include "coroutine.h"
+#include "net9p.h"
+
+int main() {
+ int sock = netio_listen(9000);
+ if (sock < 0)
+ error(1, -sock, "netio_listen");
+
+ for (int i = 0; i < 8; i++)
+ if (!coroutine_add(net9p_cr, &sock))
+ error(1, 0, "coroutine_add(net9p_cr, NULL)");
+
+ coroutine_main();
+ return 1;
+}