]> sourceware.org Git - newlib-cygwin.git/commit
Complete revert of 2019-08-19, st_atime in libc/include/sys/stat.h
authorHans-Peter Nilsson <hp@axis.com>
Mon, 15 Feb 2021 20:20:35 +0000 (21:20 +0100)
committerHans-Peter Nilsson <hp@bitrange.com>
Tue, 16 Feb 2021 12:57:11 +0000 (13:57 +0100)
commit571e73067898f9e82d295b3526de73e7f44e9f89
treee6a0dcc901c434f763928643550ecfbf6a26d019
parent2caca30309eae73fef4bf14af947ad9cc9551eeb
Complete revert of 2019-08-19, st_atime in libc/include/sys/stat.h

The revert-part of the revert-and-fix commit, b99887c4283f a.k.a.
"Revert previous change to sys/stat.h and fix cris libgloss",
apparently intending to revert f75aa6785151 a.k.a. "Fix regression in
cris-elf caused by sys/stat.h change" and fix it in another way,
wasn't complete.  Although the fix-part added the prerequisite "#undef
st_atime" (et al) to gensyscalls, the revert-part didn't revert the
"&& !defined(__cris__)" in sys/stat.h, stopping st_atime (et al) from
being defined.

The effect of the unreverted change is that accessing the struct stat
compatibility member names "st_atime" (et al) as in "struct stat
mystat; mystat.st_atime;" yields errors, observable for example when
building libgfortran in gcc:

/x/gcc/libgfortran/intrinsics/stat.c:114:42: error: 'struct stat' has \
no member named 'st_atime'; did you mean 'st_atim'?
  114 |       sarray->base_addr[8 * stride] = sb.st_atime;
      |                                          ^~~~~~~~
      |                                          st_atim
(etc.)

Trivially fixed by completing the reversion, removing the "&&
!defined(__cris__)" in sys/stat.h.

Beware: the net effect of the earlier related change to struct stat in
sys/stat.h, leading up to the fix, *does* change its definition as a
type.  Thankfully, replacing members like "time_t st_atime; long
st_spare1;" by "struct timespec st_atim;", ditto st_mtim and st_ctim,
is layout-compatible.  To wit, that change is "binary compatible".

Incidentally, related to the simulator / Linux ABI, there's a
transitional stage (see gensyscalls), reloading between "struct stat"
(sys/stat.h) and "struct new_stat" (kernel/simulator) as necessary.

Tested by a cris-elf gcc build (including libgfortran).
newlib/libc/include/sys/stat.h
This page took 0.032413 seconds and 5 git commands to generate.