www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/07/08/04:28:44

Date: Sun, 8 Jul 2001 11:30:10 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: David Witbrodt <dawitbro AT alpha DOT delta DOT edu>
cc: DJGPP mailing list <djgpp AT delorie DOT com>
Subject: Re: statfs() mystery deepens -- DJGPP workers exonerated, though!
In-Reply-To: <3B47A9FE.106D49A9@alpha.delta.edu>
Message-ID: <Pine.SUN.3.91.1010708112931.24414Q-100000@is>
MIME-Version: 1.0
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

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019