From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Fri, 12 Nov 2010 15:23:40 -0500 To: 9fans@9fans.net Message-ID: In-Reply-To: References: <75ea74312ad96f76de8cd4b3291ffb1d@brasstown.quanstro.net> <1e4bfd86eef85bbf4434f8ef22b6fed7@plug.quanstro.net> <948e9cbd967366d058ac8a033ce93f5f@plug.quanstro.net> <53acf6ebfa4f01bbe09d6ed494ef68b1@plug.quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] p9p factotum available for plan 9 Topicbox-Message-UUID: 7b147332-ead6-11e9-9d60-3106f5b1d025 > And, finally, errno and errstr. Plan 9 speaks strings, Unix integers, > Windows strings IIRC. The solution for unix clients was reverse > mapping of errstr to errno, which has not worked well for me. I'd > still prefer the format I used before: > sprint(rmsg.error, "%d:%s", errno, errstr); > and let the client figure out which of these two things it wants. > Obviously useless for Plan 9 servers but very useful for *nix > clients/servers, which only want to talk errno. Even if the Plan 9 > client sees an errstr in the number:message format, that could be > helpful to users. since plan 9 assumes that strings are null-terminated but 9p has explicit rle, one could send uids/errorno after the 0, but before the rle says the string is done. sleezy, and hackish, but it should work. also, one can always support many extensions by doing the following (a) extensions are [a-zA-Z] (b) all extensions start with "." then you can check for the existence of an extension with if(strstr(version, ".myextension") != nil) extensions |= Myextension; and P92000.l.op.xyz.pdq will be legal. - erik