Date: Sun, 8 Jul 2001 11:30:10 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: David Witbrodt cc: DJGPP mailing list Subject: Re: statfs() mystery deepens -- DJGPP workers exonerated, though! In-Reply-To: <3B47A9FE.106D49A9@alpha.delta.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sat, 7 Jul 2001, David Witbrodt wrote: > (gdb) p bf > $1 = 4026531840 > (gdb) p fspec > $2 = "c:/djgpp/programs/files/prog07/*.*", '\000' > (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?