Bug#280213: Strange Exim Problem on Alpha

John Goerzen John Goerzen <jgoerzen@complete.org>, 280213@bugs.debian.org
Mon, 8 Nov 2004 20:34:40 -0600


On Mon, Nov 08, 2004 at 02:37:48PM -0800, Steve Langasek wrote:
> The other factor at work here is probably that df is using the statfs()
> function from glibc, whereas exim4 is using statfs64() due to the CFLAGS
> settings -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE.  We may be looking at a
> broken implementation of the statfs64() libc call on alpha, or a broken
> statfs64() syscall (either when pointing at reiserfs, or in
> general).

OK, I'm going to try to weed out this.

Here is my test program:

$ cat test.c
#include <stdio.h>
#include <sys/statvfs.h>

void main(void) {
  struct statvfs buf;

  if (statvfs("/var/spool/exim4", &buf) == -1) {
    perror("statvfs");
    exit(1);
  }
  printf("f_bsize = %lu\n", buf.f_bsize);
  printf("f_rsize = %lu\n", buf.f_frsize);
  printf("f_blocks = %ld\n", (long) buf.f_blocks);
  printf("f_bfree = %ld\n", (long) buf.f_bfree);
  printf("f_bavail = %ld\n", (long) buf.f_bavail);
  printf("f_files = %lu\n", (unsigned long) buf.f_files);
  printf("f_ffree = %lu\n", (unsigned long) buf.f_ffree);
  printf("f_favail = %lu\n", (unsigned long) buf.f_favail);
  printf("f_fsid = %lu\n", buf.f_fsid);
  printf("f_flag = %lu\n", buf.f_flag);
  printf("f_namemax = %lu\n", buf.f_namemax);
}

Now, looking at things without largefile:

erwin ~/scratch/porting$ gcc -Wall -o test test.c
test.c:4: warning: return type of `main' is not `int'
test.c: In function `main':
test.c:9: warning: implicit declaration of function `exit'
erwin ~/scratch/porting$ ./test
f_bsize = 4096
f_rsize = 4096
f_blocks = 293066
f_bfree = 51914
f_bavail = 51914
f_files = 0
f_ffree = 0
f_favail = 0
f_fsid = 0
f_flag = 0
f_namemax = 255

Everything looks normal.

And:

erwin ~/scratch/porting$ gcc -Wall -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -o test test.c
test.c:4: warning: return type of `main' is not `int'
test.c: In function `main':
test.c:9: warning: implicit declaration of function `exit'
erwin ~/scratch/porting$ ./test
f_bsize = 4096
f_rsize = 4096
f_blocks = 293066
f_bfree = 51914
f_bavail = 51914
f_files = 0
f_ffree = 0
f_favail = 0
f_fsid = 0
f_flag = 0
f_namemax = 255

Looks good there too.

So it looks like the kernel and libc are OK in this instance.

Thanks for the suggestions.  Keep them coming :-)

-- John