• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From: Dan Gohman <dev@sunfishcode.online>
2Subject: [PATCH] Define `TARGET_STAT_HAVE_NSEC` for s390x
3
4Without this, The `fstat` syscall sets `st_mtime_nsec` and the other `_nsec`
5fields to 0. Libc `fstat` will sometimes use the `fstatat` or `fstat64`
6syscalls instead, which aren't affected, but the libc `fstat` on ubuntu-20.04
7on Github Actions appears to be affected.
8
9This can be seen in the `st_mtime_nsec` assert in tests/fs/futimens.rs.
10
11It's not yet known why upstream qemu doesn't define this.
12
13---
14 linux-user/generic/sockbits.h | 1 +
15 1 files changed, 1 insertions(+)
16
17diff -ur a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
18--- a/linux-user/syscall_defs.h	2021-08-24 10:35:41.000000000 -0700
19+++ b/linux-user/syscall_defs.h	2022-04-12 13:23:25.291064887 -0700
20@@ -2040,6 +2040,7 @@
21 	abi_long	__unused[3];
22 };
23 #elif defined(TARGET_S390X)
24+#define TARGET_STAT_HAVE_NSEC
25 struct target_stat {
26     abi_ulong  st_dev;
27     abi_ulong  st_ino;
28