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