Subject: [ecasound] largefile episode 3
From: Kai Vehmanen (kai.vehmanen_AT_wakkanet.fi)
Date: Wed Dec 05 2001 - 02:32:26 EET
Ok, I've commited another set of largefile changes to CVS.
The first implementation (few days ago) used only fsetpos() and fgetpos(),
but when it turned out that we can't use fpos_t as a scalar type
(triggered by glibc2.2), this approach had to be dropped.
Today I reimplemented the 64bit get/set position code using the
fseeko()/ftello() routines, which are part of the single unix standard,
although not part of C/C++. But as it turned out, the damn functions don't
work at all, at least with my glibc2.1. I made a few +2GB files, and
fseeko/ftello just worked wrong. This might be a glib2.1 problem, or glibc
compile problem (compiled against too old kernel headers or something).
Anyway, time for today's second reimplementation. The current CVS-tree
doesn't use any of the fsetpos/fgetpos/fseeko/ftello/ftell functions, just
the C/C++ standard fseek() function.
Instead of asking the system about file position, we now maintain the
current position ourselves, so no need for fgetpos/ftello/fell.
Seeking on the other hand is implemented by first going to the beginning
of file, and then doing 32bit relative seeks until we reach the wanted new
file position. Crude, but seems to work fine and only relies on the old
C/C++ standards. This mechanism is only used if --with-largefile is
As as for other reported problems:
- 'off_t' is no longer defined anywhere in ecasound sources; now
we just require 'sys/types.h'; if you don't have it, you are not
running a POSIX system, and you wouldn't be able to compile
ecasound anyway :)
- the 'next_riff_block' problem is fixed
So back to testing, once again.
-- http://www.eca.cx Audio software for Linux!
-- To unsubscribe send message 'unsubscribe' in the body of the message to <ecasound-list-request_AT_wakkanet.fi>.
This archive was generated by hypermail 2b28 : Wed Dec 05 2001 - 02:25:03 EET