On Mon, 22 Sep 2003, Hrvoje Niksic wrote: > > I doubt any system that does not support off_t does support LFS. > > As I mentioned in the first message, LFS is not the only thing you > need large values for. Think download quota or the sum of downloaded > bytes. You should be able to specify `--quota=10G' on systems without > LFS.
Agreed. > As for the hassle, remember that Wget caters to systems with much less > features than LFS on a regular basis. For example, we suppose > pre-ANSI C compilers, libc's without snprintf, strptime or, for that > matter, basic C89 functions like memcpy or strstr. So yes, I'd say > pre-LFS systems are worth the hassle. Well, as always with good software we should assume a standard environment to be the guideline on how to write code and then add specific arrangements to deal with various shortcomings of non-standard or simply old systems. Autoconf has capabilities for aiding in implementing such a setup and the shortcomings are typically handled if there's a demand only. > Perhaps a good compromise would be to use off_t for variables whose > 64-bitness doesn't matter without LFS, and a `large_number_t' typedef > that points to either `double' or `long long' for others. Since the > others are quite rare, printing them won't be a problem in practice, > just like it's not for VERY_LONG_TYPE right now. off_t *must* be used for file offsets, sizes, etc. of you want to be sane. For other uses, I suppose an autoconf test can be written to find the largest available type. > > And even if it does, it's probably not worth the hassle. To handle > > ordinary old systems, you just call: > > > > AC_CHECK_TYPE(off_t, long) > > > > before calling AC_SYS_LARGEFILE. > > That still doesn't explain how to print off_t on systems that don't > natively support it. (Or that do, for that matter.) Sure, that's a completely independent problem. While discovering the proper format specifier is doable, gettextization makes its use tough. Maciej -- + Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: [EMAIL PROTECTED], PGP key available +
