svn commit: r306622 - head/usr.bin/mkimg

Marcel Moolenaar marcel at xcllnt.net
Mon Oct 3 16:25:58 UTC 2016




On October 2, 2016 at 11:52:33 PM, Warner Losh (imp at 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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Message signed with OpenPGP using AMPGpg
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20161003/7caa2696/attachment.sig>


More information about the svn-src-head mailing list