statx struct's stx_size pointer compatibility with uint64_t/size_t

Dominique Martinet
Tue Dec 17 18:26:00 GMT 2019

David Howells wrote on Tue, Dec 17, 2019:
> sizeof(size_t) != sizeof(__u64) on some arches, so you can't simply
> interchange them.  But that's not what your example code is doing.

Yes, I am not too worried about size_t (I always have trouble figuring
what to expect of size_t and off_t size-wise and now statx stx_size
field being u64 doesn't help with that, but at least is clear and I have
no qualm about this -- fixed size fields are easy to think about)

I'm really thinking of this __u64 vs. uint64_t incompat. Thanks for
bringing up printf formats, userspace has PRIx64 and friends but these
are not very pretty to use and I'm sure the kernel wouldn't want these.

(Unfortunately this also pretty much means libc can't just go and change
the stdint side of things either, so I don't see any good solution to
this, but I'll let others reply on the linux-api/libc-alpha side of the
thread about this)

Thanks for the answers,

More information about the Libc-help mailing list