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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 02/19/2013 04:32 PM, 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.

You can't use ino_t and off_t in public header files because of that _FILE_OFFSET_BITS dependency. At least in such header files, using explicit 64-bit types (uint64_t, presumably) is the way to go.

Admittedly, this has a certain yuck factor, but I don't see a way around that.

--
Florian Weimer / Red Hat Product Security Team
--
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux