[LWN Logo]

To: lwn@eklektix.com
Subject: CORRECTION: glibc vs ext2fs-tools debate
From: ebiederm+eric@npwt.net (Eric W. Biederman)
Date: 19 Jun 1998 12:09:14 -0500


I was following the debate in early stages, until enough information
was avaiable to see what was happening.

Glibc2.0 implemented llseek but _never_ prototyped in a header file.
Ultrich Depper after deciding he should not have added it, explicitly
did not prototype it.  This was to discourage people from using this
function.  For glibc-2.1 it is planned to have a ``standard'' lseek64
function implemented.

ext2fs-tools uses autoconf and which quite reliably detects the
presence of llseek with a linkage test, in glibc2.0 despite the lack
of a prototype.  But llseek returns (long long) without a prototype
the return type defaults to (int).  This causes the return value of
llseek to be misinterpreted and causes ext2fs-tools to fail, with
large partitions.  

Recent ext2fs-tools also look for a prototype definition so if llseek
is not declared it can hopefully be declared correctly.

This exposes a number of problems.
a) Not including a prototype does not discourage people using autoconf
   to not use a function.
b) Autoconf provides little to no support to include the correct
   header files.
c) People confronted with a tricky problem tend not to listen to each
   other. :(

Note: Problems a & b seperately are inocous. Together they can cause
real turmoil.

Currently I would say the llseek problem is a glibc bug.  But it
appears to be an accidental one.

Just trying to set the record straight.

Eric