[PATCH 1/1] libc/include/sys/stat.h: Adjust for RTEMS MIPS

Joel Sherrill joel@rtems.org
Wed Jul 16 19:17:21 GMT 2025


The commit cited below introduced changes which included
conditionals strictly on __mips__. This ignored tailoring
for any environment on MIPS except that targeted by the
author of the change. This patch just fixes this code for
RTEMS.

    commit 467a2bdf17ad376dafada9f1734784f4611fa6fd
    Author: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
    Date:   Wed Jun 11 10:11:33 2025 +0200

        mips: Implement MIPS HAL and UHI

        Implement abstract interface for MIPS, including unified hosting
        interface (UHI).

        Signed-off-by: Jovan Dmitrović <jovan.dmitrovic@htecgroup.com>
---
 newlib/libc/include/sys/stat.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h
index 7edfe34ff..740997965 100644
--- a/newlib/libc/include/sys/stat.h
+++ b/newlib/libc/include/sys/stat.h
@@ -38,7 +38,7 @@ struct	stat
   time_t	st_atime;
   time_t	st_mtime;
   time_t	st_ctime;
-#elif defined(__mips__)
+#elif defined(__mips__) && !defined(__rtems__)
   time_t	st_atime;
   long		st_spare1;
   time_t	st_mtime;
@@ -60,7 +60,8 @@ struct	stat
 #endif
 };
 
-#if !((defined(__svr4__) && !defined(__PPC__) && !defined(__sun__)) || defined(__mips__))
+#if !((defined(__svr4__) && !defined(__PPC__) && !defined(__sun__)) || \
+    (defined(__mips__) && !defined(__rtems__)))
 #define st_atime st_atim.tv_sec
 #define st_ctime st_ctim.tv_sec
 #define st_mtime st_mtim.tv_sec
-- 
2.47.1



More information about the Newlib mailing list