linux_statfs64() missing an argument??

David Taylor davidt at
Sun Apr 8 19:38:21 UTC 2007

I've recently been trying to compile gentoo under FreeBSD
(in order, eventually, to compile OpenWRT), and ran in to a rather
confusing problem when trying to diagnose the reason "coreutils"
failed to build properly.

Eventually I tracked down the problem:

glibc calls the statfs64 syscall with (path, sizeof(struct statfs64), buf)

The linux_statfs64 emulated syscall in FreeBSD expects only (path, buf),
and returns EFAULT every time, as buf is always 0x54.

The attached patch adds the missing argument, and ensures it matches
sizeof(struct l_statfs64), returning EINVAL otherwise (is that the right

I'm currently recompiling my kernel to test this, but thought I'd see
if anyone had any comments on the patch as is, since I've probably done
something wrong, as I'm not too sure how the whole syscalls.master setup

David Taylor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux_statfs64.patch
Type: text/x-diff
Size: 7549 bytes
Desc: not available
Url :

More information about the freebsd-current mailing list