On 04-10-2010 21:10, Victor Duchovni wrote:
On Mon, Oct 04, 2010 at 10:37:55AM -0400, Jeff Saremi wrote:

  Does BIO support 64 bit IO (large files)? If so would the rest of
OpenSSL (such as the ssl itself) support those BIOs?
I configured the build with 64bit support and didn't see any noticeable
changes.
Specifically, I'd like to know if BIO_tell() is able to return a 64bit
value?

No, BIO_tell() is a macro:

     include/openssl/bio.h:
        #define BIO_tell(b)       (int)BIO_ctrl(b,BIO_C_FILE_TELL,0,NULL)

The (int) cast means that the result is never larger than INT_MAX.

If the library is compiled on a machine with 64-bit longs, then
the underlying BIO_ctrl() will return the value from lseek() or
ftell() cast to a (long). This does not imply that 64-bit files
will not break in some other way.


I would call this a bug!  There is no reason in portable code to
assume sizeof(int) == sizeof(long).

And thinking that 64 bit platforms always have 64 bit ints (or even 64 bit longs) is a wrong assumption too.

The rules that you can trust are:

sizeof(wchar_t) >= 16 bits

sizeof(short) >= 16 bits
sizeof(short) >= sizeof(char)
sizeof(int) >= 16 bits
sizeof(int) >= sizeof(short)
sizeof(long) >= 32 bits
sizeof(long) >= sizeof(int)
sizeof(platform longerinttype) >= sizeof(long)

sizeof(size_t) >=< sizeof(int)
sizeof(off_t)  >=< sizeof(long)

The "platform longerinttype", if it exists, may be named:

"long long" (GNU and some others)
"__int64"   (MS and some others)
"int64_t"   (some OS and compiler headers)
"Comp"      (Delphi/Turbo Pascal, using the floating point coprocessor)
Anything else compiler makers may think up!

Oh, and stdint.h is not available with all compilers!
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to