>> The specific concern is that (e.g.) the BIO seek and tell >> operations use long for parameters, which on some 64-bit systems is >> still 32 bits. >> >> They need to use size_t or a specific 64-bit type. > > No. size_t is wrong; it may be 32 bits on platforms where file offsets > can be 64 bits. > > Please, let's not reinvent the wheel! > > There is a type for this. It is off_t. It is crazy to not simply use it.
You've got to appreciate the irony. Even though "systems" are referred to as "some," we can as well stop pretending that we are not talking about Win64. And on Win64 off_t is ... 32 bits. But even in real POSIX environment off_t is not foolproof choice. Because on a range of 32-bit platforms its width depends on compile-time definitions such as _LARGEFILE_SOURCE and company. This means that if libcrypto is compiled with 64-bit off_t, then applications would have to be as well. Formally we can't expect they are. An option to arrange wide BIO_seekXXX could be to use 4th argument to BIO_ctrl and pass wide offset by reference. And given above limitations it probably would have to be explicit 64-bit type... Yes, it's insane, but what other choices are there? Recall Huxley? A. ______________________________________________________________________ OpenSSL Project http://www.openssl.org Development Mailing List [email protected] Automated List Manager [email protected]
