summaryrefslogtreecommitdiff
path: root/static/inferno/man2/styxconv.2
diff options
context:
space:
mode:
authorJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
committerJacob McDonnell <jacob@jacobmcdonnell.com>2026-04-26 16:38:00 -0400
commit97d5c458cfa039d857301e1ca7d5af3beb37131d (patch)
treeb460cd850d0537eb71806ba30358840377b27688 /static/inferno/man2/styxconv.2
parentb89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff)
build: Better Build System
Diffstat (limited to 'static/inferno/man2/styxconv.2')
-rw-r--r--static/inferno/man2/styxconv.278
1 files changed, 78 insertions, 0 deletions
diff --git a/static/inferno/man2/styxconv.2 b/static/inferno/man2/styxconv.2
new file mode 100644
index 00000000..296c6abb
--- /dev/null
+++ b/static/inferno/man2/styxconv.2
@@ -0,0 +1,78 @@
+.TH STYXCONV 2
+.SH NAME
+styxconv \- convert between old 1995 Styx and current Styx (9P)
+.SH SYNOPSIS
+.EX
+include "styxconv.m";
+styxconv := load Styxconv Styxconv->PATHNEW2OLD;
+styxconv := load Styxconv Styxconv->PATHOLD2NEW;
+
+init: fn();
+styxconv: fn(client: ref Sys->FD, server: ref Sys->FD);
+.EE
+.SH DESCRIPTION
+.B Styxconv
+converts between the obsolete 1995 version of the Styx protocol,
+as used for instance in Inferno's Third Edition and earlier,
+and the current file service protocol,
+previously also called `Styx' but
+based on 9P2000 and defined by
+.IR intro (5).
+.PP
+.B Init
+must be called before any other function in the module.
+.PP
+The function
+.B styxconv
+takes two file descriptors:
+.I client
+should be a connection to a client requiring
+one version of the protocol;
+.I server
+should be a connection to a server serving
+the other version of the protocol.
+There are two conversion modules:
+.B PATHNEW2OLD
+converts from a new client to an old server;
+.B PATHOLD2NEW
+converts from an old client to a new server.
+.PP
+.B Styxconv
+should be spawned by the caller, and copies messages between
+.I client
+and
+.IR server ,
+converting as required.
+See the example below.
+.SH EXAMPLE
+Apply
+.B styxconv
+to file descriptor
+.IR fd ,
+connected to an old Styx server, and return
+a file descriptor suitable for mounting with
+.IR mount (2).
+.IP
+.EX
+cvstyx(fd: ref Sys->FD): ref Sys->FD
+{
+ styxconv := load Styxconv Styxconv->NEW2OLDPATH;
+ if(styxconv == nil)
+ return nil;
+ p := array[2] of ref Sys->FD;
+ if(sys->pipe(p) < 0)
+ return nil;
+ styxconv->init();
+ spawn styxconv->styxconv(p[1], fd);
+ return p[0];
+}
+.EE
+.SH SOURCE
+.B /appl/lib/styxconv
+.SH SEE ALSO
+.IR bind (1),
+.IR sys-bind (2),
+.IR sys-pipe (2),
+.IR intro (5)
+.SH BUGS
+There is no provision for 9P2000 authentication.