printer / text mode version old non-off_t code

index
-summary
-history
-testscript
  perl / python
problems
-with callframes
-with structures
-largefile seeks
-broken builds
systems
-freeBSD/darwin
-linux/solaris
-64on32 mix
-distro makers
-win32/other (2)
libraries
-libc ..(3264)
-zlib ..(-32-)
-gtk2 ..(-64-)
converting
-old non-off_t code
-going largefile
-longlong default
-face dualmode
-make twinlibs
-and defend (it)
programming
-largefile default
-off_t in headers
-make export64
-find mismatch
-the autowrappers
-environ changes
-best practice?
old library
-dualmode renames
-the extra function
-largefile64_source
-glibc headers
-libgz example ***
new library
-dual export
-largefiles win32
-compat32 calls
-compat32 library
-long32 dualmode
links
-some quotes
-sitemap / mpl
-large.file Group*
-ac-archive Site*

 

 

 

(C) 2003-12-20 <guidod>
 Guido U. Draheim

Step 1: converting code not using off_t

In the first step you need to check your software if it still makes the assumption that "long" can hold a seek-value. That accounts to rather old software that is far away from being portable - they will break on a modern bsd-type system anyway. Also note that software with win32-origin make that assumption.

To work on it, include the ac-macros AC_TYPE_OFF_T and AC_FUNC_FSEEKO into your autoconf script. They will ensure to make the off_t typedef and fseeko functioncall visible. In systems without off_t typdefs (e.g. win32) and/or without autoconf usability you can simply #define to identity, i.e.

  #define off_t long
  #define fseeko fseek
  #define ftello ftell

With that basic configuration at hand you can start making your software portable - portable to platforms where 'off_t' is not a 32bit 'long' entity. You may want to get access to a freeBSD or darwin/MACosX system to test your software - an example would be the sourceforge compilefarm where you can get free ssh access. If that is uneasy to you then you can try with the 64on32 defines from the next section which offers a way to debug largefile problems locally on a linux/solaris system.

From experience, this step takes most of the time. Even modern linux/solaris software has lots of places where 32bit assumptions are made. And they most present themselves with call mismatches or late breakups on files > 2 GiB. When you are done with the portability step then you are ready for the next.