Subject: Re: Signedness/Size consistency ?
To: None <tech-kern@netbsd.org>
From: Joerg Sonnenberger <joerg@britannica.bec.de>
List: tech-kern
Date: 07/15/2007 00:21:52
On Fri, Jul 13, 2007 at 01:33:35AM +0000, Arnaud Lacombe wrote:
> Still about firmload(9), it is normal to have firmware_get_size() returning an
> `off_t' argument, which is then passed to firmware_read() casted to `size_t'. 
> Then firmware_read() calls vn_rdwr() where `len' is an `int' to be finaly used
> to set the `iov_len' and `uio_resid' fields of `struct iovec' which are ... 
> `size_t'.

Changing of off_t to size_t is bogus, the former is signed. For file
size, off_t is also the natural argument. How do you want to
handle/detect that a 4GB file is copied to the firmware directory
otherwise? I don't know who else uses vn_rdwr, there might be surprises
lurking in as well.

Joerg