[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: io_read() semantics
From: |
Marcus Brinkmann |
Subject: |
Re: io_read() semantics |
Date: |
Tue, 11 Jun 2002 19:05:44 +0200 |
User-agent: |
Mutt/1.3.28i |
On Tue, Jun 11, 2002 at 03:19:32PM +0200, Ludovic Courtès wrote:
> 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);
Deallocation is always the job of the caller. If MiG allocates buffers for
us, and we allocate new ones, mig needs to deallocate the buffers it
allocated.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org brinkmd@debian.org
Marcus Brinkmann GNU http://www.gnu.org marcus@gnu.org
Marcus.Brinkmann@ruhr-uni-bochum.de
http://www.marcus-brinkmann.de