Bug#280213: exim4: Thinks it's always out of spool space

Andreas Metzler Andreas Metzler <ametzler@downhill.at.eu.org>, 280213@bugs.debian.org
Tue, 9 Nov 2004 14:16:54 +0100


On 2004-11-09 Steve Langasek <vorlon@debian.org> wrote:
> On Tue, Nov 09, 2004 at 10:03:20AM +0100, Andreas Metzler wrote:
[...]
> > Hmm, strange, why doesn't it use statfs64? Is there some special magic
> > on alpha to disable the effects of "-D_FILE_OFFSET_BITS=64
> > -D_LARGEFILE_SOURCE"? (It does use stafs64 on ix86)

> Some syscalls on alpha simply don't have "foo64" counterparts, because they
> already operate on 64-bit types (aka, "long"/"unsigned long") by default on
> that architecture.

> However, this doesn't guarantee that libc's exposes the same behavior to
> userspace apps with and without the LFS defines.

Hello,
Hmm, statfs with -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE seems to
be completely broken on alpha.

----------------------------
ametzler@spe142:/tmp/ametz$ cat statfstest.c
#include <stdio.h>
#include <sys/statvfs.h>
#include <sys/vfs.h>

int main(void) {
  struct statvfs buf;
  struct statfs buf2;

  if (statvfs("/var/spool", &buf) == -1) {
    perror("statvfs");
    return 1;
  }
  if (statfs("/var/spool", &buf2) == -1) {
    perror("statfs");
    return 1;
  }

  printf("            statvfs     statfs\n");
  printf("f_blocks:%10ld %10ld\n", buf.f_blocks,
                  buf2.f_blocks);
  printf("f_bfree: %10ld %10ld\n", buf.f_bfree, buf2.f_bfree);
  return 0;
}
ametzler@spe142:/tmp/ametz$ gcc -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE  -o statfstest -Wall statfstest.c
ametzler@spe142:/tmp/ametz$ ./statfstest
            statvfs     statfs
f_blocks:    130445 410500089380237
f_bfree:      95577 285185828543351
ametzler@spe142:/tmp/ametz$ gcc -o statfstest -Wall statfstest.c
statfstest.c: In function `main':
statfstest.c:20: warning: long int format, different type arg (arg 2)
statfstest.c:20: warning: long int format, different type arg (arg 3)
statfstest.c:21: warning: long int format, different type arg (arg 2)
statfstest.c:21: warning: long int format, different type arg (arg 3)
ametzler@spe142:/tmp/ametz$ ./statfstest
            statvfs     statfs
f_blocks:    130445     130445
f_bfree:      95577      95577
----------------------------
This is spe142.testdrive.hp.com, running Debian stable.

statvfs works, as John has already noted, however I wonder whether the
proper fix is not to force usage of statvfs but to change compilation
flags and use $(getconf LFS_CFLAGS) instead of
"-D_FILE_OFFSET_BITS=64"? - There might be more similar breakage.
               cu andreas

-- 
"See, I told you they'd listen to Reason," [SPOILER] Svfurlr fnlf,
fuhggvat qbja gur juveyvat tha.
Neal Stephenson in "Snow Crash"