Mail Archives: djgpp/2001/07/08/04:28:44
On Sat, 7 Jul 2001, David Witbrodt wrote:
> (gdb) p bf
> $1 = 4026531840
> (gdb) p fspec
> $2 = "c:/djgpp/programs/files/prog07/*.*", '\000' <repeats 225 times>
> (gdb) p fs
> $3 = {f_type = 0, f_bsize = 4096, f_blocks = 2044282, f_bfree =
> 983040,
> f_bavail = 983040, f_files = 2044282, f_ffree = 983040, f_fsid = {2,
> 0},
> f_magic = 72020}
>
> The discrepancy is here -- the statfs() "TEST" program reports 1 002
> 886 available blocks, while the call of statfs() in my program only
> yields 983040 available blocks. (Immediately exiting gdb and running
> the "TEST" program still yields 1 002 886 available blocks.)
What happens if you type this inside GDB:
(gdb) shell statfstest
What does statfstest report then?
> I should point out that I am compiling statfs() as a C++ function
That is almost definitely a bad idea (although I don't think it
explains the discrepancy). DJGPP library sources were not written to
be compiled as C++ code, so all kinds of irrelevant side effects might
materialize.
Why don't you compile statfs as C code?
- Raw text -