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

Message ID 20250716191721.2102560-2-joel@rtems.org
State New
Headers
Series sys/stat.h General MIPS Breakage |

Commit Message

Joel Sherrill July 16, 2025, 7:17 p.m. UTC
  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(-)
  

Comments

Corinna Vinschen July 17, 2025, 9:20 a.m. UTC | #1
On Jul 16 14:17, Joel Sherrill wrote:
> 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(-)

Sounds right to me.  Please push.


Thanks,
Corinna
  

Patch

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