11 Jan 2003 guidod   » (Journeyer)

do not use off_t in headers - largefile sensitivity bugs!

Through a discussion on alt.os.linux.mandrake, I had to notice that every library has a risk of being broken when using the system off_t type in its exported interfaces, including structures and function synopsis.

The point comes from the fact that systems like linux and solaris are "largefile sensitive" - a -D_LARGEFILE_SOURCE will shift the "off_t" type from being a 32bit entity into a 64bit entity. This will make for a nice and pretty callframe mismatch.

A autoconf'ed lib 'centric treatment of the topic is given in:

Grepping a bit through files on my system, I did notice that even zlib/gzip is affected (and only by luck it is not triggered) and kdelib header files (in kio) has off_t as well. Bug reports were filed to the respective projects.

People should worry and learn about this problem area sooner than later

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!