Some versions of dietlibc lack struct stat::st_mtim, which was
introduced with POSIX.1-2008.
Considering the slow development cycle of dietlibc (last three releases
are 2024, 2018 and 2013) and there's no popular user (nor one in CI) of
it, let's remove the workaround.
All the other runtimes that we target - glibc, bionic and musl - have
the struct member.
Iff needed we can reintroduce the workaround at a later stage alongside
a CI permutation.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/359
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
cdata.set10('HAVE_@0@'.format(builtin.to_upper()), have)
endforeach
-# dietlibc doesn't have st.st_mtim struct member
-# XXX: we use both st_mtim and st_mtime ... unify and test
-foreach tuple : [['struct stat', 'st_mtim', '#include <sys/stat.h>']]
- struct = tuple[0]
- member = tuple[1]
- prefix = tuple[2]
- if cc.has_member(struct, member, prefix : prefix, args : '-D_GNU_SOURCE')
- cdata.set('HAVE_@0@_@1@'.format(struct.underscorify().to_upper(),
- member.to_upper()), true)
- endif
-endforeach
-
# basename may be only available in libgen.h with the POSIX behavior,
# not desired here
_decls = [
unsigned long long stat_mstamp(const struct stat *st)
{
-#ifdef HAVE_STRUCT_STAT_ST_MTIM
return ts_usec(&st->st_mtim);
-#else
- return (unsigned long long)st->st_mtime;
-#endif
}
static int dlsym_manyv(void *dl, va_list ap)