Hi Adhemerval, > This patch revert "Move ftime to a compatibility symbol" (commit > 14633d3e568eb9770a7e5046eff257113e0453fb). The 'ftime' is handled > similar to 'gets', where it is only exported if the program is built > for POSIX.1-2001 or order (_POSIX_C_SOURCE=200112L). > > Checked on x86_64-linux-gnu and i686-linux-gnu. > --- > NEWS | 6 +-- > include/features.h | 10 ++++ > include/sys/timeb.h | 1 + > .../unix/sysv/linux/riscv/rv32/libc.abilist | 1 + > time/Makefile | 5 +- > time/ftime.c | 22 ++------- > time/sys/timeb.h | 48 > +++++++++++++++++++ time/tst-ftime.c | > 40 ++++++---------- 8 files changed, 84 insertions(+), 49 deletions(-) > create mode 100644 include/sys/timeb.h > create mode 100644 time/sys/timeb.h > > diff --git a/NEWS b/NEWS > index 6eb577a669..6105eb0b3e 100644 > --- a/NEWS > +++ b/NEWS > @@ -37,10 +37,8 @@ Deprecated and removed features, and other changes > affecting compatibility: implementations from HWCAP subdirectories > are no longer loaded. Instead, the default implementation is used. > > -* The deprecated header and the ftime function have > been > - removed. To support old binaries, the ftime function continue to > exist > - as a compatibility symbol (on those architectures which had it). > All > - programs should use gettimeofday or clock_gettime instead. > +* The deprecated ftime function is now only declared for > POSIX.1-2001 or > + older standard. > > Changes to build and runtime requirements: > > diff --git a/include/features.h b/include/features.h > index f3e62d3362..aec149ed10 100644 > --- a/include/features.h > +++ b/include/features.h > @@ -143,6 +143,7 @@ > #undef __GLIBC_USE_ISOC2X > #undef __GLIBC_USE_DEPRECATED_GETS > #undef __GLIBC_USE_DEPRECATED_SCANF > +#undef __GLIBC_USE_DEPRECATED_FTIME > > /* Suppress kernel-name space pollution unless user expressedly asks > for it. */ > @@ -438,6 +439,15 @@ > # define __GLIBC_USE_DEPRECATED_SCANF 0 > #endif > > +/* The function 'ftime' appeared in Version 7 AT&T UNIX, it was > marked > + as LEGACY on IEEE 1003.1-2004, and removed on IEEE 1003.1-2008. > */ +#if (defined _POSIX_C_SOURCE && (_POSIX_C_SOURCE - 0) <= 200112L) > \ > + || defined _XOPEN_SOURCE_EXTENDED > +# define __GLIBC_USE_DEPRECATED_FTIME 1 > +#else > +# define __GLIBC_USE_DEPRECATED_FTIME 0 > +#endif Am I right that we only export the struct timeb when program, which links to glibc indicates that some older POSIX standard will be used? > + > /* Get definitions of __STDC_* predefined macros, if the compiler has > not preincluded this header automatically. */ > #include > diff --git a/include/sys/timeb.h b/include/sys/timeb.h > new file mode 100644 > index 0000000000..9f4509c35e > --- /dev/null > +++ b/include/sys/timeb.h > @@ -0,0 +1 @@ > +#include