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

Joel Sherrill <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
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ć <[email protected]>
    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ć <[email protected]>
---
 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.