I have a need for more of the GNU/Linux struct stat members. At
the same time, it looked like adding them would plausibly break
some non-GNU/Linux hosts, which I guess is the reason there were
only two st_ino and st_dev present in cb_host_to_target_stat.
All would have been *much* simpler if sim/common used a modern
autoconf (with AC_CHECK_MEMBERS), because then I wouldn't have
to translate that macro into something that works with
autoconf-2.13. Pain. :-( Arguably some st_* members possibly
don't translate very well to a simulated environment, but that's
up to the user of the simulator to decide. Regrettably, I did
not find a way to make the cb_host_to_target_stat more agreeable
to the eye. Tested by observing that a few more of my C-based
simulator tests (developed without the st_* #ifdefs) now pass,
and testing that configuring a non-present struct stat member
works.
Ok to commit?
sim/common:
* configure.in (SIM_CHECK_MEMBERS): Call for struct stat members
st_dev, st_ino, st_mode, st_nlink, st_uid, st_gid, st_rdev,
st_size, st_blksize, st_blocks, st_atime, st_mtime and st_ctime.
* aclocal.m4 (SIM_CHECK_MEMBER, SIM_CHECK_MEMBERS_1)
(SIM_CHECK_MEMBERS): New macros.
* callback.c (cb_host_to_target_stat): Use temporary macro ST_x
for struct stat member test and write. Add ST_x calls for each
struct stat member tested in configure.in. Wrap each ST_x call in
#ifdef of configure macro for that member.
* configure, config.in: Regenerate.