[uClibc] fstat and fstat64

John Bowler jbowler at acm.org
Fri Jun 3 16:52:16 UTC 2005

From: Mike Frysinger
>you must be looking at the wrong set of headers ... stat64 does not have
>sort of armeb around st_dev in linux-2.4.27 or linux-2.6.11 ... stat does,
>but the ifdef is in linux-2.6, not linux-2.4

My apologies, you are correct - I quoted headers from the installed
directory, which were installed by uclibc (in my 2.6 build) therefore
contained *my* patch.

Ok, so there *is* a structure layout change, but it *is* in stat64, not in
stat - because stat keeps the low 16 bits of st_dev in the first two bytes
of the structure (regardless of architecture), whereas stat64 moves the low
16 bits from the first two bytes to bytes[7:8].

Your patch doesn't fix this (it doesn't change st_dev in stat64.)  The
st_rdev change looks right and would work for st_dev too.  The st_blocks
case looks correct too.  I'll test it with the addition of the st_dev fix
(on big-endian only.)

John Bowler <jbowler at acm.org>

More information about the uClibc mailing list