struct stat

David A. Greene greened@eecs.umich.edu
Thu Apr 1 00:00:00 GMT 1999


Geoff Keating wrote:

> > At worst, you can do what the linux kernel guys suggest and use
> > a long with a second long after the struct for padding when not
> > compiling with gcc.

> This is not portable.  On some machines, `long long' has to be aligned
> to an 8-byte boundary, but two longs need only be aligned to a 4-byte
> boundary.

Right.  It's not a good solution, I agree.
 
> If you really really must do this sort of thing, use 'double'.
> Fortunately, only an arithmetic type is required, according to the
> standard.  You would have to ensure that inode numbers can't be NaN,
> or -0, but this is a very easy thing to check, and it still leaves you
> with more possible inodes than you can fit in a 2^64-byte filesystem.
> 
> (Of course, you'd use a real `long long' in the kernel and libc.)

When you say "you," I hope you mean "libc developers..."  :)

                                         -Dave



More information about the Libc-alpha mailing list