public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Make st_*tim visible in stat for POSIX.1-2008
@ 2019-08-13 18:30 Dionna Amalie Glaze via newlib
  2019-08-13 18:46 ` Joel Sherrill
  2019-08-14 18:52 ` Yaakov Selkowitz
  0 siblings, 2 replies; 12+ messages in thread
From: Dionna Amalie Glaze via newlib @ 2019-08-13 18:30 UTC (permalink / raw)
  To: newlib

The st_{a,c,m}tim fields are needed for POSIX.1-2008, not just RTEMS.

Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
---
 newlib/libc/include/sys/stat.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/newlib/libc/include/sys/stat.h b/newlib/libc/include/sys/stat.h
index eee98db64..052ef5a66 100644
--- a/newlib/libc/include/sys/stat.h
+++ b/newlib/libc/include/sys/stat.h
@@ -34,10 +34,12 @@ struct      stat
   gid_t                st_gid;
   dev_t                st_rdev;
   off_t                st_size;
-#if defined(__rtems__)
+#if defined(__USE_MISC) || __POSIX_VISIBLE >= 200809
   struct timespec st_atim;
   struct timespec st_mtim;
   struct timespec st_ctim;
+#endif
+#if defined(__rtems__)
   blksize_t     st_blksize;
   blkcnt_t     st_blocks;
 #else
@@ -60,7 +62,7 @@ struct        stat
 #endif
 };

-#if defined(__rtems__)
+#if __POSIX_VISIBLE >= 200809
 #define st_atime st_atim.tv_sec
 #define st_ctime st_ctim.tv_sec
 #define st_mtime st_mtim.tv_sec

-- 
-Dionna Glaze, PhD (she/her)

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-08-16  8:59 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13 18:30 [PATCH] Make st_*tim visible in stat for POSIX.1-2008 Dionna Amalie Glaze via newlib
2019-08-13 18:46 ` Joel Sherrill
2019-08-14  8:41   ` Corinna Vinschen
2019-08-14 18:45     ` Dionna Amalie Glaze via newlib
2019-08-14 18:52 ` Yaakov Selkowitz
2019-08-14 19:06   ` Dionna Amalie Glaze via newlib
2019-08-14 19:25     ` Yaakov Selkowitz
2019-08-14 19:50       ` Dionna Amalie Glaze via newlib
2019-08-15 10:03         ` Corinna Vinschen
2019-08-15 15:59           ` Dionna Amalie Glaze via newlib
2019-08-15 18:29             ` Joel Sherrill
2019-08-16  8:59               ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).