Date: Mon, 3 Oct 2016 09:25:44 -0700 From: Marcel Moolenaar <marcel@xcllnt.net> To: Warner Losh <imp@bsdimp.com>, Ed Schouten <ed@nuxi.nl> Cc: "=?utf-8?Q?svn-src-all=40freebsd.org?=" <svn-src-all@freebsd.org>, src-committers <src-committers@freebsd.org>, "=?utf-8?Q?svn-src-head=40freebsd.org?=" <svn-src-head@freebsd.org>, Marcel Moolenaar <marcel@freebsd.org> Subject: Re: svn commit: r306622 - head/usr.bin/mkimg Message-ID: <etPan.57f28688.c7c4144.6f1a@xcllnt.net> In-Reply-To: <CANCZdfqc=eMENhs3hiMKCmvebnKmqnUpYGxwVLqhJY67Svksxg@mail.gmail.com> References: <201610030400.u9340UM1012582@repo.freebsd.org> <CABh_MKnPUzdFc6Q7bwGc%2BpA5GCqKS0evDGs_7AG10-YddE2Wtw@mail.gmail.com> <CANCZdfqc=eMENhs3hiMKCmvebnKmqnUpYGxwVLqhJY67Svksxg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On October 2, 2016 at 11:52:33 PM, Warner Losh (imp@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 #2 --] -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJX8oaJAAoJEIda8t8f0tjj3gEP/il69UBVq4pDb+CUupE9xULa GYcK+h/4OVhX3iTmPTwNCooU55hlf2YOoy9AszVTXRN6VCEVzGdVLxuzvOuaUTW9 RxjrvcQqSR7tFxtoshfJda0O+Vsa1vv6Q0HWJKldmxD5BQ0ziKETy++7RFXggcLW OrkN+h1sbOGje/xSu/4ysDN1GKu8mjR+7ZMZPgnDE/mfYovFQbTMdccc34RW5jql y/74pc9pYllO3ZW1xviRMlI4ONJposqkHxQOOVhilvnzund3lVdX0qvSUDE58zFJ Mt7QBjLC44i6YjS4lxKPBFCzrQmWddI/sDAQB508p39KW9oFtB5+giJroHloViKu M4ISFh4fd6hjr4cAdRDXT+djQFsulnugCr+IUZOLNNFy8BZLEjhkd5Q/0EgyUlyG IONCycnHaFOWaJ4dg7ulSG9ElJmiEBGAkj3d8JRp3azdN0ks3zeUTVnS7zHjiZTw qWOACjt3i5Nrxp1UMLdnaSFXzBi+EdLrICsSe8gtEh2vREJs8CQD6XiHkmKfVO9J utFj2LZTmvIQf/w2u3xqIGZ6iTpWgVW5cZiG2xYoWABhNdJCt7IGkWM04SGPzDIQ uum/l9qFISpTJdijpruFmHFU0bP8LBFSk3A+uTcyfFzASRVCfH/OBBZvzFmyjROg fJHjKTpYdzz6CavPA49N -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?etPan.57f28688.c7c4144.6f1a>
