From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <1575ef9ac681cb48018b7328ee52e953@quanstro.net> To: 9fans@9fans.net From: erik quanstrom Date: Wed, 19 Nov 2008 20:41:30 -0500 In-Reply-To: <1227145040.19266.383.camel@goose.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] fd2path and devsrv Topicbox-Message-UUID: 4a3e58ec-ead4-11e9-9d60-3106f5b1d025 > Ok, I can understand why devproc.c does it: it is easy to discover the > name of the actual Chan if you know the node in /srv: > fd = open("#s/stuff", OREAD); > fd2chan(fd, buf, sizeof(buf)); > close(fd); > but not the other way around. Buit why ns(1) doesn't have the above > code? i assume that you mean fd2path. as in minooka; cat fd2path.c #include #include void main(void) { char buf[1024]; int fd; fd = open ("#s/boot", OREAD); if(fd != -1 && fd2path(fd, buf, sizeof buf) != -1) fprint(2, "%s\n", buf); close(fd); exits(""); } minooka; fd2path /net/il/0/data i think the answer to your question is that it's a lot more useful to know that it's #s/boot rather than /net/il/0/data. generally one cares more about what it does than the particulars of the connection. the fact that #s/boot is the 0th il connection and not the nth wouldn't matter much unless you were debugging the ip stack. or is there some reason why this is interesting that i'm missing? - erik