Hi,

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:

  if (maxread > *datalen)
    {
      ourbuf = 1;
      buf = mmap (0, maxread, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);     
      *data = buf;
    }

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.

Any idea?

Thanks,
Ludovic.

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

Reply via email to