android: Can we use proper `libc` typedefs in `stat` definition?
If we look at the stat type's definition for different platforms, we see:
st_dev: dev_t
st_ino: ino_t
[...]
- aarch64-linux-android:
- same
But for arm-linux-androideabi we stop using libc typedefs and instead have:
st_dev: c_ulonglong
st_mode: c_uint
[...]
st_ino: c_ulonglong
Is there a (good) reason for this divergence? If I look at ino_t it's actually defined to be a c_ulong, not c_ulonglong, so that will lead to mismatches all over the place when the typedefs are used. Is this mandated somewhere, a bug in the platform definition that we need to support? This is a nightmare to support in user code.
Please reference the bionic definition when updating Android libc structures - this is the canonical definition.
Beyond the canonicity, the reason this structure is different is the same reason it's different in e.g. musl - the kernel actually has a differently shaped structure, fills out fewer bits of the inode, etc.