9fans archive / 2000 / 07 / 95 /    prev next

From: "Douglas A. Gwyn" <gwyn@arl...>
Subject: Re: [9fans] Re: fd2path
Date: Thu, 6 Jul 2000 15:11:00 GMT

Boyd Roberts wrote:
> Douglas A. Gwyn wrote:
> > Boyd Roberts wrote:
> > > In the last case you could loop on calling malloc until
> > > you got the whole thing.
> > Um, you really think that is a good design?
> yeah doug, whatcha gonna do when yer char buf[1024]; just ain't
> big enough, huh?  upgrade to 5.n BSD?

I didn't say anything about char buf[1024].

Russ suggests that the intended change to the interface would
result not just in an indication that the buffer was too small,
but rather in an exact measure of how much too small, so that
looping would not be required (unless perhaps the path was
changing underfoot?).

Of course, the right way in an ideal environment would be for
the service call to return (a handle to, or a capability for)
an object that is already constructed, so your program doesn't
have to help construct it by supplying a buffer etc., but that
isn't built into the Plan9 architecture.