ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 3006] New: 32bit linux largefile support (>2GB) patch

Date: Tue, 28 Oct 2008 03:50:40 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3006

           Summary: 32bit linux largefile support (>2GB) patch
           Product: Wireshark
           Version: SVN
          Platform: PC
        OS/Version: Linux (other)
            Status: NEW
          Severity: Major
          Priority: Medium
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: storm.richard@xxxxxxxxx


Build Information:

--
Hello!

In last week I hardly delved into wireshark >2GB file support issue on 32-bit
linux's.
Attached diff, that should partly fix largefile support.

There is how it works:
 1) AC_SYS_LARGEFILE autoconf macro in case of 32-bit linux supporting
largefile, defines _FILE_OFFSET_BITS=64 in config.h and in (untested) case of
AIX autoconf also defines _LARGE_FILES.
 2) Ubuntu linux 32-bit zlib version has gz*64() functions for largefile
support, so we add _LARGEFILE64_SOURCE define, to make use of it.
 3) Defines are added to CFLAGS, because they must come before any includes,
however (f)lex puts its includes before original wireshark code. If anyone
knows a way for lex to respect config.h, then defines can be removed from
CFLAGS.
 4) There is workaround in file_wrappers.c for gzseek() on 32-bit non-Ubuntu
linux, since passing 8byte 'offset' value to 4byte 'offset' gzseek(), lowest
4bytes gets used as offset, but highest 4bytes as whence.


So the results are following:
 * 32-bit Ubuntu linux will fully support largefiles.
 * 32-bit non-Ubuntu linux will fail seek after 2GB, however tools like
mergecap (which seeks only few bytes when checking header) will work fine with
largefiles.


-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.