64-bit stat (or not) in 32-bit Fedora binaries
Petr Pisar
ppisar at redhat.com
Tue Feb 19 14:28:19 UTC 2013
On 2013-02-19, Richard W.M. Jones <rjones at redhat.com> wrote:
> On Tue, Feb 19, 2013 at 12:33:07PM +0000, Petr Pisar wrote:
>> EOVERFLOW
>> (stat()) path refers to a file whose size cannot be represented
>> in the type off_t. This can occur when an application compiled
>> on a 32-bit platform without -D_FILE_OFFSET_BITS=64 calls stat()
>> on a file whose size exceeds (1<<31)-1 bits.
>>
>> EOVERFLOW
>> A value to be stored would overflow one of the members of the
>> stat structure.
>
> OK -- I must have an older version because the second paragraph
> is completely missing here. But good to know that this at least
> has been fixed.
>
First paragrph is from stat(2), second paragraph from stat(3p). It's
good to read POSIX pages to know what's portable.
> Does your man page still include an example that casts st_ino to a
> long?
>
Yes, stat(2) still shows:
printf("I-node number: %ld\n", (long) sb.st_ino);
which is ridiculous because types.h(0p) defines ino_t as unsigned.
-- Petr
More information about the devel
mailing list