On October 2, 2016 at 11:52:33 PM, Warner Losh (i...@bsdimp.com) wrote:

Wouldn't it be better to say at the top 

#ifndef OFF_MAX 
#define OFF_MAX INT64_MAX 
#endif 
Not sure. The max is just for input checking. We do not even try to deal with 
an lseek(2) implementation that doesn’t take a 64-bit offset argument. Granted, 
the use of OFF_MAX before was based on FreeBSD’s lseek(2) implementation and 
was chosen to match it, knowing very well that it has a 64-bit offset argument. 
If lseek(2) doesn’t take a 64-bit offset then mkimg(1) fails for images larger 
than 2GB, but the problems with that run deeper than the max capacity that a 
user can specify on the mkimg command line. Not using OFF_MAX is a clear 
indication that the limit is not fully determined by lseek(2), but to a greater 
extend by the datatype used to hold the capacity.

Hence by preference for going with INT64_MAX. Easy to change if people feel I 
should keep using OFF_MAX.


Attachment: signature.asc
Description: Message signed with OpenPGP using AMPGpg

Reply via email to