This is the mail archive of the libc-alpha@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: struct stat


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]