On Mon, Jun 10, 2002 at 02:45:15PM +0200, Ludovic Courtès wrote:
> I have a question about how io_read() should work, and I couldn't find the
> answer in io.def. From what I've seen in libdiskfs/io-read.c , a diskfs server
> is supposed to reallocate a new buffer if the provided buffer is smaller than
> the requested amount of data:

This is not a strict requirement.  A server can do any of the following:

1. Allocate a new, large enough buffer.
2. Just return fewer data.

and a server can even:

3. Return a new buffer although the old one was large enough.

> Therefore, I would not expect io_read() to provide a new buffer with the
> following code, since the buffer size if the same as the requested amount of
> data (*len == size):
> 
>     void* d = data;
> 
>     size = (size > *len)?(*len):size;
>     *len = size;
>     err  = io_read (mbox, (data_t*)&data, len, start + offset, size);
>     assert (data == d);       // this assertion should not fail!
> 
> However, the last assertion does sometimes fail.

Well, I would not expect it to fail with a canonical diskfs server.  It is
not a protocol violation, but if it "shouldn't happen" then it might be
worth to investigate why it happens anyway.

Thanks,
Marcus

-- 
`Rhubarb is no Egyptian god.' Debian http://www.debian.org [EMAIL PROTECTED]
Marcus Brinkmann              GNU    http://www.gnu.org    [EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.marcus-brinkmann.de

_______________________________________________
Help-hurd mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-hurd

Reply via email to