public final dev_t st_dev = new dev_t();
public final ino_t st_ino = new ino_t();
public final mode_t st_mode = new mode_t();
public final nlink_t st_nlink = new nlink_t();
public final uid_t st_uid = new uid_t();
public final gid_t st_gid = new gid_t();
public final dev_t st_rdev = new dev_t();
public final off_t st_size = new off_t();
public final blksize_t st_blksize = new blksize_t();
public final blkcnt_t st_blocks = new blkcnt_t();
public final time_t st_atime = new time_t(); // Time of last access
public final SignedLong st_atimensec = new SignedLong(); // Time of last access (nanoseconds)
public final time_t st_mtime = new time_t(); // Last data modification time
public final SignedLong st_mtimensec = new SignedLong(); // Last data modification time (nanoseconds)
public final time_t st_ctime = new time_t(); // Time of last status change
public final SignedLong st_ctimensec = new SignedLong(); // Time of last status change (nanoseconds)
public final Signed64 __unused4 = new Signed64();
which manifests itself in File.stat running on jruby-9.2.17.0 presenting incorrect results on these nodes.
/usr/include/bits/stat.h: __nlink_t st_nlink; /* Link count. */
/usr/include/bits/types.h:__STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */
/usr/include/bits/typesizes.h:#define __NLINK_T_TYPE __U32_TYPE
Looking at the struct layout defined here in
LinuxFileStatAARCH64
, it does not matchstat
struct on Amazon Graviton2 nodes:which manifests itself in
File.stat
running onjruby-9.2.17.0
presenting incorrect results on these nodes.There are a few issues here:
__dev_t __pad1;
andint __pad2;
nlink_t
anddev_t
are not defined correctly in https://github.com/jnr/jnr-ffi/blob/master/src/main/java/jnr/ffi/provider/jffi/platform/aarch64/linux/TypeAliases.javahttps://github.com/jnr/jnr-ffi/blob/master/src/main/java/jnr/ffi/provider/jffi/platform/aarch64/linux/TypeAliases.java#L52:
And
https://github.com/jnr/jnr-ffi/blob/master/src/main/java/jnr/ffi/provider/jffi/platform/aarch64/linux/TypeAliases.java#L44
vs: