test-xfail-UNIX98/ndbm.h/linknamespace = yes
test-xfail-XOPEN2K/ndbm.h/linknamespace = yes
test-xfail-XOPEN2K8/ndbm.h/linknamespace = yes
+
+# Header no longer provided by glibc (obsoleted in newer POSIX
+# standards).
+test-xfail-UNIX98/sys/timeb.h/conform = yes
+test-xfail-UNIX98/sys/timeb.h/linknamespace = yes
+test-xfail-XOPEN2K/sys/timeb.h/conform = yes
+test-xfail-XOPEN2K/sys/timeb.h/linknamespace = yes
+test-xfail-XPG42/sys/timeb.h/conform = yes
+test-xfail-XPG42/sys/timeb.h/linknamespace = yes
include ../Makeconfig
-headers := time.h sys/time.h sys/timeb.h bits/time.h \
+headers := time.h sys/time.h bits/time.h \
bits/types/clockid_t.h bits/types/clock_t.h \
bits/types/struct_itimerspec.h \
bits/types/struct_timespec.h bits/types/struct_timeval.h \
aux := era alt_digit lc-time-cleanup
tests := test_time clocktest tst-posixtz tst-strptime tst_wcsftime \
- tst-getdate tst-mktime tst-mktime2 tst-ftime_l tst-strftime \
+ tst-getdate tst-mktime tst-mktime2 tst-strftime tst-strftime_l \
tst-mktime3 tst-strptime2 bug-asctime bug-asctime_r bug-mktime1 \
- tst-strptime3 bug-getdate1 tst-strptime-whitespace tst-ftime \
+ tst-strptime3 bug-getdate1 tst-strptime-whitespace \
tst-tzname tst-y2039 bug-mktime4 tst-strftime2 tst-strftime3 \
tst-clock tst-clock2 tst-clock_nanosleep tst-cpuclock1
nan_TW.UTF-8 lzh_TW.UTF-8
include ../gen-locales.mk
-$(objpfx)tst-ftime_l.out: $(gen-locales)
+$(objpfx)tst-strftime_l.out: $(gen-locales)
$(objpfx)tst-strptime.out: $(gen-locales)
$(objpfx)tst-strftime2.out: $(gen-locales)
$(objpfx)tst-strftime3.out: $(gen-locales)
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
-#include <sys/timeb.h>
+#include <shlib-compat.h>
+
+#if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_32)
+
#include <time.h>
+struct timeb
+{
+ time_t time; /* Seconds since epoch, as from `time'. */
+ unsigned short int millitm; /* Additional milliseconds. */
+ short int timezone; /* Minutes west of GMT. */
+ short int dstflag; /* Nonzero if Daylight Savings Time used. */
+};
+
int
+attribute_compat_text_section
ftime (struct timeb *timebuf)
{
struct timespec ts;
timebuf->dstflag = 0;
return 0;
}
+compat_symbol (libc, __ftime, ftime, GLIBC_2_0);
+
+#endif
+++ /dev/null
-/* Copyright (C) 1994-2020 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_TIMEB_H
-#define _SYS_TIMEB_H 1
-
-#include <features.h>
-
-#include <bits/types/time_t.h>
-
-__BEGIN_DECLS
-
-/* Structure returned by the `ftime' function. */
-
-struct timeb
- {
- time_t time; /* Seconds since epoch, as from `time'. */
- unsigned short int millitm; /* Additional milliseconds. */
- short int timezone; /* Minutes west of GMT. */
- short int dstflag; /* Nonzero if Daylight Savings Time used. */
- };
-
-/* Fill in TIMEBUF with information about the current time. */
-
-extern int ftime (struct timeb *__timebuf)
- __nonnull ((1)) __attribute_deprecated__;
-
-__END_DECLS
-
-#endif /* sys/timeb.h */
+++ /dev/null
-/* Verify that ftime is sane.
- Copyright (C) 2014-2020 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-#include <sys/timeb.h>
-#include <stdio.h>
-#include <libc-diag.h>
-
-static int
-do_test (void)
-{
- struct timeb prev, curr = {.time = 0, .millitm = 0};
- int sec = 0;
-
- while (sec != 3)
- {
- prev = curr;
-
- /* ftime was deprecated on 2.31. */
- DIAG_PUSH_NEEDS_COMMENT;
- DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations");
-
- if (ftime (&curr))
- {
- printf ("ftime returned an error\n");
- return 1;
- }
-
- DIAG_POP_NEEDS_COMMENT;
-
- if (curr.time < prev.time)
- {
- printf ("ftime's time flowed backwards\n");
- return 1;
- }
-
- if (curr.time == prev.time
- && curr.millitm < prev.millitm)
- {
- printf ("ftime's millitm flowed backwards\n");
- return 1;
- }
-
- if (curr.time > prev.time)
- sec ++;
- }
- return 0;
-}
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"