shithub: svcfs

Download patch

ref: 4b696a10337b7d64bf6b59a3562e7df570848158
parent: d4316577b40cad5873f842f0499b4b88308687ed
author: Michael Misch <michaelmisch1985@gmail.com>
date: Fri Jan 16 21:23:21 EST 2026

Add in some README

--- /dev/null
+++ b/README
@@ -1,0 +1,15 @@
+svc/fs
+
+This mounts a directory at (default) `/mnt/svc`
+ - -m <mntpnt> 
+ - -s <srvname> will post to /srv/srvname
+
+`/mnt/svc` initially has a file, `clone`.
+Opening `clone` will create a numerical directory starting at `/mnt/svc/0`.
+The first write must be the name of the service. This will post a file to /srv/<service> that clients can mount into there namespace for a session with a given service
+
+Ctl messages on /mnt/svc/n/ctl
+(Note, newlines are important!)
+- `create <buffername>`: This will create a buffer. This must be called before any of the following
+- `title <buffername>\ntitle text`: This will set the title of a given buffer
+- `feed <buffername>\nsome text`: This will be appended to a given buffers' feed file
\ No newline at end of file
--- a/fs.c
+++ b/fs.c
@@ -50,6 +50,7 @@
 void
 threadmain(int argc, char *argv[])
 {
+	char *svcfile;
 	fmtinstall('N', Tconv);
 	fmtinstall('!', Nconv);
 	fmtinstall('C', Cconv);
@@ -56,6 +57,7 @@
 	user = getuser();
 	mtpt = "/mnt/svc";
 	logdir = "/tmp/svc";
+	svcfile = nil;
 
 	ARGBEGIN {
 	case 'D': 
@@ -70,6 +72,9 @@
 	case 'd':
 		debug++;
 		break;
+	case 's':
+		svcfile = EARGF(usage());
+		break;
 	default:
 		usage();
 	} ARGEND;
@@ -77,6 +82,6 @@
 	argv0 = "alt/fs";
 
 	create(logdir, OREAD, DMDIR | 0755);
-	threadpostmountsrv(&svcfs, nil, mtpt, MCREATE);
+	threadpostmountsrv(&svcfs, svcfile, mtpt, MCREATE);
 	exits(nil);
 }
--