64-bit stat (or not) in 32-bit Fedora binaries

Eric Sandeen sandeen at redhat.com
Tue Feb 19 15:42:30 UTC 2013


On 2/19/13 9:32 AM, Jakub Jelinek wrote:
> On Tue, Feb 19, 2013 at 09:22:55AM -0600, Eric Sandeen wrote:
>>> (3) For my code that uses st_ino, I need to ensure this is never
>>> assigned to a 32 bit integer (eg. 'int', 'int32_t', 'long' on 32 bit, etc.)?
>>
>> To be safe I'd use it in an u64 type, I guess.  The *internal* kernel stat
>> structure uses u64:
> 
> That would be wrong.  To store st_ino values, you should be using the ino_t
> type, like for file sizes/offsets (st_size, seeking, etc.) you should be
> using off_t.  Both of these types depend on _FILE_OFFSET_BITS macro.

Oh, of course this is correct.  Sorry, and thanks for pointing it out, Jakub.

-Eric

> 	Jakub
> 



More information about the devel mailing list