file-directory? & friends not 64-bit safe
Bug #295833 reported by
Andreas Rottmann
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ikarus Scheme |
Fix Committed
|
Low
|
Abdulaziz Ghuloum |
Bug Description
You can reproduce the bug like this (on a 32-bit system):
% dd if=/dev/zero of=$HOME/big-file count=1 bs=1 seek=5G # make sure $HOME is big enough
% cat test.sps
(import (ikarus))
(display (file-directory? (cadr (command-line))))
(newline)
% ikarus --r6rs-script test.sps ~/big-file
Unhandled exception:
Condition components:
1. &error
2. &who: file-directory?
3. &message: "EOVERFLOW: Value too large for defined data type"
4. &i/o-filename: "/home/
Related branches
Changed in ikarus: | |
milestone: | none → 0.0.4 |
To post a comment you must log in.
>From http:// www.suse. de/~aj/ linux_lfs. html :
[Note the part about using getconf for portability.]
In a nutshell for using LFS you can choose either of the following:
* Compile your programs with "gcc -D_FILE_ OFFSET_ BITS=64" . This
-D_FILE_ OFFSET_ BITS=64 on Linux platforms but might return SOURCE. With these
forces all file access calls to use the 64 bit variants. Several
types change also, e.g. off_t becomes off64_t. It's therefore
important to always use the correct types and to not use e.g.
int instead of off_t. For portability with other platforms you
should use getconf LFS_CFLAGS which will return
something else on e.g. Solaris. For linking, you should use the
link flags that are reported via getconf LFS_LDFLAGS. On Linux
systems, you do not need special link flags.
* Define _LARGEFILE_SOURCE and _LARGEFILE64_
defines you can use the LFS functions like open64 directly.
* Use the O_LARGEFILE flag with open to operate on large files.
A complete documentation of the feature test macros like
_FILE_OFFSET_BITS and _LARGEFILE_SOURCE is in the glibc manual (run e.g.
"info libc 'Feature Test Macros'").