For historical reasons the kernel struct stat represents times as unsigned
32-bit integers on mips64. Therefore, while it's possible to give a file a
timestamp before 1970 with futimens, reading the same timestamp through
struct stat will give a positive time (around 2106).
Workaround by using positive timestamps for testing on mips64.

* tests/xstatx.c (create_sample): use positive timestamps on mips64
---
 tests/xstatx.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/xstatx.c b/tests/xstatx.c
index 2883f16..a9fb8e8 100644
--- a/tests/xstatx.c
+++ b/tests/xstatx.c
@@ -211,7 +211,12 @@ static int
 create_sample(const char *fname, const libc_off_t size)
 {
        static const struct timespec ts[] = {
+#ifdef __mips64
+               // On mips64, struct stat cannot handle negative timestamps
+               {10841, 246}, {10843, 135}
+#else
                {-10843, 135}, {-10841, 246}
+#endif
        };
 
        (void) close(0);
-- 
2.8.1


------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity 
planning reports. http://sdm.link/zohodev2dev
_______________________________________________
Strace-devel mailing list
Strace-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/strace-devel

Reply via email to