ref: ed9d4c8df8a8272b191b6ed0fa53457302752b4f
author: mkf <mkf>
date: Tue Apr 4 18:13:07 EDT 2023
import
--- /dev/null
+++ b/macfs.c
@@ -1,0 +1,32 @@
+#include <u.h>
+#include <libc.h>
+#include <fcall.h>
+#include <thread.h>
+#include <9p.h>
+#include <stdio.h>
+#include <libsec.h>
+
+void
+fsread(Req *r)
+{
+ char addr[13];
+ for( int i = 0; i < 12 ; i++)
+ sprintf(&addr[i], "%x", ntruerand(16));
+ readstr(r, addr);
+ respond(r, nil);
+}
+
+Srv fs = {
+ .read = fsread,
+};
+
+void
+main(void)
+{
+ Tree *tree;
+
+ tree = alloctree(nil, nil, DMDIR|0555, nil);
+ fs.tree = tree;
+ createfile(tree->root, "addr", nil, 0555, nil);
+ postmountsrv(&fs, nil, "/mnt/macfs", MREPL | MCREATE);
+}