Re: [PATCH] Make st_*tim visible in stat for POSIX.1-2008
Corinna Vinschen <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
On Aug 13 13:46, Joel Sherrill wrote: > On Tue, Aug 13, 2019 at 1:30 PM Dionna Amalie Glaze via newlib < > [email protected]> wrote: > > > The st_{a,c,m}tim fields are needed for POSIX.1-2008, not just RTEMS. > > > > Signed-off-by: Dionna Glaze <[email protected]> > > --- > > 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 I am reading this change correctly, this is breakage for RTEMS. Both of > those > terms are defined as a consequence of user provided defines. If the user > application > and RTEMS are not compiled with the same options, the fields in the > structure will > not agree and these below will be overlaid on the time fields. > > Most of the newlib targets are single address space so changing the fields > in > the structure based on user provided conditionals is going to introduce > breakage. > > Perhaps adding a new define to sys/config.h so the fields are always there > for > the targets that support them. I couldn't find any example that wasn't > based on > a hard-coded always on value in either sys/config.h or sys/features.h. Maybe > someone else has another idea. I'm not sure why the timestamps are not defined for non-rtems targets but I guess it's all about size again. Don't we have an already existing definition for small targets we can use here? _REENT_SMALL or something like that? Corinna -- Corinna Vinschen Cygwin Maintainer Red Hat
signature.asc
(application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEoVYPmneWZnwT6kwF9TYGna5ET6AFAl1TyRkACgkQ9TYGna5E T6AMOhAAo1vnxYLKRzHQpLh44zpNoOs4+KbuX9YzL74JCRiDW0DXaRC43sTStr56 Oq2K3o+LPhCA0LTfCj0q3IouQQMih1M2D+NpDJcPRdmk9WD4S2AlH80PH8vtgNeZ SOLItthRUKca4n7cznUzlkkD0gXLV4mzVFW4MOawI2UuY2Zllv/HoK/+tqoEx4Gj Rwcp+jRdPvvorfMoxdApChL4tzJMhLAOpNpjpN0+HR+D/IzS9+4L6f0pa841aJS8 wQaFDMyRmGccGtT5pgR2bKgtEVaazGWalXuR4Ldh1XFt8ZdqqMJfsD1TX9KnQMs/ Sx6KCt1/CePP3x+16TKaRmqKP7lqyd+SHl/rPGWX5ciaizS/95zUs2BDOVSxE/Ct eb2SM9MiejHAqu4qj2pR8mfc4Bdu0Ol/g4WAoS5XNw6nlStzg/jPOGU7rLZtJHI/ yON0jwKAMxYsFq74uPToD2uLe9MKLQnaaUEwwC0/M2wNQXBK11vFsdkre82M64f7 Yr0l1X8ml/GS2PRm0KUmgi9Cn0phNeWUOY9XSnGYmb3ofIdAic5ZxatTOQ30oOwa G537ODuvZeBiHVNxX8sBpIFK+k5Ou5K+XwlZkSmTBrNpPddc4p1RCzKsJMTk3afn dXAY1ZXhF519XeyVh6h6WREudQQLFCGCIgONmrUbf4/oKzbbxeA= =FjG5 -----END PGP SIGNATURE-----