commit 4ee4902d9038772b174405b2b3824acdb7b2a534
Author: glenda <glenda@9front.local>
Date: Wed, 3 Mar 2021 22:33:25 +0000
init
Diffstat:
A | fs.c | | | 58 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | mkfile | | | 7 | +++++++ |
2 files changed, 65 insertions(+), 0 deletions(-)
diff --git a/fs.c b/fs.c
@@ -0,0 +1,58 @@
+#include <u.h>
+#include <libc.h>
+#include <fcall.h>
+#include <thread.h>
+#include <9p.h>
+
+void
+fsread(Req *r)
+{
+
+ respond(r, nil);
+}
+
+void
+fswrite(Req *r)
+{
+ respond(r, nil);
+}
+
+void
+usage(void)
+{
+ fprint(2, "usage: %s [-D][-m /mnt/octree][-s service]\n", argv0);
+ exits("usage");
+}
+
+void
+main (int argc, char **argv)
+{
+ char *srv, *mtpt;
+ srv = nil;
+ mtpt = "/mnt/octree";
+
+ ARGBEGIN {
+ case 'm':
+ mtpt = EARGF(usage());
+ break;
+ case 's':
+ srv = EARGF(usage());
+ break;
+ case 'D':
+ chatty9p++;
+ break;
+ default:
+ usage();
+ }ARGEND
+ if (argc > 0) usage();
+ Srv fs = {
+ .tree = alloctree("octree", "octree", 0777|DMDIR, nil),
+ .read = fsread,
+ .write = fswrite,
+ };
+ File *Fdata;
+ File *Fstream;
+ Fdata = createfile(fs.tree->root, "data", "octree", 0666, nil);
+ Fstream = createfile(fs.tree->root, "stream", "octree", 0666, nil);
+ postmountsrv(&fs, srv, mtpt, MREPL);
+}
diff --git a/mkfile b/mkfile
@@ -0,0 +1,7 @@
+</$objtype/mkfile
+
+TARG=fs
+OFILES=
+BIN=/$objtype/bin/octree
+
+</sys/src/cmd/mkmany