forsyth20121205-174063a80cc13 years agoHistory
78 lines · 1.7 KB · Text
RawDownload
.TH STYXCONV 2.SH NAMEstyxconv \- convert between old 1995 Styx and current Styx (9P).SH SYNOPSIS.EXinclude "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 Styxconvconverts 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' butbased on 9P2000 and defined by.IR intro (5)..PP.B Initmust be called before any other function in the module..PPThe function.B styxconvtakes two file descriptors:.I clientshould be a connection to a client requiringone version of the protocol;.I servershould be a connection to a server servingthe other version of the protocol.There are two conversion modules:.B PATHNEW2OLDconverts from a new client to an old server;.B PATHOLD2NEWconverts from an old client to a new server..PP.B Styxconvshould be spawned by the caller, and copies messages between.I clientand.IR server ,converting as required.See the example below..SH EXAMPLEApply.B styxconvto file descriptor.IR fd ,connected to an old Styx server, and returna file descriptor suitable for mounting with.IR mount (2)..IP.EXcvstyx(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 BUGSThere is no provision for 9P2000 authentication.