00db10
commit 44927211651adde42bbd431ef5ebe568186125e5
00db10
Author: Florian Weimer <fweimer@redhat.com>
00db10
Date:   Tue Jul 3 17:57:14 2018 +0200
00db10
00db10
    libio: Add tst-vtables, tst-vtables-interposed
00db10
    
00db10
    (cherry picked from commit 29055464a03c72762969a2e8734d0d05d4d70e58)
00db10
    
00db10
    Some adjustments were needed for a tricky multi-inclusion issue related
00db10
    to libioP.h.
00db10
00db10
Backported from the upsteam release/2.27/master branch, adjusted for
00db10
lack of tests-internal support downstream.
00db10
00db10
diff --git a/libio/Makefile b/libio/Makefile
00db10
index 0cef96141209fe99..1e923da42e45c492 100644
00db10
--- a/libio/Makefile
00db10
+++ b/libio/Makefile
00db10
@@ -61,7 +61,9 @@ tests = tst_swprintf tst_wprintf tst_swscanf tst_wscanf tst_getwc tst_putwc   \
00db10
 	bug-memstream1 bug-wmemstream1 \
00db10
 	tst-setvbuf1 tst-popen1 tst-fgetwc bug-wsetpos tst-fseek \
00db10
 	tst-fwrite-error tst-ftell-active-handler \
00db10
-	tst-ftell-append
00db10
+	tst-ftell-append \
00db10
+	tst-vtables tst-vtables-interposed
00db10
+
00db10
 ifeq (yes,$(build-shared))
00db10
 # Add test-fopenloc only if shared library is enabled since it depends on
00db10
 # shared localedata objects.
00db10
diff --git a/libio/tst-vtables-common.c b/libio/tst-vtables-common.c
00db10
new file mode 100644
00db10
index 0000000000000000..dc8d89c195b95b8d
00db10
--- /dev/null
00db10
+++ b/libio/tst-vtables-common.c
00db10
@@ -0,0 +1,511 @@
00db10
+/* Test for libio vtables and their validation.  Common code.
00db10
+   Copyright (C) 2018 Free Software Foundation, Inc.
00db10
+   This file is part of the GNU C Library.
00db10
+
00db10
+   The GNU C Library is free software; you can redistribute it and/or
00db10
+   modify it under the terms of the GNU Lesser General Public
00db10
+   License as published by the Free Software Foundation; either
00db10
+   version 2.1 of the License, or (at your option) any later version.
00db10
+
00db10
+   The GNU C Library is distributed in the hope that it will be useful,
00db10
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
+   Lesser General Public License for more details.
00db10
+
00db10
+   You should have received a copy of the GNU Lesser General Public
00db10
+   License along with the GNU C Library; if not, see
00db10
+   <http://www.gnu.org/licenses/>.  */
00db10
+
00db10
+/* This test provides some coverage for how various stdio functions
00db10
+   use the vtables in FILE * objects.  The focus is mostly on which
00db10
+   functions call which methods, not so much on validating data
00db10
+   processing.  An initial series of tests check that custom vtables
00db10
+   do not work without activation through _IO_init.
00db10
+
00db10
+   Note: libio vtables are deprecated feature.  Do not use this test
00db10
+   as a documentation source for writing custom vtables.  See
00db10
+   fopencookie for a different way of creating custom stdio
00db10
+   streams.  */
00db10
+
00db10
+#include <stdbool.h>
00db10
+#include <string.h>
00db10
+#include <support/capture_subprocess.h>
00db10
+#include <support/check.h>
00db10
+#include <support/namespace.h>
00db10
+#include <support/support.h>
00db10
+#include <support/test-driver.h>
00db10
+#include <support/xunistd.h>
00db10
+
00db10
+/* Data shared between the test subprocess and the test driver in the
00db10
+   parent.  Note that *shared is reset at the start of the check_call
00db10
+   function.  */
00db10
+struct shared
00db10
+{
00db10
+  /* Expected file pointer for method calls.  */
00db10
+  FILE *fp;
00db10
+
00db10
+  /* If true, assume that a call to _IO_init is needed to enable
00db10
+     custom vtables.  */
00db10
+  bool initially_disabled;
00db10
+
00db10
+  /* Requested return value for the methods which have one.  */
00db10
+  int return_value;
00db10
+
00db10
+  /* A value (usually a character) recorded by some of the methods
00db10
+     below.  */
00db10
+  int value;
00db10
+
00db10
+  /* Likewise, for some data.  */
00db10
+  char buffer[16];
00db10
+  size_t buffer_length;
00db10
+
00db10
+  /* Total number of method calls.  */
00db10
+  unsigned int calls;
00db10
+
00db10
+  /* Individual method call counts.  */
00db10
+  unsigned int calls_finish;
00db10
+  unsigned int calls_overflow;
00db10
+  unsigned int calls_underflow;
00db10
+  unsigned int calls_uflow;
00db10
+  unsigned int calls_pbackfail;
00db10
+  unsigned int calls_xsputn;
00db10
+  unsigned int calls_xsgetn;
00db10
+  unsigned int calls_seekoff;
00db10
+  unsigned int calls_seekpos;
00db10
+  unsigned int calls_setbuf;
00db10
+  unsigned int calls_sync;
00db10
+  unsigned int calls_doallocate;
00db10
+  unsigned int calls_read;
00db10
+  unsigned int calls_write;
00db10
+  unsigned int calls_seek;
00db10
+  unsigned int calls_close;
00db10
+  unsigned int calls_stat;
00db10
+  unsigned int calls_showmanyc;
00db10
+  unsigned int calls_imbue;
00db10
+} *shared;
00db10
+
00db10
+/* Method implementations which increment the counters in *shared.  */
00db10
+
00db10
+static void
00db10
+log_method (FILE *fp, const char *name)
00db10
+{
00db10
+  if (test_verbose > 0)
00db10
+    printf ("info: %s (%p) called\n", name, fp);
00db10
+}
00db10
+
00db10
+static void
00db10
+method_finish (FILE *fp, int dummy)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_finish;
00db10
+}
00db10
+
00db10
+static int
00db10
+method_overflow (FILE *fp, int ch)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_overflow;
00db10
+  shared->value = ch;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static int
00db10
+method_underflow (FILE *fp)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_underflow;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static int
00db10
+method_uflow (FILE *fp)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_uflow;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static int
00db10
+method_pbackfail (FILE *fp, int ch)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_pbackfail;
00db10
+  shared->value = ch;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static size_t
00db10
+method_xsputn (FILE *fp, const void *data, size_t n)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_xsputn;
00db10
+
00db10
+  size_t to_copy = n;
00db10
+  if (n > sizeof (shared->buffer))
00db10
+    to_copy = sizeof (shared->buffer);
00db10
+  memcpy (shared->buffer, data, to_copy);
00db10
+  shared->buffer_length = to_copy;
00db10
+  return to_copy;
00db10
+}
00db10
+
00db10
+static size_t
00db10
+method_xsgetn (FILE *fp, void *data, size_t n)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_xsgetn;
00db10
+  return 0;
00db10
+}
00db10
+
00db10
+static off64_t
00db10
+method_seekoff (FILE *fp, off64_t offset, int dir, int mode)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_seekoff;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static off64_t
00db10
+method_seekpos (FILE *fp, off64_t offset, int mode)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_seekpos;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static FILE *
00db10
+method_setbuf (FILE *fp, char *buffer, ssize_t length)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_setbuf;
00db10
+  return fp;
00db10
+}
00db10
+
00db10
+static int
00db10
+method_sync (FILE *fp)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_sync;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static int
00db10
+method_doallocate (FILE *fp)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_doallocate;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static ssize_t
00db10
+method_read (FILE *fp, void *data, ssize_t length)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_read;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static ssize_t
00db10
+method_write (FILE *fp, const void *data, ssize_t length)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_write;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static off64_t
00db10
+method_seek (FILE *fp, off64_t offset, int mode)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_seek;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static int
00db10
+method_close (FILE *fp)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_close;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static int
00db10
+method_stat (FILE *fp, void *buffer)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_stat;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static int
00db10
+method_showmanyc (FILE *fp)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_showmanyc;
00db10
+  return shared->return_value;
00db10
+}
00db10
+
00db10
+static void
00db10
+method_imbue (FILE *fp, void *locale)
00db10
+{
00db10
+  log_method (fp, __func__);
00db10
+  TEST_VERIFY (fp == shared->fp);
00db10
+  ++shared->calls;
00db10
+  ++shared->calls_imbue;
00db10
+}
00db10
+
00db10
+/* Our custom vtable.  */
00db10
+
00db10
+static const struct _IO_jump_t jumps =
00db10
+{
00db10
+  JUMP_INIT_DUMMY,
00db10
+  JUMP_INIT (finish, method_finish),
00db10
+  JUMP_INIT (overflow, method_overflow),
00db10
+  JUMP_INIT (underflow, method_underflow),
00db10
+  JUMP_INIT (uflow, method_uflow),
00db10
+  JUMP_INIT (pbackfail, method_pbackfail),
00db10
+  JUMP_INIT (xsputn, method_xsputn),
00db10
+  JUMP_INIT (xsgetn, method_xsgetn),
00db10
+  JUMP_INIT (seekoff, method_seekoff),
00db10
+  JUMP_INIT (seekpos, method_seekpos),
00db10
+  JUMP_INIT (setbuf, method_setbuf),
00db10
+  JUMP_INIT (sync, method_sync),
00db10
+  JUMP_INIT (doallocate, method_doallocate),
00db10
+  JUMP_INIT (read, method_read),
00db10
+  JUMP_INIT (write, method_write),
00db10
+  JUMP_INIT (seek, method_seek),
00db10
+  JUMP_INIT (close, method_close),
00db10
+  JUMP_INIT (stat, method_stat),
00db10
+  JUMP_INIT (showmanyc, method_showmanyc),
00db10
+  JUMP_INIT (imbue, method_imbue)
00db10
+};
00db10
+
00db10
+/* Our file implementation.  */
00db10
+
00db10
+struct my_file
00db10
+{
00db10
+  FILE f;
00db10
+  const struct _IO_jump_t *vtable;
00db10
+};
00db10
+
00db10
+struct my_file
00db10
+my_file_create (void)
00db10
+{
00db10
+  return (struct my_file)
00db10
+    {
00db10
+      /* Disable locking, so that we do not have to set up a lock
00db10
+         pointer.  */
00db10
+      .f._flags =  _IO_USER_LOCK,
00db10
+
00db10
+      /* Copy the offset from the an initialized handle, instead of
00db10
+         figuring it out from scratch.  */
00db10
+      .f._vtable_offset = stdin->_vtable_offset,
00db10
+
00db10
+      .vtable = &jumps,
00db10
+    };
00db10
+}
00db10
+
00db10
+/* Initial tests which do not enable vtable compatibility.  */
00db10
+
00db10
+/* Inhibit GCC optimization of fprintf.  */
00db10
+typedef int (*fprintf_type) (FILE *, const char *, ...);
00db10
+static const volatile fprintf_type fprintf_ptr = &fprintf;
00db10
+
00db10
+static void
00db10
+without_compatibility_fprintf (void *closure)
00db10
+{
00db10
+  /* This call should abort.  */
00db10
+  fprintf_ptr (shared->fp, " ");
00db10
+  _exit (1);
00db10
+}
00db10
+
00db10
+static void
00db10
+without_compatibility_fputc (void *closure)
00db10
+{
00db10
+  /* This call should abort.  */
00db10
+  fputc (' ', shared->fp);
00db10
+  _exit (1);
00db10
+}
00db10
+
00db10
+static void
00db10
+without_compatibility_fgetc (void *closure)
00db10
+{
00db10
+  /* This call should abort.  */
00db10
+  fgetc (shared->fp);
00db10
+  _exit (1);
00db10
+}
00db10
+
00db10
+static void
00db10
+without_compatibility_fflush (void *closure)
00db10
+{
00db10
+  /* This call should abort.  */
00db10
+  fflush (shared->fp);
00db10
+  _exit (1);
00db10
+}
00db10
+
00db10
+/* Exit status after abnormal termination.  */
00db10
+static int termination_status;
00db10
+
00db10
+static void
00db10
+init_termination_status (void)
00db10
+{
00db10
+  pid_t pid = xfork ();
00db10
+  if (pid == 0)
00db10
+    abort ();
00db10
+  xwaitpid (pid, &termination_status, 0);
00db10
+
00db10
+  TEST_VERIFY (WIFSIGNALED (termination_status));
00db10
+  TEST_COMPARE (WTERMSIG (termination_status), SIGABRT);
00db10
+}
00db10
+
00db10
+static void
00db10
+check_for_termination (const char *name, void (*callback) (void *))
00db10
+{
00db10
+  struct my_file file = my_file_create ();
00db10
+  shared->fp = &file.f;
00db10
+  shared->return_value = -1;
00db10
+  shared->calls = 0;
00db10
+  struct support_capture_subprocess proc
00db10
+    = support_capture_subprocess (callback, NULL);
00db10
+  support_capture_subprocess_check (&proc, name, termination_status,
00db10
+                                    sc_allow_stderr);
00db10
+  const char *message
00db10
+    = "Fatal error: glibc detected an invalid stdio handle\n";
00db10
+  TEST_COMPARE_BLOB (proc.err.buffer, proc.err.length,
00db10
+                     message, strlen (message));
00db10
+  TEST_COMPARE (shared->calls, 0);
00db10
+  support_capture_subprocess_free (&proc;;
00db10
+}
00db10
+
00db10
+/* The test with vtable validation disabled.  */
00db10
+
00db10
+/* This function does not have a prototype in libioP.h to prevent
00db10
+   accidental use from within the library (which would disable vtable
00db10
+   verification).  */
00db10
+void _IO_init (FILE *fp, int flags);
00db10
+
00db10
+static void
00db10
+with_compatibility_fprintf (void *closure)
00db10
+{
00db10
+  TEST_COMPARE (fprintf_ptr (shared->fp, "A%sCD", "B"), 4);
00db10
+  TEST_COMPARE (shared->calls, 3);
00db10
+  TEST_COMPARE (shared->calls_xsputn, 3);
00db10
+  TEST_COMPARE_BLOB (shared->buffer, shared->buffer_length,
00db10
+                     "CD", 2);
00db10
+}
00db10
+
00db10
+static void
00db10
+with_compatibility_fputc (void *closure)
00db10
+{
00db10
+  shared->return_value = '@';
00db10
+  TEST_COMPARE (fputc ('@', shared->fp), '@');
00db10
+  TEST_COMPARE (shared->calls, 1);
00db10
+  TEST_COMPARE (shared->calls_overflow, 1);
00db10
+  TEST_COMPARE (shared->value, '@');
00db10
+}
00db10
+
00db10
+static void
00db10
+with_compatibility_fgetc (void *closure)
00db10
+{
00db10
+  shared->return_value = 'X';
00db10
+  TEST_COMPARE (fgetc (shared->fp), 'X');
00db10
+  TEST_COMPARE (shared->calls, 1);
00db10
+  TEST_COMPARE (shared->calls_uflow, 1);
00db10
+}
00db10
+
00db10
+static void
00db10
+with_compatibility_fflush (void *closure)
00db10
+{
00db10
+  TEST_COMPARE (fflush (shared->fp), 0);
00db10
+  TEST_COMPARE (shared->calls, 1);
00db10
+  TEST_COMPARE (shared->calls_sync, 1);
00db10
+}
00db10
+
00db10
+/* Call CALLBACK in a subprocess, after setting up a custom file
00db10
+   object and updating shared->fp.  */
00db10
+static void
00db10
+check_call (const char *name, void (*callback) (void *),
00db10
+            bool initially_disabled)
00db10
+{
00db10
+  *shared = (struct shared)
00db10
+    {
00db10
+     .initially_disabled = initially_disabled,
00db10
+    };
00db10
+
00db10
+  /* Set up a custom file object.  */
00db10
+  struct my_file file = my_file_create ();
00db10
+  shared->fp = &file.f;
00db10
+  if (shared->initially_disabled)
00db10
+    _IO_init (shared->fp, file.f._flags);
00db10
+
00db10
+  if (test_verbose > 0)
00db10
+    printf ("info: calling test %s\n", name);
00db10
+  support_isolate_in_subprocess (callback, NULL);
00db10
+}
00db10
+
00db10
+/* Run the tests.  INITIALLY_DISABLED indicates whether custom vtables
00db10
+   are disabled when the test starts.  */
00db10
+static int
00db10
+run_tests (bool initially_disabled)
00db10
+{
00db10
+  /* The test relies on fatal error messages being printed to standard
00db10
+     error.  */
00db10
+  setenv ("LIBC_FATAL_STDERR_", "1", 1);
00db10
+
00db10
+  shared = support_shared_allocate (sizeof (*shared));
00db10
+  shared->initially_disabled = initially_disabled;
00db10
+  init_termination_status ();
00db10
+
00db10
+  if (initially_disabled)
00db10
+    {
00db10
+      check_for_termination ("fprintf", without_compatibility_fprintf);
00db10
+      check_for_termination ("fputc", without_compatibility_fputc);
00db10
+      check_for_termination ("fgetc", without_compatibility_fgetc);
00db10
+      check_for_termination ("fflush", without_compatibility_fflush);
00db10
+    }
00db10
+
00db10
+  check_call ("fprintf", with_compatibility_fprintf, initially_disabled);
00db10
+  check_call ("fputc", with_compatibility_fputc, initially_disabled);
00db10
+  check_call ("fgetc", with_compatibility_fgetc, initially_disabled);
00db10
+  check_call ("fflush", with_compatibility_fflush, initially_disabled);
00db10
+
00db10
+  support_shared_free (shared);
00db10
+  shared = NULL;
00db10
+
00db10
+  return 0;
00db10
+}
00db10
diff --git a/libio/tst-vtables-interposed.c b/libio/tst-vtables-interposed.c
00db10
new file mode 100644
00db10
index 0000000000000000..c8f4e8c7c386af39
00db10
--- /dev/null
00db10
+++ b/libio/tst-vtables-interposed.c
00db10
@@ -0,0 +1,37 @@
00db10
+/* Test for libio vtables and their validation.  Enabled through interposition.
00db10
+   Copyright (C) 2018 Free Software Foundation, Inc.
00db10
+   This file is part of the GNU C Library.
00db10
+
00db10
+   The GNU C Library is free software; you can redistribute it and/or
00db10
+   modify it under the terms of the GNU Lesser General Public
00db10
+   License as published by the Free Software Foundation; either
00db10
+   version 2.1 of the License, or (at your option) any later version.
00db10
+
00db10
+   The GNU C Library is distributed in the hope that it will be useful,
00db10
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
+   Lesser General Public License for more details.
00db10
+
00db10
+   You should have received a copy of the GNU Lesser General Public
00db10
+   License along with the GNU C Library; if not, see
00db10
+   <http://www.gnu.org/licenses/>.  */
00db10
+
00db10
+/* Provide an interposed definition of the standard file handles with
00db10
+   our own vtable.  stdout/stdin/stderr will not work as a result, but
00db10
+   a succesful test does not print anything, so this is fine.  */
00db10
+static const struct _IO_jump_t jumps;
00db10
+#define _IO_file_jumps jumps
00db10
+#include "stdfiles.c"
00db10
+
00db10
+#include "tst-vtables-common.c"
00db10
+
00db10
+static int
00db10
+do_test (void)
00db10
+{
00db10
+  return run_tests (false);
00db10
+}
00db10
+
00db10
+/* Calling setvbuf in the test driver is not supported with our
00db10
+   interposed file handles.  */
00db10
+#define TEST_NO_SETVBUF
00db10
+#include <support/test-driver.c>
00db10
diff --git a/libio/tst-vtables.c b/libio/tst-vtables.c
00db10
new file mode 100644
00db10
index 0000000000000000..f16acf5d23b0fff6
00db10
--- /dev/null
00db10
+++ b/libio/tst-vtables.c
00db10
@@ -0,0 +1,29 @@
00db10
+/* Test for libio vtables and their validation.  Initially disabled case.
00db10
+   Copyright (C) 2018 Free Software Foundation, Inc.
00db10
+   This file is part of the GNU C Library.
00db10
+
00db10
+   The GNU C Library is free software; you can redistribute it and/or
00db10
+   modify it under the terms of the GNU Lesser General Public
00db10
+   License as published by the Free Software Foundation; either
00db10
+   version 2.1 of the License, or (at your option) any later version.
00db10
+
00db10
+   The GNU C Library is distributed in the hope that it will be useful,
00db10
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
00db10
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00db10
+   Lesser General Public License for more details.
00db10
+
00db10
+   You should have received a copy of the GNU Lesser General Public
00db10
+   License along with the GNU C Library; if not, see
00db10
+   <http://www.gnu.org/licenses/>.  */
00db10
+
00db10
+#include "libioP.h"
00db10
+
00db10
+#include "tst-vtables-common.c"
00db10
+
00db10
+static int
00db10
+do_test (void)
00db10
+{
00db10
+  return run_tests (true);
00db10
+}
00db10
+
00db10
+#include <support/test-driver.c>