From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <6b1434ce54eef6452e6ae212a0faebe5@mightycheese.com> To: 9fans@cse.psu.edu Subject: Re: [9fans] fd2path(2) From: "rob pike, esq." In-Reply-To: <20030505160003.GA27502@wilbur.25thandClement.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Mon, 5 May 2003 09:18:55 -0700 Topicbox-Message-UUID: 9e2574da-eacb-11e9-9e20-41e7f4b1d025 > why not make the return value of fd2path() similar to SUSv3's snprintf()? > that is, return the length of the logical string. i've read a few archived > posts on this. one was to make the return value the remainder of the logical > length and the buffer length. another pointed out that inferno just returned > a malloc'd string on its own. Perhaps it's a better interface, making it like read. I don't remember thinking about it, which probably means I just gave it the default syscall return. I do remember thinking about the NUL on the end, which probably means I didn't think it was the same as read. On the other hand, a quick grep shows most program just use the string outright and strlen() is really cheap. I suspect that between the two of us we've spent more time talking about it than using strlen() on an fd2path call will require in our lifetimes. -rob