Skip to content

Commit

Permalink
Merge pull request #165 from robbavey/aarch64_stat
Browse files Browse the repository at this point in the history
Update struct layout for aarch64 linux to match value on device
  • Loading branch information
headius authored Jun 1, 2021
2 parents 19c17fc + 46f849d commit deb2f88
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/jnr/posix/LinuxFileStatAARCH64.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,19 @@ public Layout(jnr.ffi.Runtime runtime) {
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 dev_t __pad1 = new dev_t();
public final off_t st_size = new off_t();
public final blksize_t st_blksize = new blksize_t();
public final Signed32 __pad2 = new Signed32();
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();
public final Signed32 __unused4 = new Signed32();
public final Signed32 __unused5 = new Signed32();
}

private static final Layout layout = new Layout(jnr.ffi.Runtime.getSystemRuntime());
Expand Down
1 change: 1 addition & 0 deletions src/test/java/jnr/posix/FileStatTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void filestat() throws Throwable {
FileStat stat = posix.stat(f.getAbsolutePath());
assertNotNull("posix.stat failed", stat);
assertEquals(size, stat.st_size());
assertEquals(1, stat.nlink());
//assertNotEquals(stat.mtime(), stat.ctime());

stat = posix.allocateStat();
Expand Down

0 comments on commit deb2f88

Please sign in to comment.