[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: io_read() semantics
From: |
Ludovic Courtès |
Subject: |
Re: io_read() semantics |
Date: |
Tue, 11 Jun 2002 15:19:32 +0200 |
User-agent: |
Mutt/1.2.5.1i |
On Mon, Jun 10, 2002 at 05:47:35PM -0700, Thomas Bushnell, BSG wrote:
> Marcus Brinkmann <Marcus.Brinkmann@ruhr-uni-bochum.de> writes:
>
> > 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.
>
> None of this is really the server's doing; most of it is MiG.
But diskfs/io-read.c does contain a call to mmap(), so is it just some kind of
`sanity check'? If MiG allocates a new buffer, how can we deallocated it: can
we munmap() it assuming that the buffer size is the one returned in the `len'
argument of io_read()? E.g.:
err = io_read (file, (data_t*)&data, len, offset, size);
munmap (data, *len);
Thanks,
Ludovic.