Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/806589/?format=api
{ "id": 806589, "url": "http://patchwork.ozlabs.org/api/patches/806589/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/patch/20170828140613.29221-1-zackw@panix.com/", "project": { "id": 41, "url": "http://patchwork.ozlabs.org/api/projects/41/?format=api", "name": "GNU C Library", "link_name": "glibc", "list_id": "libc-alpha.sourceware.org", "list_email": "libc-alpha@sourceware.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20170828140613.29221-1-zackw@panix.com>", "list_archive_url": null, "date": "2017-08-28T14:06:13", "name": "[RFC] Don't install libio.h or _G_config.h.", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "2a5989cbc813c9359b223b907626000350c3b20b", "submitter": { "id": 65878, "url": "http://patchwork.ozlabs.org/api/people/65878/?format=api", "name": "Zack Weinberg", "email": "zackw@panix.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/glibc/patch/20170828140613.29221-1-zackw@panix.com/mbox/", "series": [ { "id": 178, "url": "http://patchwork.ozlabs.org/api/series/178/?format=api", "web_url": "http://patchwork.ozlabs.org/project/glibc/list/?series=178", "date": "2017-08-28T14:06:13", "name": "[RFC] Don't install libio.h or _G_config.h.", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/178/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/806589/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/806589/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<libc-alpha-return-83784-incoming=patchwork.ozlabs.org@sourceware.org>", "X-Original-To": "incoming@patchwork.ozlabs.org", "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "mailing list libc-alpha@sourceware.org" ], "Authentication-Results": [ "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-83784-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)", "ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"sF6Z/BxI\"; dkim-atps=neutral", "sourceware.org; auth=none" ], "Received": [ "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xgtqR4sjPz9s8J\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 29 Aug 2017 00:06:43 +1000 (AEST)", "(qmail 4823 invoked by alias); 28 Aug 2017 14:06:28 -0000", "(qmail 4791 invoked by uid 89); 28 Aug 2017 14:06:26 -0000" ], "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:subject:date:message-id:mime-version\n\t:content-transfer-encoding; q=dns; s=default; b=TrCFCcnTg+UcKPMZ\n\thLemI3uTXf0Mk/5uySSmRAwogHClX5km8SwzkPgVEVIZMgIafpcag8b6Xv/ROmUo\n\t9n0OJHhZb1sf/+xEGs0qqBM9O7rzbsGV++BcImsZnDQ90S0MGnvpJ56QWyauEm5N\n\tnAD/ZQK5q94rYj45kQwXLC0YlDI=", "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:from:to:subject:date:message-id:mime-version\n\t:content-transfer-encoding; s=default; bh=1HMb4blUsEDxm34dwIkHwJ\n\tH9hKg=; b=sF6Z/BxIU2Uf5ywxsQeqxeZr6kSBtsVc6tdxo/khsjQNbRt9MoUYdx\n\t01Mtf0JrG/oc8PBczqoJTLvSDlTArw/bNbiIPHtuaA2WLsMDQyHdVfnFZjOf2AUU\n\tuaNUZxSAxvPGvTLJKZow6+t+dBfLyQ08sFp3XW2FUPZ/qes2tYeE8=", "Mailing-List": "contact libc-alpha-help@sourceware.org; run by ezmlm", "Precedence": "bulk", "List-Id": "<libc-alpha.sourceware.org>", "List-Unsubscribe": "<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>", "List-Subscribe": "<mailto:libc-alpha-subscribe@sourceware.org>", "List-Archive": "<http://sourceware.org/ml/libc-alpha/>", "List-Post": "<mailto:libc-alpha@sourceware.org>", "List-Help": "<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>", "Sender": "libc-alpha-owner@sourceware.org", "X-Virus-Found": "No", "X-Spam-SWARE-Status": "No, score=-25.6 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tRP_MATCHES_RCVD,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=locking, sticks,\n\tcookies, Former", "X-HELO": "mailbackend.panix.com", "From": "Zack Weinberg <zackw@panix.com>", "To": "libc-alpha@sourceware.org", "Subject": "[RFC PATCH] Don't install libio.h or _G_config.h.", "Date": "Mon, 28 Aug 2017 10:06:13 -0400", "Message-Id": "<20170828140613.29221-1-zackw@panix.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit" }, "content": "I posted this back in April, but now we're at the beginning of a\nrelease cycle so maybe it's a better time for it. This is an\nexperimental patch which removes libio.h (and _G_config.h) from the\nset of application-exposed headers. I'm looking for distribution\nmaintainers to do archive rebuilds to find out what applications\nbreak.\n\nAfter this change, the public stdio.h does not define any symbols\nwhose names begin with _G_ nor _IO_, except that when optimizing, the\nguts of struct _IO_FILE and three of the flag constants are visible\n(see bits/stdio.h and bits/types/FILE_internals.h). There is a small\namount of code duplication in bits/stdio.h, of macro bodies from\nlibio.h that are no longer available.\n\nA number of internal .c files that were manually doing PLT bypass for\nflockfile/funlockfile can now rely on include/stdio.h to do it for\nthem. I might split that part and commit it as a pure cleanup. I\nmight also consider splitting the \"stdio.h doesn't include libio.h\"\npart from the \"libio.h is no longer installed\" part, as that would be\nsomewhat less risky.\n\nIt passes the testsuite on x86_64-linux, but it needs a great deal of\nadditional testing; in particular I'm almost certain I broke the\nsupport for old-format (GLIBC_2.0) struct _IO_FILE, which is\nconfigured out on this target. Testing this properly would require\nsomeone to get their hands on _really_ old binaries, compiled against\nglibc 2.0, possibly statically-linked-but-using-NSS. Unfortunately,\nlibc.so cannot be expected to be binary identical.\n\nSubstantial clean-ups to the libio implementation are possible if this\nsticks, but I haven't done 'em; this is intended to be minimal.\n\nzw\n\n\t* libio/Makefile: Don't install libio.h or _G_config.h. Do install\n\tbits/types/FILE_internals.h, bits/types/cookie_io_functions_t.h,\n\tand bits/types/__fpos_t.h.\n\n\t* libio/stdio.h: Don't include libio.h. Get __gnuc_va_list\n\tdirectly from stdarg.h, __fpos_t and __fpos64_t from\n\tbits/types/__fpos_t.h, and the cookie types from\n\tbits/types/cookie_io_functions_t.h. Change all uses of\n\t_G_va_list, _G_fpos_t, _G_fpos64_t, _IO_FILE,\n\t_IO_cookie_io_functions_t, and _IO_ssize_t to __gnuc_va_list,\n\t__fpos_t, __fpos64_t, FILE, cookie_io_functions_t, and __ssize_t\n\trespectively.\n\tDo not define getc nor putc as macros.\n\tDefine BUFSIZ as literal 8192.\n\n\t* libio/bits/types/FILE_internals.h: New header. Provide complete\n\tdefinition of struct _IO_FILE (the complete version) here.\n\tDuplicate definitions of _IO_EOF_SEEN, _IO_ERR_SEEN, and _IO_USER_LOCK\n\there, with value assertions if they are already defined.\n\t* libio/bits/types/__fpos_t.h: New header. Define __fpos_t and\n\t__fpos64_t here.\n\t* libio/bits/types/cookie_io_functions_t.h: New header. Define\n\tcookie_read_function_t, cookie_write_function_t,\n\tcookie_seek_function_t, cookie_close_function_t, and\n\tcookie_io_functions_t here.\n\n\t* libio/libio.h: Include features.h first thing, then error out if\n\teither _LIBC or __USE_GNU is not defined, or if _ISOMAC is\n\tdefined. Inline all of _G_config.h except _G_HAVE_MREMAP here.\n\tGet definitions of __mbstate_t, __fpos_t, __fpos64_t, struct\n\t_IO_FILE, and the cookie-related types from the relevant\n\tbits/types headers. Get definition of NULL from stddef.h.\n\tMake all #ifdef _LIBC and #if __GNUC__ >= (2,3) blocks\n\tunconditional. Remove all #if 0 and #ifdef __cplusplus blocks.\n\tChange all uses of _G_va_list, _G_fpos_t, and _G_fpos64_t to\n\t__gnuc_va_list, __fpos_t, __fpos64_t respectively. Provide\n\tdefinitions of _STDIO_USES_IOSTREAM, __HAVE_COLUMN,\n\t_IO_file_flags, __io_read_fn, __io_write_fn, __io_seek_fn,\n\t__io_close_fn, _IO_cookie_io_functions_t for the sake of the\n\timplementation. When _IO_USE_OLD_IO_FILE is defined, define\n\tstruct _IO_FILE_old.\n\t* libio/libioP.h: When _IO_USE_OLD_IO_FILE is defined, define\n\tstruct _IO_FILE_old_plus. Only declare _IO_old_file_init_internal\n\twhen _IO_USE_OLD_IO_FILE is defined, and have it take an\n\targument of type struct _IO_FILE_old_plus.\n\t* libio/oldfileops.c: Change all uses of _IO_FILE to _IO_FILE_old,\n\t_IO_FILE_plus to _IO_FILE_old_plus, _IO_FILE_complete to _IO_FILE,\n\tand _IO_FILE_complete_plus to _IO_FILE_plus. Then adjust types\n\tto match caller/callee's expectations.\n\t* libio/oldiofdopen.c, libio/oldiofopen.c, libio/oldiopopen.c\n\t* libio/oldstdfiles.c: Likewise.\n\t* sysdeps/generic/_G_config.h, sysdeps/unix/sysv/linux/_G_config.h:\n\tOnly provide definition or non-definition of _G_HAVE_MREMAP.\n\n\t* sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c: Delete file.\n\t* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Remove iovfscanf.\n\t* sysdeps/ieee754/ldbl-opt/nldbl-compat.c: Define\n\t__nldbl__IO_vsprintf as alias to __nldbl_vsprintf instead of\n\tthe other way around.\n\t* sysdeps/ieee754/ldbl-opt/nldbl-compat.h:\n\tChange all uses of _G_va_list to __gnuc_va_list. Remove\n\tNLDBL_DECL for _IO_vfscanf.\n\t* sysdeps/ieee754/ldbl-opt/nldbl-fscanf.c\n\t* sysdeps/ieee754/ldbl-opt/nldbl-scanf.c\n\t* sysdeps/ieee754/ldbl-opt/nldbl-vfscanf.c\n\t* sysdeps/ieee754/ldbl-opt/nldbl-vscanf.c:\n\tUse __nldbl_vfscanf, not __nldbl__IO_vfscanf.\n\n\t* libio/bits/stdio.h: Add multiple-inclusion guard. Include\n\tbits/types/FILE_internals.h. Declare __uflow and __overflow here.\n\tRemove redundant __USE_EXTERN_INLINES ifdef. Change all uses of\n\t_G_va_list to __gnuc_va_list and _IO_ssize_t to __ssize_t.\n\t(getchar): Use getc, not _IO_getc.\n\t(__getc_unlocked, __putc_unlocked): New inlines, duplicating the\n\tbodies of _IO_getc_unlocked and\t_IO_putc_unlocked.\n\t(fgetc_unlocked, getc_unlocked, getchar_unlocked, fread_unlocked):\n\tUse __getc_unlocked.\n\t(fputc_unlocked, putc_unlocked, putchar_unlocked, fwrite_unlocked):\n\tUse __putc_unlocked.\n\t(feof_unlocked): Duplicate the body of _IO_feof_unlocked here.\n\t(ferror_unlocked): Duplicate the body of _IO_ferror_unlocked here.\n\t* libio/bits/stdio2.h: Change all uses of _G_va_list to __gnuc_va_list.\n\t(fread_unlocked): Use __getc_unlocked.\n\t* libio/bits/types/FILE.h, libio/bits/types/__FILE.h: Explain in\n\tcomments why the name _IO_FILE is used.\n\n\t* include/stdio.h: Change all uses of _G_va_list to __gnuc_va_list,\n\t_IO_ssize_t to __size_t, _IO_FILE to FILE, and _IO_fpos_t to __fpos_t.\n\tWhen IS_IN (libc), redirect flockfile and funlockfile to\n\t__flockfile and __funlockfile respectively.\n\tWhen _IO_MTSAFE_IO and not _ISOMAC, include stdio-lock.h before\n\tstdio.h proper.\n\t* include/stdio_ext.h: Include bits/types/FILE_internals.h for the\n\tsake of the inline definition of __fsetlocking.\n\t* include/libio.h: Adjust #ifdef nest to activate multiple-include\n\toptimization.\n\t* include/bits/types/FILE_internals.h, include/bits/types/__fpos_t.h\n\t* include/bits/types/cookie_io_functions_t.h: New trivial wrappers.\n\t* include/bits/stdio.h:\tNew wrapper; mark __uflow and __overflow\n\tas hidden for intra-libc callers.\n\n\t* csu/init.c: Include libio.h, not _G_config.h.\n\n\t* grp/fgetgrent_r.c, grp/putgrent.c, gshadow/fgetsgent_r.c\n\t* gshadow/putsgent.c, misc/getpass.c, misc/getttyent.c\n\t* misc/mntent_r.c, posix/getopt.c, pwd/fgetpwent_r.c\n\t* shadow/fgetspent_r.c, shadow/putspent.c:\n\tDon't include libio/iolibio.h. Don't redefine flockfile or\n\tfunlockfile. Don't use _IO_flockfile or _IO_funlockfile.\n\n\t* libio/__fbufsize.c, libio/__flbf.c, libio/__fpending.c\n\t* libio/__freadable.c, libio/__freading.c, libio/__fwritable.c\n\t* libio/__fwriting.c, malloc/malloc.c: Include libio.h.\n\t* misc/err.c: Include libio.h. Don't redefine flockfile or funlockfile.\n\n\t* stdio-common/tstgetln.c: Include sys/types.h. Don't redefine ssize_t.\n\t* conform/data/stdio.h-data: va_list may be defined as __gnuc_va_list,\n\tnot _G_va_list.\n\t* benchtests/strcoll-inputs/filelist#en_US.UTF-8: Remove _G_config.h.\n---\n benchtests/strcoll-inputs/filelist#en_US.UTF-8 | 2 -\n conform/data/stdio.h-data | 2 +-\n csu/init.c | 2 +-\n grp/fgetgrent_r.c | 4 -\n grp/putgrent.c | 3 -\n gshadow/fgetsgent_r.c | 8 +-\n gshadow/putsgent.c | 4 +-\n include/bits/stdio.h | 9 +\n include/bits/types/FILE_internals.h | 1 +\n include/bits/types/__fpos_t.h | 1 +\n include/bits/types/cookie_io_functions_t.h | 1 +\n include/libio.h | 18 +-\n include/stdio.h | 51 ++--\n include/stdio_ext.h | 1 +\n libio/Makefile | 7 +-\n libio/__fbufsize.c | 1 +\n libio/__flbf.c | 1 +\n libio/__fpending.c | 1 +\n libio/__freadable.c | 1 +\n libio/__freading.c | 1 +\n libio/__fwritable.c | 1 +\n libio/__fwriting.c | 1 +\n libio/bits/stdio.h | 71 ++++--\n libio/bits/stdio2.h | 31 +--\n libio/bits/types/FILE.h | 7 +-\n libio/bits/types/FILE_internals.h | 110 ++++++++\n libio/bits/types/__FILE.h | 5 +\n libio/bits/types/__fpos_t.h | 19 ++\n libio/bits/types/cookie_io_functions_t.h | 61 +++++\n libio/libio.h | 335 ++++++++++---------------\n libio/libioP.h | 13 +-\n libio/oldfileops.c | 21 +-\n libio/oldiofdopen.c | 16 +-\n libio/oldiofopen.c | 10 +-\n libio/oldiopopen.c | 12 +-\n libio/oldstdfiles.c | 10 +-\n libio/stdio.h | 82 +++---\n malloc/malloc.c | 1 +\n misc/err.c | 4 +-\n misc/getpass.c | 2 -\n misc/getttyent.c | 3 -\n misc/mntent_r.c | 3 -\n posix/getopt.c | 14 +-\n pwd/fgetpwent_r.c | 3 -\n shadow/fgetspent_r.c | 2 -\n shadow/putspent.c | 2 -\n stdio-common/tstgetln.c | 3 +-\n sysdeps/generic/_G_config.h | 54 +---\n sysdeps/ieee754/ldbl-opt/Makefile | 2 +-\n sysdeps/ieee754/ldbl-opt/nldbl-compat.c | 4 +-\n sysdeps/ieee754/ldbl-opt/nldbl-compat.h | 14 +-\n sysdeps/ieee754/ldbl-opt/nldbl-fscanf.c | 2 +-\n sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c | 8 -\n sysdeps/ieee754/ldbl-opt/nldbl-scanf.c | 2 +-\n sysdeps/ieee754/ldbl-opt/nldbl-vfscanf.c | 2 +-\n sysdeps/ieee754/ldbl-opt/nldbl-vscanf.c | 2 +-\n sysdeps/unix/sysv/linux/_G_config.h | 53 +---\n 57 files changed, 567 insertions(+), 537 deletions(-)\n create mode 100644 include/bits/stdio.h\n create mode 100644 include/bits/types/FILE_internals.h\n create mode 100644 include/bits/types/__fpos_t.h\n create mode 100644 include/bits/types/cookie_io_functions_t.h\n create mode 100644 libio/bits/types/FILE_internals.h\n create mode 100644 libio/bits/types/__fpos_t.h\n create mode 100644 libio/bits/types/cookie_io_functions_t.h\n delete mode 100644 sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c", "diff": "diff --git a/benchtests/strcoll-inputs/filelist#en_US.UTF-8 b/benchtests/strcoll-inputs/filelist#en_US.UTF-8\nindex 6cee2374f4..bdc61be3b5 100644\n--- a/benchtests/strcoll-inputs/filelist#en_US.UTF-8\n+++ b/benchtests/strcoll-inputs/filelist#en_US.UTF-8\n@@ -1370,7 +1370,6 @@ a.out.h\n semget.c\n posix_fallocate.c\n getpid.c\n-_G_config.h\n getsockopt.S\n pthread_setaffinity.c\n setipv4sourcefilter.c\n@@ -3407,7 +3406,6 @@ a.out.h\n libBrokenLocale.abilist\n machine-gmon.h\n _itoa.h\n-_G_config.h\n local-setxid.h\n dl-osinfo.h\n dl-dtprocnum.h\ndiff --git a/conform/data/stdio.h-data b/conform/data/stdio.h-data\nindex f69802cc70..3ef2460661 100644\n--- a/conform/data/stdio.h-data\n+++ b/conform/data/stdio.h-data\n@@ -41,7 +41,7 @@ type fpos_t\n #if !defined ISO && !defined ISO99 && !defined ISO11 && !defined POSIX\n type va_list\n #else\n-#define va_list _G_va_list\n+#define va_list __gnuc_va_list\n #endif\n type size_t\n #if defined XOPEN2K8 || defined POSIX2008\ndiff --git a/csu/init.c b/csu/init.c\nindex bb68386c9b..6da0a9cd47 100644\n--- a/csu/init.c\n+++ b/csu/init.c\n@@ -18,7 +18,7 @@\n \n #if defined __GNUC__ && __GNUC__ >= 2\n \n-#include <_G_config.h>\n+#include <libio.h>\n \n /* This records which stdio is linked against in the application. */\n const int _IO_stdin_used = _G_IO_IO_FILE_VERSION;\ndiff --git a/grp/fgetgrent_r.c b/grp/fgetgrent_r.c\nindex 5a4107ba9c..7bcbdfe539 100644\n--- a/grp/fgetgrent_r.c\n+++ b/grp/fgetgrent_r.c\n@@ -20,10 +20,6 @@\n #include <grp.h>\n #include <stdio.h>\n \n-#include <libio/iolibio.h>\n-#define flockfile(s) _IO_flockfile (s)\n-#define funlockfile(s) _IO_funlockfile (s)\n-\n /* Define a line parsing function using the common code\n used in the nss_files module. */\n \ndiff --git a/grp/putgrent.c b/grp/putgrent.c\nindex 5a12c70557..cd3588ded3 100644\n--- a/grp/putgrent.c\n+++ b/grp/putgrent.c\n@@ -21,9 +21,6 @@\n #include <string.h>\n #include <grp.h>\n \n-#define flockfile(s) _IO_flockfile (s)\n-#define funlockfile(s) _IO_funlockfile (s)\n-\n #define _S(x)\tx ? x : \"\"\n \n /* Write an entry to the given stream.\ndiff --git a/gshadow/fgetsgent_r.c b/gshadow/fgetsgent_r.c\nindex f1d0650333..95c21e960c 100644\n--- a/gshadow/fgetsgent_r.c\n+++ b/gshadow/fgetsgent_r.c\n@@ -38,21 +38,21 @@ __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer, size_t buflen,\n {\n char *p;\n \n- _IO_flockfile (stream);\n+ flockfile (stream);\n do\n {\n buffer[buflen - 1] = '\\xff';\n p = fgets_unlocked (buffer, buflen, stream);\n if (p == NULL && feof_unlocked (stream))\n \t{\n-\t _IO_funlockfile (stream);\n+\t funlockfile (stream);\n \t *result = NULL;\n \t __set_errno (ENOENT);\n \t return errno;\n \t}\n if (p == NULL || buffer[buflen - 1] != '\\xff')\n \t{\n-\t _IO_funlockfile (stream);\n+\t funlockfile (stream);\n \t *result = NULL;\n \t __set_errno (ERANGE);\n \t return errno;\n@@ -67,7 +67,7 @@ __fgetsgent_r (FILE *stream, struct sgrp *resbuf, char *buffer, size_t buflen,\n \t ! parse_line (buffer, (void *) resbuf, (void *) buffer, buflen,\n \t\t\t &errno));\n \n- _IO_funlockfile (stream);\n+ funlockfile (stream);\n \n *result = resbuf;\n return 0;\ndiff --git a/gshadow/putsgent.c b/gshadow/putsgent.c\nindex 4e219c478a..70063d74c2 100644\n--- a/gshadow/putsgent.c\n+++ b/gshadow/putsgent.c\n@@ -40,7 +40,7 @@ putsgent (const struct sgrp *g, FILE *stream)\n return -1;\n }\n \n- _IO_flockfile (stream);\n+ flockfile (stream);\n \n if (fprintf (stream, \"%s:%s:\", g->sg_namp, _S (g->sg_passwd)) < 0)\n ++errors;\n@@ -75,7 +75,7 @@ putsgent (const struct sgrp *g, FILE *stream)\n if (putc_unlocked ('\\n', stream) == EOF)\n ++errors;\n \n- _IO_funlockfile (stream);\n+ funlockfile (stream);\n \n return errors ? -1 : 0;\n }\ndiff --git a/include/bits/stdio.h b/include/bits/stdio.h\nnew file mode 100644\nindex 0000000000..4aebc9edf2\n--- /dev/null\n+++ b/include/bits/stdio.h\n@@ -0,0 +1,9 @@\n+#ifndef _BITS_STDIO_H\n+# include <libio/bits/stdio.h>\n+# ifndef _ISOMAC\n+\n+libc_hidden_proto (__uflow)\n+libc_hidden_proto (__overflow)\n+\n+# endif\n+#endif\ndiff --git a/include/bits/types/FILE_internals.h b/include/bits/types/FILE_internals.h\nnew file mode 100644\nindex 0000000000..a653c8101c\n--- /dev/null\n+++ b/include/bits/types/FILE_internals.h\n@@ -0,0 +1 @@\n+#include <libio/bits/types/FILE_internals.h>\ndiff --git a/include/bits/types/__fpos_t.h b/include/bits/types/__fpos_t.h\nnew file mode 100644\nindex 0000000000..2dcdc98d75\n--- /dev/null\n+++ b/include/bits/types/__fpos_t.h\n@@ -0,0 +1 @@\n+#include <libio/bits/types/__fpos_t.h>\ndiff --git a/include/bits/types/cookie_io_functions_t.h b/include/bits/types/cookie_io_functions_t.h\nnew file mode 100644\nindex 0000000000..87f7930c6e\n--- /dev/null\n+++ b/include/bits/types/cookie_io_functions_t.h\n@@ -0,0 +1 @@\n+#include <libio/bits/types/cookie_io_functions_t.h>\ndiff --git a/include/libio.h b/include/libio.h\nindex d2fa796758..54ed704bdd 100644\n--- a/include/libio.h\n+++ b/include/libio.h\n@@ -1,11 +1,9 @@\n-#if !defined _ISOMAC && defined _IO_MTSAFE_IO\n-# include <stdio-lock.h>\n-#endif\n-#include <libio/libio.h>\n-\n-#ifndef _ISOMAC\n-#ifndef _LIBC_LIBIO_H\n-#define _LIBC_LIBIO_H\n+#ifndef _IO_STDIO_H\n+# if !defined _ISOMAC && defined _IO_MTSAFE_IO\n+# include <stdio-lock.h>\n+# endif\n+# include <libio/libio.h>\n+# ifndef _ISOMAC\n \n libc_hidden_proto (__overflow)\n libc_hidden_proto (__underflow)\n@@ -41,5 +39,5 @@ libc_hidden_proto (_IO_vfscanf)\n # endif\n #endif /* _IO_MTSAFE_IO */\n \n-#endif\n-#endif\n+# endif /* !_ISOMAC */\n+#endif /* libio.h */\ndiff --git a/include/stdio.h b/include/stdio.h\nindex 509447c528..cb31621d4c 100644\n--- a/include/stdio.h\n+++ b/include/stdio.h\n@@ -1,4 +1,7 @@\n #ifndef _STDIO_H\n+# if !defined _ISOMAC && defined _IO_MTSAFE_IO\n+# include <stdio-lock.h>\n+# endif\n # include <libio/stdio.h>\n # ifndef _ISOMAC\n \n@@ -10,44 +13,44 @@ extern int __snprintf (char *__restrict __s, size_t __maxlen,\n __attribute__ ((__format__ (__printf__, 3, 4)));\n libc_hidden_proto (__snprintf)\n extern int __vsnprintf (char *__restrict __s, size_t __maxlen,\n-\t\t\tconst char *__restrict __format, _G_va_list __arg)\n+\t\t\tconst char *__restrict __format, __gnuc_va_list __arg)\n __attribute__ ((__format__ (__printf__, 3, 0)));\n extern int __vfscanf (FILE *__restrict __s,\n \t\t const char *__restrict __format,\n-\t\t _G_va_list __arg)\n+\t\t __gnuc_va_list __arg)\n __attribute__ ((__format__ (__scanf__, 2, 0)));\n libc_hidden_proto (__vfscanf)\n extern int __vscanf (const char *__restrict __format,\n-\t\t _G_va_list __arg)\n+\t\t __gnuc_va_list __arg)\n __attribute__ ((__format__ (__scanf__, 1, 0)));\n-extern _IO_ssize_t __getline (char **__lineptr, size_t *__n,\n+extern __ssize_t __getline (char **__lineptr, size_t *__n,\n \t\t\t FILE *__stream);\n extern int __vsscanf (const char *__restrict __s,\n \t\t const char *__restrict __format,\n-\t\t _G_va_list __arg)\n+\t\t __gnuc_va_list __arg)\n __attribute__ ((__format__ (__scanf__, 2, 0)));\n \n extern int __sprintf_chk (char *, int, size_t, const char *, ...) __THROW;\n extern int __snprintf_chk (char *, size_t, int, size_t, const char *, ...)\n __THROW;\n extern int __vsprintf_chk (char *, int, size_t, const char *,\n-\t\t\t _G_va_list) __THROW;\n+\t\t\t __gnuc_va_list) __THROW;\n extern int __vsnprintf_chk (char *, size_t, int, size_t, const char *,\n-\t\t\t _G_va_list) __THROW;\n+\t\t\t __gnuc_va_list) __THROW;\n extern int __printf_chk (int, const char *, ...);\n extern int __fprintf_chk (FILE *, int, const char *, ...);\n-extern int __vprintf_chk (int, const char *, _G_va_list);\n-extern int __vfprintf_chk (FILE *, int, const char *, _G_va_list);\n+extern int __vprintf_chk (int, const char *, __gnuc_va_list);\n+extern int __vfprintf_chk (FILE *, int, const char *, __gnuc_va_list);\n extern char *__fgets_unlocked_chk (char *buf, size_t size, int n, FILE *fp);\n extern char *__fgets_chk (char *buf, size_t size, int n, FILE *fp);\n extern int __asprintf_chk (char **, int, const char *, ...) __THROW;\n-extern int __vasprintf_chk (char **, int, const char *, _G_va_list) __THROW;\n+extern int __vasprintf_chk (char **, int, const char *, __gnuc_va_list) __THROW;\n extern int __dprintf_chk (int, int, const char *, ...);\n-extern int __vdprintf_chk (int, int, const char *, _G_va_list);\n+extern int __vdprintf_chk (int, int, const char *, __gnuc_va_list);\n extern int __obstack_printf_chk (struct obstack *, int, const char *, ...)\n __THROW;\n extern int __obstack_vprintf_chk (struct obstack *, int, const char *,\n-\t\t\t\t _G_va_list) __THROW;\n+\t\t\t\t __gnuc_va_list) __THROW;\n \n extern int __isoc99_fscanf (FILE *__restrict __stream,\n \t\t\t const char *__restrict __format, ...) __wur;\n@@ -56,12 +59,12 @@ extern int __isoc99_sscanf (const char *__restrict __s,\n \t\t\t const char *__restrict __format, ...) __THROW;\n extern int __isoc99_vfscanf (FILE *__restrict __s,\n \t\t\t const char *__restrict __format,\n-\t\t\t _G_va_list __arg) __wur;\n+\t\t\t __gnuc_va_list __arg) __wur;\n extern int __isoc99_vscanf (const char *__restrict __format,\n-\t\t\t _G_va_list __arg) __wur;\n+\t\t\t __gnuc_va_list __arg) __wur;\n extern int __isoc99_vsscanf (const char *__restrict __s,\n \t\t\t const char *__restrict __format,\n-\t\t\t _G_va_list __arg) __THROW;\n+\t\t\t __gnuc_va_list __arg) __THROW;\n libc_hidden_proto (__isoc99_vsscanf)\n libc_hidden_proto (__isoc99_vfscanf)\n \n@@ -106,9 +109,15 @@ libc_hidden_proto (__fortify_fail_abort)\n \n /* Acquire ownership of STREAM. */\n extern void __flockfile (FILE *__stream);\n+# if IS_IN (libc)\n+# define flockfile(stream) __flockfile(stream)\n+# endif\n \n /* Relinquish the ownership granted for STREAM. */\n extern void __funlockfile (FILE *__stream);\n+# if IS_IN (libc)\n+# define funlockfile(stream) __funlockfile(stream)\n+# endif\n \n /* Try to acquire ownership of STREAM but do not block if it is not\n possible. */\n@@ -127,18 +136,18 @@ extern int _sys_nerr_internal attribute_hidden;\n \n libc_hidden_proto (__asprintf)\n # if IS_IN (libc)\n-extern _IO_FILE *_IO_new_fopen (const char*, const char*);\n+extern FILE *_IO_new_fopen (const char*, const char*);\n # define fopen(fname, mode) _IO_new_fopen (fname, mode)\n-extern _IO_FILE *_IO_new_fdopen (int, const char*);\n+extern FILE *_IO_new_fdopen (int, const char*);\n # define fdopen(fd, mode) _IO_new_fdopen (fd, mode)\n-extern int _IO_new_fclose (_IO_FILE*);\n+extern int _IO_new_fclose (FILE*);\n # define fclose(fp) _IO_new_fclose (fp)\n-extern int _IO_fputs (const char*, _IO_FILE*);\n+extern int _IO_fputs (const char*, FILE*);\n libc_hidden_proto (_IO_fputs)\n # define fputs(str, fp) _IO_fputs (str, fp)\n-extern int _IO_new_fsetpos (_IO_FILE *, const _IO_fpos_t *);\n+extern int _IO_new_fsetpos (FILE *, const __fpos_t *);\n # define fsetpos(fp, posp) _IO_new_fsetpos (fp, posp)\n-extern int _IO_new_fgetpos (_IO_FILE *, _IO_fpos_t *);\n+extern int _IO_new_fgetpos (FILE *, __fpos_t *);\n # define fgetpos(fp, posp) _IO_new_fgetpos (fp, posp)\n # endif\n \ndiff --git a/include/stdio_ext.h b/include/stdio_ext.h\nindex 29c6e68cdb..7f8835211e 100644\n--- a/include/stdio_ext.h\n+++ b/include/stdio_ext.h\n@@ -2,6 +2,7 @@\n #include <stdio-common/stdio_ext.h>\n \n # ifndef _ISOMAC\n+# include <libio/bits/types/FILE_internals.h>\n \n libc_hidden_proto (__fsetlocking)\n \ndiff --git a/libio/Makefile b/libio/Makefile\nindex 9d09bd8b6a..52ba5664a3 100644\n--- a/libio/Makefile\n+++ b/libio/Makefile\n@@ -22,9 +22,10 @@ subdir\t:= libio\n \n include ../Makeconfig\n \n-headers\t:= stdio.h libio.h _G_config.h bits/stdio.h \\\n-\t bits/sys_errlist.h bits/stdio2.h bits/stdio-ldbl.h bits/libio-ldbl.h \\\n-\t bits/types/FILE.h bits/types/__FILE.h\n+headers := stdio.h bits/stdio.h bits/stdio2.h bits/sys_errlist.h\t \\\n+\t bits/stdio-ldbl.h bits/libio-ldbl.h\t\t\t\t \\\n+\t bits/types/FILE.h bits/types/__FILE.h bits/types/FILE_internals.h \\\n+\t bits/types/cookie_io_functions_t.h bits/types/__fpos_t.h\n \n routines\t:=\t\t\t\t\t\t\t \\\n \tfiledoalloc iofclose iofdopen iofflush iofgetpos iofgets iofopen \\\ndiff --git a/libio/__fbufsize.c b/libio/__fbufsize.c\nindex 74d2ebbe81..8c00ca7658 100644\n--- a/libio/__fbufsize.c\n+++ b/libio/__fbufsize.c\n@@ -16,6 +16,7 @@\n <http://www.gnu.org/licenses/>. */\n \n #include <stdio_ext.h>\n+#include <libio.h>\n \n size_t\n __fbufsize (FILE *fp)\ndiff --git a/libio/__flbf.c b/libio/__flbf.c\nindex 929175df70..dfa68aa2e8 100644\n--- a/libio/__flbf.c\n+++ b/libio/__flbf.c\n@@ -16,6 +16,7 @@\n <http://www.gnu.org/licenses/>. */\n \n #include <stdio_ext.h>\n+#include <libio.h>\n \n int\n __flbf (FILE *fp)\ndiff --git a/libio/__fpending.c b/libio/__fpending.c\nindex e957839985..008cf08fb4 100644\n--- a/libio/__fpending.c\n+++ b/libio/__fpending.c\n@@ -16,6 +16,7 @@\n <http://www.gnu.org/licenses/>. */\n \n #include <stdio_ext.h>\n+#include <libio.h>\n \n size_t\n __fpending (FILE *fp)\ndiff --git a/libio/__freadable.c b/libio/__freadable.c\nindex 3bde42a729..d5535e902b 100644\n--- a/libio/__freadable.c\n+++ b/libio/__freadable.c\n@@ -16,6 +16,7 @@\n <http://www.gnu.org/licenses/>. */\n \n #include <stdio_ext.h>\n+#include <libio.h>\n \n int\n __freadable (FILE *fp)\ndiff --git a/libio/__freading.c b/libio/__freading.c\nindex f16f42679f..32e26f8a6c 100644\n--- a/libio/__freading.c\n+++ b/libio/__freading.c\n@@ -16,6 +16,7 @@\n <http://www.gnu.org/licenses/>. */\n \n #include <stdio_ext.h>\n+#include <libio.h>\n \n int\n __freading (FILE *fp)\ndiff --git a/libio/__fwritable.c b/libio/__fwritable.c\nindex 1584aec68f..328e0b6b5b 100644\n--- a/libio/__fwritable.c\n+++ b/libio/__fwritable.c\n@@ -16,6 +16,7 @@\n <http://www.gnu.org/licenses/>. */\n \n #include <stdio_ext.h>\n+#include <libio.h>\n \n int\n __fwritable (FILE *fp)\ndiff --git a/libio/__fwriting.c b/libio/__fwriting.c\nindex 1769d2107e..2ec8fba1cf 100644\n--- a/libio/__fwriting.c\n+++ b/libio/__fwriting.c\n@@ -16,6 +16,7 @@\n <http://www.gnu.org/licenses/>. */\n \n #include <stdio_ext.h>\n+#include <libio.h>\n \n int\n __fwriting (FILE *fp)\ndiff --git a/libio/bits/stdio.h b/libio/bits/stdio.h\nindex 21ad2fb20c..ad77b04a4f 100644\n--- a/libio/bits/stdio.h\n+++ b/libio/bits/stdio.h\n@@ -16,24 +16,30 @@\n License along with the GNU C Library; if not, see\n <http://www.gnu.org/licenses/>. */\n \n+#ifndef _BITS_STDIO_H\n+#define _BITS_STDIO_H 1\n+\n #ifndef _STDIO_H\n # error \"Never include <bits/stdio.h> directly; use <stdio.h> instead.\"\n #endif\n \n+#include <bits/types/FILE_internals.h>\n+\n+extern int __uflow (FILE *);\n+extern int __overflow (FILE *, int);\n+\n #ifndef __extern_inline\n # define __STDIO_INLINE inline\n #else\n # define __STDIO_INLINE __extern_inline\n #endif\n \n-\n-#ifdef __USE_EXTERN_INLINES\n /* For -D_FORTIFY_SOURCE{,=2} bits/stdio2.h will define a different\n inline. */\n # if !(__USE_FORTIFY_LEVEL > 0 && defined __fortify_function)\n /* Write formatted output to stdout from argument list ARG. */\n __STDIO_INLINE int\n-vprintf (const char *__restrict __fmt, _G_va_list __arg)\n+vprintf (const char *__restrict __fmt, __gnuc_va_list __arg)\n {\n return vfprintf (stdout, __fmt, __arg);\n }\n@@ -43,33 +49,46 @@ vprintf (const char *__restrict __fmt, _G_va_list __arg)\n __STDIO_INLINE int\n getchar (void)\n {\n- return _IO_getc (stdin);\n+ return getc (stdin);\n }\n \n+#if defined __USE_MISC || defined __USE_POSIX\n+__STDIO_INLINE int\n+__getc_unlocked (FILE *__fp)\n+{\n+ char __c;\n+\n+ if (__glibc_unlikely (__fp->_IO_read_ptr >= __fp->_IO_read_end))\n+ return __uflow (__fp);\n+\n+ __c = *__fp->_IO_read_ptr++;\n+ return (unsigned char) __c;\n+}\n+#endif\n+\n \n # ifdef __USE_MISC\n /* Faster version when locking is not necessary. */\n __STDIO_INLINE int\n fgetc_unlocked (FILE *__fp)\n {\n- return _IO_getc_unlocked (__fp);\n+ return __getc_unlocked (__fp);\n }\n # endif /* misc */\n \n-\n # ifdef __USE_POSIX\n /* This is defined in POSIX.1:1996. */\n __STDIO_INLINE int\n getc_unlocked (FILE *__fp)\n {\n- return _IO_getc_unlocked (__fp);\n+ return __getc_unlocked (__fp);\n }\n \n /* This is defined in POSIX.1:1996. */\n __STDIO_INLINE int\n getchar_unlocked (void)\n {\n- return _IO_getc_unlocked (stdin);\n+ return __getc_unlocked (stdin);\n }\n # endif\t/* POSIX */\n \n@@ -78,16 +97,28 @@ getchar_unlocked (void)\n __STDIO_INLINE int\n putchar (int __c)\n {\n- return _IO_putc (__c, stdout);\n+ return putc (__c, stdout);\n }\n \n+#if defined __USE_MISC || defined __USE_POSIX\n+__STDIO_INLINE int\n+__putc_unlocked (int __c, FILE *__stream)\n+{\n+ unsigned char __cc = __c;\n+ if (__glibc_unlikely (__stream->_IO_write_ptr >= __stream->_IO_write_end))\n+ return __overflow (__stream, __cc);\n+\n+ *__stream->_IO_write_ptr++ = __cc;\n+ return __cc;\n+}\n+#endif\n \n # ifdef __USE_MISC\n /* Faster version when locking is not necessary. */\n __STDIO_INLINE int\n fputc_unlocked (int __c, FILE *__stream)\n {\n- return _IO_putc_unlocked (__c, __stream);\n+ return __putc_unlocked (__c, __stream);\n }\n # endif /* misc */\n \n@@ -97,21 +128,21 @@ fputc_unlocked (int __c, FILE *__stream)\n __STDIO_INLINE int\n putc_unlocked (int __c, FILE *__stream)\n {\n- return _IO_putc_unlocked (__c, __stream);\n+ return __putc_unlocked (__c, __stream);\n }\n \n /* This is defined in POSIX.1:1996. */\n __STDIO_INLINE int\n putchar_unlocked (int __c)\n {\n- return _IO_putc_unlocked (__c, stdout);\n+ return __putc_unlocked (__c, stdout);\n }\n # endif\t/* POSIX */\n \n \n # ifdef\t__USE_GNU\n /* Like `getdelim', but reads up to a newline. */\n-__STDIO_INLINE _IO_ssize_t\n+__STDIO_INLINE __ssize_t\n getline (char **__lineptr, size_t *__n, FILE *__stream)\n {\n return __getdelim (__lineptr, __n, '\\n', __stream);\n@@ -124,20 +155,17 @@ getline (char **__lineptr, size_t *__n, FILE *__stream)\n __STDIO_INLINE int\n __NTH (feof_unlocked (FILE *__stream))\n {\n- return _IO_feof_unlocked (__stream);\n+ return (__stream->_flags & _IO_EOF_SEEN) != 0;\n }\n \n /* Faster versions when locking is not required. */\n __STDIO_INLINE int\n __NTH (ferror_unlocked (FILE *__stream))\n {\n- return _IO_ferror_unlocked (__stream);\n+ return (__stream->_flags & _IO_ERR_SEEN) != 0;\n }\n # endif /* misc */\n \n-#endif /* Use extern inlines. */\n-\n-\n #if defined __USE_MISC && defined __GNUC__ && defined __OPTIMIZE__ \\\n && !defined __cplusplus\n /* Perform some simple optimizations. */\n@@ -151,7 +179,7 @@ __NTH (ferror_unlocked (FILE *__stream))\n \t\t for (__cnt = (size_t) (size) * (size_t) (n);\t \\\n \t\t\t __cnt > 0; --__cnt)\t\t\t\t \\\n \t\t\t {\t\t\t\t\t\t \\\n-\t\t\t int __c = _IO_getc_unlocked (__stream);\t \\\n+\t\t\t int __c = __getc_unlocked (__stream);\t \\\n \t\t\t if (__c == EOF)\t\t\t\t \\\n \t\t\t break;\t\t\t\t\t \\\n \t\t\t *__ptr++ = __c;\t\t\t\t \\\n@@ -174,7 +202,7 @@ __NTH (ferror_unlocked (FILE *__stream))\n \t\t size_t __cnt;\t\t\t\t\t \\\n \t\t for (__cnt = (size_t) (size) * (size_t) (n);\t \\\n \t\t\t __cnt > 0; --__cnt)\t\t\t\t \\\n-\t\t\t if (_IO_putc_unlocked (*__ptr++, __stream) == EOF) \\\n+\t\t\t if (__putc_unlocked (*__ptr++, __stream) == EOF) \\\n \t\t\t break;\t\t\t\t\t \\\n \t\t ((size_t) (size) * (size_t) (n) - __cnt)\t\t \\\n \t\t\t/ (size_t) (size); })\t\t\t\t \\\n@@ -186,5 +214,6 @@ __NTH (ferror_unlocked (FILE *__stream))\n \t\t : fwrite_unlocked (ptr, size, n, stream))))\n #endif\n \n-/* Define helper macro. */\n #undef __STDIO_INLINE\n+\n+#endif /* bits/stdio.h */\ndiff --git a/libio/bits/stdio2.h b/libio/bits/stdio2.h\nindex e9f9d6952b..2d5cb5c03d 100644\n--- a/libio/bits/stdio2.h\n+++ b/libio/bits/stdio2.h\n@@ -24,7 +24,7 @@ extern int __sprintf_chk (char *__restrict __s, int __flag, size_t __slen,\n \t\t\t const char *__restrict __format, ...) __THROW;\n extern int __vsprintf_chk (char *__restrict __s, int __flag, size_t __slen,\n \t\t\t const char *__restrict __format,\n-\t\t\t _G_va_list __ap) __THROW;\n+\t\t\t __gnuc_va_list __ap) __THROW;\n \n #ifdef __va_arg_pack\n __fortify_function int\n@@ -41,7 +41,7 @@ __NTH (sprintf (char *__restrict __s, const char *__restrict __fmt, ...))\n \n __fortify_function int\n __NTH (vsprintf (char *__restrict __s, const char *__restrict __fmt,\n-\t\t _G_va_list __ap))\n+\t\t __gnuc_va_list __ap))\n {\n return __builtin___vsprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,\n \t\t\t\t __bos (__s), __fmt, __ap);\n@@ -54,7 +54,7 @@ extern int __snprintf_chk (char *__restrict __s, size_t __n, int __flag,\n \t\t\t ...) __THROW;\n extern int __vsnprintf_chk (char *__restrict __s, size_t __n, int __flag,\n \t\t\t size_t __slen, const char *__restrict __format,\n-\t\t\t _G_va_list __ap) __THROW;\n+\t\t\t __gnuc_va_list __ap) __THROW;\n \n # ifdef __va_arg_pack\n __fortify_function int\n@@ -72,7 +72,7 @@ __NTH (snprintf (char *__restrict __s, size_t __n,\n \n __fortify_function int\n __NTH (vsnprintf (char *__restrict __s, size_t __n,\n-\t\t const char *__restrict __fmt, _G_va_list __ap))\n+\t\t const char *__restrict __fmt, __gnuc_va_list __ap))\n {\n return __builtin___vsnprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,\n \t\t\t\t __bos (__s), __fmt, __ap);\n@@ -86,9 +86,10 @@ extern int __fprintf_chk (FILE *__restrict __stream, int __flag,\n \t\t\t const char *__restrict __format, ...);\n extern int __printf_chk (int __flag, const char *__restrict __format, ...);\n extern int __vfprintf_chk (FILE *__restrict __stream, int __flag,\n-\t\t\t const char *__restrict __format, _G_va_list __ap);\n+\t\t\t const char *__restrict __format,\n+\t\t\t __gnuc_va_list __ap);\n extern int __vprintf_chk (int __flag, const char *__restrict __format,\n-\t\t\t _G_va_list __ap);\n+\t\t\t __gnuc_va_list __ap);\n \n # ifdef __va_arg_pack\n __fortify_function int\n@@ -111,7 +112,7 @@ printf (const char *__restrict __fmt, ...)\n # endif\n \n __fortify_function int\n-vprintf (const char *__restrict __fmt, _G_va_list __ap)\n+vprintf (const char *__restrict __fmt, __gnuc_va_list __ap)\n {\n #ifdef __USE_EXTERN_INLINES\n return __vfprintf_chk (stdout, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);\n@@ -122,7 +123,7 @@ vprintf (const char *__restrict __fmt, _G_va_list __ap)\n \n __fortify_function int\n vfprintf (FILE *__restrict __stream,\n-\t const char *__restrict __fmt, _G_va_list __ap)\n+\t const char *__restrict __fmt, __gnuc_va_list __ap)\n {\n return __vfprintf_chk (__stream, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);\n }\n@@ -131,7 +132,7 @@ vfprintf (FILE *__restrict __stream,\n extern int __dprintf_chk (int __fd, int __flag, const char *__restrict __fmt,\n \t\t\t ...) __attribute__ ((__format__ (__printf__, 3, 4)));\n extern int __vdprintf_chk (int __fd, int __flag,\n-\t\t\t const char *__restrict __fmt, _G_va_list __arg)\n+\t\t\t const char *__restrict __fmt, __gnuc_va_list __arg)\n __attribute__ ((__format__ (__printf__, 3, 0)));\n \n # ifdef __va_arg_pack\n@@ -147,7 +148,7 @@ dprintf (int __fd, const char *__restrict __fmt, ...)\n # endif\n \n __fortify_function int\n-vdprintf (int __fd, const char *__restrict __fmt, _G_va_list __ap)\n+vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __ap)\n {\n return __vdprintf_chk (__fd, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);\n }\n@@ -159,7 +160,7 @@ extern int __asprintf_chk (char **__restrict __ptr, int __flag,\n \t\t\t const char *__restrict __fmt, ...)\n __THROW __attribute__ ((__format__ (__printf__, 3, 4))) __wur;\n extern int __vasprintf_chk (char **__restrict __ptr, int __flag,\n-\t\t\t const char *__restrict __fmt, _G_va_list __arg)\n+\t\t\t const char *__restrict __fmt, __gnuc_va_list __arg)\n __THROW __attribute__ ((__format__ (__printf__, 3, 0))) __wur;\n extern int __obstack_printf_chk (struct obstack *__restrict __obstack,\n \t\t\t\t int __flag, const char *__restrict __format,\n@@ -168,7 +169,7 @@ extern int __obstack_printf_chk (struct obstack *__restrict __obstack,\n extern int __obstack_vprintf_chk (struct obstack *__restrict __obstack,\n \t\t\t\t int __flag,\n \t\t\t\t const char *__restrict __format,\n-\t\t\t\t _G_va_list __args)\n+\t\t\t\t __gnuc_va_list __args)\n __THROW __attribute__ ((__format__ (__printf__, 3, 0)));\n \n # ifdef __va_arg_pack\n@@ -205,14 +206,14 @@ __NTH (obstack_printf (struct obstack *__restrict __obstack,\n \n __fortify_function int\n __NTH (vasprintf (char **__restrict __ptr, const char *__restrict __fmt,\n-\t\t _G_va_list __ap))\n+\t\t __gnuc_va_list __ap))\n {\n return __vasprintf_chk (__ptr, __USE_FORTIFY_LEVEL - 1, __fmt, __ap);\n }\n \n __fortify_function int\n __NTH (obstack_vprintf (struct obstack *__restrict __obstack,\n-\t\t\tconst char *__restrict __fmt, _G_va_list __ap))\n+\t\t\tconst char *__restrict __fmt, __gnuc_va_list __ap))\n {\n return __obstack_vprintf_chk (__obstack, __USE_FORTIFY_LEVEL - 1, __fmt,\n \t\t\t\t__ap);\n@@ -368,7 +369,7 @@ fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n,\n \n for (; __cnt > 0; --__cnt)\n \t{\n-\t int __c = _IO_getc_unlocked (__stream);\n+\t int __c = __getc_unlocked (__stream);\n \t if (__c == EOF)\n \t break;\n \t *__cptr++ = __c;\ndiff --git a/libio/bits/types/FILE.h b/libio/bits/types/FILE.h\nindex f268263209..de02a9d75b 100644\n--- a/libio/bits/types/FILE.h\n+++ b/libio/bits/types/FILE.h\n@@ -1,9 +1,12 @@\n #ifndef __FILE_defined\n #define __FILE_defined 1\n \n-struct _IO_FILE;\n+/* Note: the struct tag is _IO_FILE rather than __FILE for historical\n+ reasons. It potentially appears in C++ mangled names and therefore\n+ cannot be changed. This file must be kept in sync with __FILE.h and\n+ FILE_internals.h. */\n \n-/* The opaque type of streams. This is the definition used elsewhere. */\n+struct _IO_FILE;\n typedef struct _IO_FILE FILE;\n \n #endif\ndiff --git a/libio/bits/types/FILE_internals.h b/libio/bits/types/FILE_internals.h\nnew file mode 100644\nindex 0000000000..5f88b4c6a1\n--- /dev/null\n+++ b/libio/bits/types/FILE_internals.h\n@@ -0,0 +1,110 @@\n+/* Internal structure of a FILE object.\n+ Copyright (C) 1991-2017 Free Software Foundation, Inc.\n+ This file is part of the GNU C Library.\n+ Written by Per Bothner <bothner@cygnus.com>.\n+\n+ The GNU C Library is free software; you can redistribute it and/or\n+ modify it under the terms of the GNU Lesser General Public\n+ License as published by the Free Software Foundation; either\n+ version 2.1 of the License, or (at your option) any later version.\n+\n+ The GNU C Library is distributed in the hope that it will be useful,\n+ but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+ Lesser General Public License for more details.\n+\n+ You should have received a copy of the GNU Lesser General Public\n+ License along with the GNU C Library; if not, see\n+ <http://www.gnu.org/licenses/>. */\n+\n+\n+#ifndef _FILE_internals_defined\n+#define _FILE_internals_defined 1\n+\n+/* This file exposes just enough of the internal structure of a FILE\n+ object to permit the optimizations in bits/stdio.h.\n+\n+ Note: the _IO_ prefixes on struct tags and field names are for\n+ historical reasons. The GNU C Library no longer supports the\n+ \"libio\" extension to stdio.\n+\n+ This file must be kept in sync with __FILE.h, FILE.h, and internal\n+ headers. */\n+\n+#include <bits/types.h>\n+\n+/* During the build of glibc itself, _IO_lock_t will already have been\n+ defined by internal headers. */\n+#ifndef _IO_lock_t_defined\n+typedef void _IO_lock_t;\n+#define _IO_lock_t_defined 1\n+#endif\n+\n+struct _IO_marker;\n+struct _IO_codecvt;\n+struct _IO_wide_data;\n+\n+struct _IO_FILE\n+{\n+ int _flags;\t\t/* High-order word is _IO_MAGIC; rest is flags. */\n+ /* The following pointers correspond to the C++ streambuf protocol. */\n+ char* _IO_read_ptr;\t/* Current read pointer */\n+ char* _IO_read_end;\t/* End of get area. */\n+ char* _IO_read_base;\t/* Start of putback+get area. */\n+ char* _IO_write_base;\t/* Start of put area. */\n+ char* _IO_write_ptr;\t/* Current put pointer. */\n+ char* _IO_write_end;\t/* End of put area. */\n+ char* _IO_buf_base;\t/* Start of reserve area. */\n+ char* _IO_buf_end;\t/* End of reserve area. */\n+ /* The following fields are used to support backing up and undo. */\n+ char *_IO_save_base; /* Pointer to start of non-current get area. */\n+ char *_IO_backup_base; /* Pointer to first valid character of backup area */\n+ char *_IO_save_end; /* Pointer to end of non-current get area. */\n+\n+ struct _IO_marker *_markers;\n+\n+ struct _IO_FILE *_chain;\n+\n+ int _fileno;\n+ int _flags2;\n+ __off_t _old_offset; /* This used to be _offset but it's too small. */\n+\n+ /* 1+column number of pbase(); 0 is unknown. */\n+ unsigned short _cur_column;\n+ signed char _vtable_offset;\n+ char _shortbuf[1];\n+ _IO_lock_t *_lock;\n+\n+ /* Fields below this point are not present in the \"old\" FILE structure. */\n+ __off64_t _offset;\n+ struct _IO_codecvt *_codecvt;\n+ struct _IO_wide_data *_wide_data;\n+ struct _IO_FILE *_freeres_list;\n+ void *_freeres_buf;\n+ size_t __pad5;\n+ int _mode;\n+\n+ /* Make sure we don't get into trouble again. */\n+ char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];\n+};\n+\n+/* Many more flags are defined internally. */\n+#ifndef _IO_EOF_SEEN\n+# define _IO_EOF_SEEN 0x10\n+#elif _IO_EOF_SEEN != 0x10\n+# error \"FILE_internals.h out of sync with libio.h (_IO_EOF_SEEN)\"\n+#endif\n+\n+#ifndef _IO_ERR_SEEN\n+# define _IO_ERR_SEEN 0x20\n+#elif _IO_ERR_SEEN != 0x20\n+# error \"FILE_internals.h out of sync with libio.h (_IO_ERR_SEEN)\"\n+#endif\n+\n+#ifndef _IO_USER_LOCK\n+# define _IO_USER_LOCK 0x8000\n+#elif _IO_USER_LOCK != 0x8000\n+# error \"FILE_internals.h out of sync with libio.h (_IO_USER_LOCK)\"\n+#endif\n+\n+#endif\ndiff --git a/libio/bits/types/__FILE.h b/libio/bits/types/__FILE.h\nindex 06dd79bc83..5e8a9096f0 100644\n--- a/libio/bits/types/__FILE.h\n+++ b/libio/bits/types/__FILE.h\n@@ -1,6 +1,11 @@\n #ifndef ____FILE_defined\n #define ____FILE_defined 1\n \n+/* Note: the struct tag is _IO_FILE rather than __FILE for historical\n+ reasons. It potentially appears in C++ mangled names and therefore\n+ cannot be changed. This file must be kept in sync with FILE.h and\n+ FILE_internals.h. */\n+\n struct _IO_FILE;\n typedef struct _IO_FILE __FILE;\n \ndiff --git a/libio/bits/types/__fpos_t.h b/libio/bits/types/__fpos_t.h\nnew file mode 100644\nindex 0000000000..032a8f12ba\n--- /dev/null\n+++ b/libio/bits/types/__fpos_t.h\n@@ -0,0 +1,19 @@\n+#ifndef __fpos_t_defined\n+#define __fpos_t_defined 1\n+\n+#include <bits/types.h>\n+#include <bits/types/__mbstate_t.h>\n+\n+typedef struct\n+{\n+ __off_t __pos;\n+ __mbstate_t __state;\n+} __fpos_t;\n+\n+typedef struct\n+{\n+ __off64_t __pos;\n+ __mbstate_t __state;\n+} __fpos64_t;\n+\n+#endif\ndiff --git a/libio/bits/types/cookie_io_functions_t.h b/libio/bits/types/cookie_io_functions_t.h\nnew file mode 100644\nindex 0000000000..c29a46e019\n--- /dev/null\n+++ b/libio/bits/types/cookie_io_functions_t.h\n@@ -0,0 +1,61 @@\n+/* Types for fopencookie.\n+ Copyright (C) 1991-2017 Free Software Foundation, Inc.\n+ This file is part of the GNU C Library.\n+\n+ The GNU C Library is free software; you can redistribute it and/or\n+ modify it under the terms of the GNU Lesser General Public\n+ License as published by the Free Software Foundation; either\n+ version 2.1 of the License, or (at your option) any later version.\n+\n+ The GNU C Library is distributed in the hope that it will be useful,\n+ but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+ Lesser General Public License for more details.\n+\n+ You should have received a copy of the GNU Lesser General Public\n+ License along with the GNU C Library; if not, see\n+ <http://www.gnu.org/licenses/>. */\n+\n+#ifndef __cookie_io_functions_t_defined\n+#define __cookie_io_functions_t_defined 1\n+\n+#include <bits/types.h>\n+\n+#define __need_size_t\n+#include <stddef.h>\n+\n+/* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF.\n+ Return number of bytes read. */\n+typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf,\n+\t\t\t\t\t size_t __nbytes);\n+\n+/* Write N bytes pointed to by BUF to COOKIE. Write all N bytes\n+ unless there is an error. Return number of bytes written. If\n+ there is an error, return 0 and do not write anything. If the file\n+ has been opened for append (__mode.__append set), then set the file\n+ pointer to the end of the file and then do the write; if not, just\n+ write at the current file pointer. */\n+typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf,\n+\t\t\t\t\t size_t __n);\n+\n+/* Move COOKIE's file position to *POS bytes from the\n+ beginning of the file (if W is SEEK_SET),\n+ the current position (if W is SEEK_CUR),\n+ or the end of the file (if W is SEEK_END).\n+ Set *POS to the new file position.\n+ Returns zero if successful, nonzero if not. */\n+typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w);\n+\n+/* Close COOKIE. */\n+typedef int cookie_close_function_t (void *__cookie);\n+\n+/* The structure with the cookie function pointers. */\n+typedef struct\n+{\n+ cookie_read_function_t *read;\t\t/* Read bytes. */\n+ cookie_write_function_t *write;\t/* Write bytes. */\n+ cookie_seek_function_t *seek;\t\t/* Seek/tell file position. */\n+ cookie_close_function_t *close;\t/* Close file. */\n+} cookie_io_functions_t;\n+\n+#endif /* cookie_io_functions_t.h */\ndiff --git a/libio/libio.h b/libio/libio.h\nindex 14bcb92332..05cfa4a581 100644\n--- a/libio/libio.h\n+++ b/libio/libio.h\n@@ -28,10 +28,54 @@\n #ifndef _IO_STDIO_H\n #define _IO_STDIO_H\n \n+#include <features.h>\n+\n+#if !defined _LIBC || !defined __USE_GNU || defined _ISOMAC\n+# error \"libio.h is private to the stdio implementation\"\n+#endif\n+\n+/* Former configuration parameters for standalone libio. Most of\n+ these are fixed for the GNU C library. */\n+\n+#include <bits/types.h>\n+\n+#define __need_size_t\n+#define __need_wchar_t\n+#define __need_NULL\n+#include <stddef.h>\n+\n+#define __need___va_list\n+#include <stdarg.h>\n+\n+#include <bits/types/__mbstate_t.h>\n+#include <bits/types/__fpos_t.h>\n+#include <bits/types/wint_t.h>\n+\n+#include <gconv.h>\n+typedef union\n+{\n+ struct __gconv_info __cd;\n+ struct\n+ {\n+ struct __gconv_info __cd;\n+ struct __gconv_step_data __data;\n+ } __combined;\n+} _G_iconv_t;\n+\n+#define _G_HAVE_MMAP 1\n+#define _G_IO_IO_FILE_VERSION 0x20001\n+\n+/* This is defined by <bits/stat.h> if `st_blksize' exists. */\n+#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)\n+\n+/* This must match the definition of BUFSIZ in stdio.h. */\n+#define _G_BUFSIZ 8192\n+\n+/* Allow ports to override the above if absolutely necessary. */\n #include <_G_config.h>\n-/* ALL of these should be defined in _G_config.h */\n-#define _IO_fpos_t _G_fpos_t\n-#define _IO_fpos64_t _G_fpos64_t\n+\n+#define _IO_fpos_t __fpos_t\n+#define _IO_fpos64_t __fpos64_t\n #define _IO_size_t size_t\n #define _IO_ssize_t __ssize_t\n #define _IO_off_t __off_t\n@@ -41,38 +85,17 @@\n #define _IO_iconv_t _G_iconv_t\n #define _IO_HAVE_ST_BLKSIZE _G_HAVE_ST_BLKSIZE\n #define _IO_BUFSIZ _G_BUFSIZ\n-#define _IO_va_list _G_va_list\n+#define _IO_va_list __gnuc_va_list\n #define _IO_wint_t wint_t\n \n-/* This define avoids name pollution if we're using GNU stdarg.h */\n-#define __need___va_list\n-#include <stdarg.h>\n-#ifdef __GNUC_VA_LIST\n-# undef _IO_va_list\n-# define _IO_va_list __gnuc_va_list\n-#endif /* __GNUC_VA_LIST */\n-\n-#ifndef __P\n-# include <sys/cdefs.h>\n-#endif /*!__P*/\n-\n+/* Backward compatibility */\n+#define _STDIO_USES_IOSTREAM 1\n #define _IO_UNIFIED_JUMPTABLES 1\n+#define __HAVE_COLUMN 1\n \n #ifndef EOF\n # define EOF (-1)\n #endif\n-#ifndef NULL\n-# if defined __GNUG__ && \\\n- (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))\n-# define NULL (__null)\n-# else\n-# if !defined(__cplusplus)\n-# define NULL ((void*)0)\n-# else\n-# define NULL (0)\n-# endif\n-# endif\n-#endif\n \n #define _IOS_INPUT\t1\n #define _IOS_OUTPUT\t2\n@@ -111,16 +134,12 @@\n \n #define _IO_FLAGS2_MMAP 1\n #define _IO_FLAGS2_NOTCANCEL 2\n-#ifdef _LIBC\n-# define _IO_FLAGS2_FORTIFY 4\n-#endif\n+#define _IO_FLAGS2_FORTIFY 4\n #define _IO_FLAGS2_USER_WBUF 8\n-#ifdef _LIBC\n-# define _IO_FLAGS2_SCANF_STD 16\n-# define _IO_FLAGS2_NOCLOSE 32\n-# define _IO_FLAGS2_CLOEXEC 64\n-# define _IO_FLAGS2_NEED_LOCK 128\n-#endif\n+#define _IO_FLAGS2_SCANF_STD 16\n+#define _IO_FLAGS2_NOCLOSE 32\n+#define _IO_FLAGS2_CLOEXEC 64\n+#define _IO_FLAGS2_NEED_LOCK 128\n \n /* These are \"formatting flags\" matching the iostream fmtflags enum values. */\n #define _IO_SKIPWS 01\n@@ -142,34 +161,67 @@\n #define _IO_BOOLALPHA 0200000\n \n \n-struct _IO_jump_t; struct _IO_FILE;\n+struct _IO_jump_t;\n+struct _IO_FILE;\n+struct _IO_FILE_plus;\n+typedef struct _IO_FILE _IO_FILE;\n \n-/* During the build of glibc itself, _IO_lock_t will already have been\n- defined by internal headers. */\n-#ifndef _IO_lock_t_defined\n-typedef void _IO_lock_t;\n+#include <bits/types/__FILE.h>\n+#include <bits/types/FILE.h>\n+#include <bits/types/FILE_internals.h>\n+#define _IO_file_flags _flags /* Compatibility. */\n+\n+#ifdef _IO_USE_OLD_IO_FILE\n+/* This structure is a proper prefix of the _IO_FILE structure defined\n+ in FILE_internals.h. */\n+struct _IO_FILE_old\n+{\n+ int _flags;\t\t/* High-order word is _IO_MAGIC; rest is flags. */\n+\n+ /* The following pointers correspond to the C++ streambuf protocol. */\n+ /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */\n+ char* _IO_read_ptr;\t/* Current read pointer */\n+ char* _IO_read_end;\t/* End of get area. */\n+ char* _IO_read_base;\t/* Start of putback+get area. */\n+ char* _IO_write_base;\t/* Start of put area. */\n+ char* _IO_write_ptr;\t/* Current put pointer. */\n+ char* _IO_write_end;\t/* End of put area. */\n+ char* _IO_buf_base;\t/* Start of reserve area. */\n+ char* _IO_buf_end;\t/* End of reserve area. */\n+ /* The following fields are used to support backing up and undo. */\n+ char *_IO_save_base; /* Pointer to start of non-current get area. */\n+ char *_IO_backup_base; /* Pointer to first valid character of backup area */\n+ char *_IO_save_end; /* Pointer to end of non-current get area. */\n+\n+ struct _IO_marker *_markers;\n+\n+ struct _IO_FILE *_chain;\n+\n+ int _fileno;\n+ int _flags2;\n+ _IO_off_t _old_offset; /* This used to be _offset but it's too small. */\n+\n+ /* 1+column number of pbase(); 0 is unknown. */\n+ unsigned short _cur_column;\n+ signed char _vtable_offset;\n+ char _shortbuf[1];\n+\n+ /* char* _save_gptr; char* _save_egptr; */\n+\n+ _IO_lock_t *_lock;\n+};\n #endif\n \n-\n /* A streammarker remembers a position in a buffer. */\n \n-struct _IO_marker {\n+struct _IO_marker\n+{\n struct _IO_marker *_next;\n struct _IO_FILE *_sbuf;\n /* If _pos >= 0\n it points to _buf->Gbase()+_pos. FIXME comment */\n /* if _pos < 0, it points to _buf->eBptr()+_pos. FIXME comment */\n int _pos;\n-#if 0\n- void set_streampos(streampos sp) { _spos = sp; }\n- void set_offset(int offset) { _pos = offset; _spos = (streampos)(-2); }\n- public:\n- streammarker(streambuf *sb);\n- ~streammarker();\n- int saving() { return _spos == -2; }\n- int delta(streammarker&);\n- int delta();\n-#endif\n };\n \n /* This is the structure from the libstdc++ codecvt class. */\n@@ -181,7 +233,6 @@ enum __codecvt_result\n __codecvt_noconv\n };\n \n-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n /* The order of the elements in the following struct must match the order\n of the virtual functions in the libstdc++ codecvt class. */\n struct _IO_codecvt\n@@ -236,166 +287,40 @@ struct _IO_wide_data\n \n const struct _IO_jump_t *_wide_vtable;\n };\n-#endif\n \n-struct _IO_FILE {\n- int _flags;\t\t/* High-order word is _IO_MAGIC; rest is flags. */\n-#define _IO_file_flags _flags\n-\n- /* The following pointers correspond to the C++ streambuf protocol. */\n- /* Note: Tk uses the _IO_read_ptr and _IO_read_end fields directly. */\n- char* _IO_read_ptr;\t/* Current read pointer */\n- char* _IO_read_end;\t/* End of get area. */\n- char* _IO_read_base;\t/* Start of putback+get area. */\n- char* _IO_write_base;\t/* Start of put area. */\n- char* _IO_write_ptr;\t/* Current put pointer. */\n- char* _IO_write_end;\t/* End of put area. */\n- char* _IO_buf_base;\t/* Start of reserve area. */\n- char* _IO_buf_end;\t/* End of reserve area. */\n- /* The following fields are used to support backing up and undo. */\n- char *_IO_save_base; /* Pointer to start of non-current get area. */\n- char *_IO_backup_base; /* Pointer to first valid character of backup area */\n- char *_IO_save_end; /* Pointer to end of non-current get area. */\n-\n- struct _IO_marker *_markers;\n-\n- struct _IO_FILE *_chain;\n-\n- int _fileno;\n-#if 0\n- int _blksize;\n-#else\n- int _flags2;\n-#endif\n- _IO_off_t _old_offset; /* This used to be _offset but it's too small. */\n-\n-#define __HAVE_COLUMN /* temporary */\n- /* 1+column number of pbase(); 0 is unknown. */\n- unsigned short _cur_column;\n- signed char _vtable_offset;\n- char _shortbuf[1];\n-\n- /* char* _save_gptr; char* _save_egptr; */\n-\n- _IO_lock_t *_lock;\n-#ifdef _IO_USE_OLD_IO_FILE\n-};\n-\n-struct _IO_FILE_complete\n-{\n- struct _IO_FILE _file;\n-#endif\n-#if defined _G_IO_IO_FILE_VERSION && _G_IO_IO_FILE_VERSION == 0x20001\n- _IO_off64_t _offset;\n-# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n- /* Wide character stream stuff. */\n- struct _IO_codecvt *_codecvt;\n- struct _IO_wide_data *_wide_data;\n- struct _IO_FILE *_freeres_list;\n- void *_freeres_buf;\n-# else\n- void *__pad1;\n- void *__pad2;\n- void *__pad3;\n- void *__pad4;\n-# endif\n- size_t __pad5;\n- int _mode;\n- /* Make sure we don't get into trouble again. */\n- char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];\n-#endif\n-};\n-\n-#ifndef __cplusplus\n-typedef struct _IO_FILE _IO_FILE;\n-#endif\n-\n-struct _IO_FILE_plus;\n \n extern struct _IO_FILE_plus _IO_2_1_stdin_;\n extern struct _IO_FILE_plus _IO_2_1_stdout_;\n extern struct _IO_FILE_plus _IO_2_1_stderr_;\n-#ifndef _LIBC\n-#define _IO_stdin ((_IO_FILE*)(&_IO_2_1_stdin_))\n-#define _IO_stdout ((_IO_FILE*)(&_IO_2_1_stdout_))\n-#define _IO_stderr ((_IO_FILE*)(&_IO_2_1_stderr_))\n-#else\n extern _IO_FILE *_IO_stdin attribute_hidden;\n extern _IO_FILE *_IO_stdout attribute_hidden;\n extern _IO_FILE *_IO_stderr attribute_hidden;\n-#endif\n-\n \n /* Functions to do I/O and file management for a stream. */\n+#include <bits/types/cookie_io_functions_t.h>\n \n-/* Read NBYTES bytes from COOKIE into a buffer pointed to by BUF.\n- Return number of bytes read. */\n-typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);\n+/* Legacy internal names for cookie I/O types. */\n+typedef cookie_read_function_t __io_read_fn;\n+typedef cookie_write_function_t __io_write_fn;\n+typedef cookie_seek_function_t __io_seek_fn;\n+typedef cookie_close_function_t __io_close_fn;\n \n-/* Write N bytes pointed to by BUF to COOKIE. Write all N bytes\n- unless there is an error. Return number of bytes written. If\n- there is an error, return 0 and do not write anything. If the file\n- has been opened for append (__mode.__append set), then set the file\n- pointer to the end of the file and then do the write; if not, just\n- write at the current file pointer. */\n-typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf,\n-\t\t\t\t size_t __n);\n-\n-/* Move COOKIE's file position to *POS bytes from the\n- beginning of the file (if W is SEEK_SET),\n- the current position (if W is SEEK_CUR),\n- or the end of the file (if W is SEEK_END).\n- Set *POS to the new file position.\n- Returns zero if successful, nonzero if not. */\n-typedef int __io_seek_fn (void *__cookie, _IO_off64_t *__pos, int __w);\n-\n-/* Close COOKIE. */\n-typedef int __io_close_fn (void *__cookie);\n-\n-\n-#ifdef __USE_GNU\n-/* User-visible names for the above. */\n-typedef __io_read_fn cookie_read_function_t;\n-typedef __io_write_fn cookie_write_function_t;\n-typedef __io_seek_fn cookie_seek_function_t;\n-typedef __io_close_fn cookie_close_function_t;\n-\n-/* The structure with the cookie function pointers. */\n-typedef struct\n-{\n- __io_read_fn *read;\t\t/* Read bytes. */\n- __io_write_fn *write;\t\t/* Write bytes. */\n- __io_seek_fn *seek;\t\t/* Seek/tell file position. */\n- __io_close_fn *close;\t\t/* Close file. */\n-} _IO_cookie_io_functions_t;\n-typedef _IO_cookie_io_functions_t cookie_io_functions_t;\n+typedef cookie_io_functions_t _IO_cookie_io_functions_t;\n \n struct _IO_cookie_file;\n \n /* Initialize one of those. */\n extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,\n \t\t\t void *__cookie, _IO_cookie_io_functions_t __fns);\n-#endif\n-\n-\n-#ifdef __cplusplus\n-extern \"C\" {\n-#endif\n \n extern int __underflow (_IO_FILE *);\n extern int __uflow (_IO_FILE *);\n extern int __overflow (_IO_FILE *, int);\n-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n extern _IO_wint_t __wunderflow (_IO_FILE *);\n extern _IO_wint_t __wuflow (_IO_FILE *);\n extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t);\n-#endif\n \n-#if __GNUC__ >= 3\n-# define _IO_BE(expr, res) __builtin_expect ((expr), res)\n-#else\n-# define _IO_BE(expr, res) (expr)\n-#endif\n+#define _IO_BE(expr, res) __builtin_expect ((expr), res)\n \n #define _IO_getc_unlocked(_fp) \\\n (_IO_BE ((_fp)->_IO_read_ptr >= (_fp)->_IO_read_end, 0) \\\n@@ -409,7 +334,6 @@ extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t);\n ? __overflow (_fp, (unsigned char) (_ch)) \\\n : (unsigned char) (*(_fp)->_IO_write_ptr++ = (_ch)))\n \n-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n # define _IO_getwc_unlocked(_fp) \\\n (_IO_BE ((_fp)->_wide_data == NULL\t\t\t\t\t\\\n \t || ((_fp)->_wide_data->_IO_read_ptr\t\t\t\t\\\n@@ -421,7 +345,6 @@ extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t);\n \t >= (_fp)->_wide_data->_IO_write_end), 0)\t\t\t\\\n ? __woverflow (_fp, _wch)\t\t\t\t\t\t\\\n : (_IO_wint_t) (*(_fp)->_wide_data->_IO_write_ptr++ = (_wch)))\n-#endif\n \n #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)\n #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)\n@@ -467,28 +390,28 @@ extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int);\n \n extern void _IO_free_backup_area (_IO_FILE *) __THROW;\n \n-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n extern _IO_wint_t _IO_getwc (_IO_FILE *__fp);\n extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp);\n extern int _IO_fwide (_IO_FILE *__fp, int __mode) __THROW;\n-# if __GNUC__ >= 2\n+\n /* While compiling glibc we have to handle compatibility with very old\n versions. */\n-# if defined _LIBC && defined SHARED\n-# include <shlib-compat.h>\n-# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)\n-# define _IO_fwide_maybe_incompatible \\\n+#if defined SHARED\n+# include <shlib-compat.h>\n+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_1)\n+# define _IO_fwide_maybe_incompatible \\\n (__builtin_expect (&_IO_stdin_used == NULL, 0))\n extern const int _IO_stdin_used;\n weak_extern (_IO_stdin_used);\n-# endif\n-# endif\n-# ifndef _IO_fwide_maybe_incompatible\n-# define _IO_fwide_maybe_incompatible (0)\n-# endif\n+# endif\n+#endif\n+#ifndef _IO_fwide_maybe_incompatible\n+# define _IO_fwide_maybe_incompatible (0)\n+#endif\n+\n /* A special optimized version of the function above. It optimizes the\n case of initializing an unoriented byte stream. */\n-# define _IO_fwide(__fp, __mode) \\\n+#define _IO_fwide(__fp, __mode) \\\n ({ int __result = (__mode);\t\t\t\t\t\t \\\n if (__result < 0 && ! _IO_fwide_maybe_incompatible)\t\t \\\n {\t\t\t\t\t\t\t\t \\\n@@ -502,7 +425,6 @@ weak_extern (_IO_stdin_used);\n else\t\t\t\t\t\t\t\t \\\n __result = _IO_fwide (__fp, __result);\t\t\t\t \\\n __result; })\n-# endif\n \n extern int _IO_vfwscanf (_IO_FILE * __restrict, const wchar_t * __restrict,\n \t\t\t _IO_va_list, int *__restrict);\n@@ -510,14 +432,9 @@ extern int _IO_vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict,\n \t\t\t _IO_va_list);\n extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t);\n extern void _IO_free_wbackup_area (_IO_FILE *) __THROW;\n-#endif\n \n #ifdef __LDBL_COMPAT\n # include <bits/libio-ldbl.h>\n #endif\n \n-#ifdef __cplusplus\n-}\n-#endif\n-\n #endif /* _IO_STDIO_H */\ndiff --git a/libio/libioP.h b/libio/libioP.h\nindex 1832b44cc7..f41edf4556 100644\n--- a/libio/libioP.h\n+++ b/libio/libioP.h\n@@ -347,12 +347,9 @@ struct _IO_FILE_plus\n };\n \n #ifdef _IO_USE_OLD_IO_FILE\n-/* This structure is used by the compatibility code as if it were an\n- _IO_FILE_plus, but has enough space to initialize the _mode argument\n- of an _IO_FILE_complete. */\n-struct _IO_FILE_complete_plus\n+struct _IO_FILE_old_plus\n {\n- struct _IO_FILE_complete file;\n+ struct _IO_FILE_old file;\n const struct _IO_jump_t *vtable;\n };\n #endif\n@@ -625,13 +622,15 @@ extern _IO_off64_t _IO_new_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);\n extern _IO_ssize_t _IO_new_file_write (_IO_FILE *, const void *, _IO_ssize_t);\n extern _IO_size_t _IO_new_file_xsputn (_IO_FILE *, const void *, _IO_size_t);\n \n+#ifdef _IO_USE_OLD_IO_FILE\n+extern void _IO_old_file_init_internal (struct _IO_FILE_old_plus *)\n+ __THROW attribute_hidden;\n+#endif\n extern _IO_FILE* _IO_old_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);\n extern _IO_off64_t _IO_old_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);\n extern _IO_size_t _IO_old_file_xsputn (_IO_FILE *, const void *, _IO_size_t);\n extern int _IO_old_file_underflow (_IO_FILE *);\n extern int _IO_old_file_overflow (_IO_FILE *, int);\n-extern void _IO_old_file_init_internal (struct _IO_FILE_plus *)\n- __THROW attribute_hidden;\n extern _IO_FILE* _IO_old_file_attach (_IO_FILE *, int);\n extern _IO_FILE* _IO_old_file_fopen (_IO_FILE *, const char *, const char *);\n extern _IO_ssize_t _IO_old_file_write (_IO_FILE *, const void *, _IO_ssize_t);\ndiff --git a/libio/oldfileops.c b/libio/oldfileops.c\nindex 2eceefa68a..db112c88f6 100644\n--- a/libio/oldfileops.c\n+++ b/libio/oldfileops.c\n@@ -114,7 +114,7 @@ extern int errno;\n \n void\n attribute_compat_text_section\n-_IO_old_file_init_internal (struct _IO_FILE_plus *fp)\n+_IO_old_file_init_internal (struct _IO_FILE_old_plus *fp)\n {\n /* POSIX.1 allows another file handle to be used to change the position\n of our file descriptor. Hence we actually don't know the actual\n@@ -122,25 +122,25 @@ _IO_old_file_init_internal (struct _IO_FILE_plus *fp)\n fp->file._old_offset = _IO_pos_BAD;\n fp->file._IO_file_flags |= CLOSED_FILEBUF_FLAGS;\n \n- _IO_link_in (fp);\n- fp->file._vtable_offset = ((int) sizeof (struct _IO_FILE)\n-\t\t\t - (int) sizeof (struct _IO_FILE_complete));\n+ _IO_link_in ((struct _IO_FILE_plus *)fp);\n+ fp->file._vtable_offset = ((int) sizeof (struct _IO_FILE_old)\n+\t\t\t - (int) sizeof (struct _IO_FILE));\n fp->file._fileno = -1;\n \n #if defined SHARED && defined _LIBC\n if (__builtin_expect (&_IO_stdin_used != NULL, 1)\n- || (fp != (struct _IO_FILE_plus *) _IO_stdin\n-\t && fp != (struct _IO_FILE_plus *) _IO_stdout\n-\t && fp != (struct _IO_FILE_plus *) _IO_stderr))\n+ || (fp != (struct _IO_FILE_old_plus *) _IO_stdin\n+\t && fp != (struct _IO_FILE_old_plus *) _IO_stdout\n+\t && fp != (struct _IO_FILE_old_plus *) _IO_stderr))\n /* The object is dynamically allocated and large enough. Initialize\n the _mode element as well. */\n- ((struct _IO_FILE_complete *) fp)->_mode = -1;\n+ ((struct _IO_FILE *) fp)->_mode = -1;\n #endif\n }\n \n void\n attribute_compat_text_section\n-_IO_old_file_init (struct _IO_FILE_plus *fp)\n+_IO_old_file_init (struct _IO_FILE_old_plus *fp)\n {\n IO_set_accept_foreign_vtables (&_IO_vtable_check);\n _IO_old_file_init_internal (fp);\n@@ -189,7 +189,8 @@ _IO_old_file_finish (_IO_FILE *fp, int dummy)\n \n _IO_FILE *\n attribute_compat_text_section\n-_IO_old_file_fopen (_IO_FILE *fp, const char *filename, const char *mode)\n+_IO_old_file_fopen (_IO_FILE *fp,\n+ const char *filename, const char *mode)\n {\n int oflags = 0, omode;\n int read_write, fdesc;\ndiff --git a/libio/oldiofdopen.c b/libio/oldiofdopen.c\nindex 7f6180767e..166c78933f 100644\n--- a/libio/oldiofdopen.c\n+++ b/libio/oldiofdopen.c\n@@ -44,7 +44,7 @@ _IO_old_fdopen (int fd, const char *mode)\n int posix_mode = 0;\n struct locked_FILE\n {\n- struct _IO_FILE_complete_plus fp;\n+ struct _IO_FILE_plus fp;\n #ifdef _IO_MTSAFE_IO\n _IO_lock_t lock;\n #endif\n@@ -108,23 +108,23 @@ _IO_old_fdopen (int fd, const char *mode)\n if (new_f == NULL)\n return NULL;\n #ifdef _IO_MTSAFE_IO\n- new_f->fp.file._file._lock = &new_f->lock;\n+ new_f->fp.file._lock = &new_f->lock;\n #endif\n- _IO_old_init (&new_f->fp.file._file, 0);\n+ _IO_old_init (&new_f->fp.file, 0);\n _IO_JUMPS_FILE_plus (&new_f->fp) = &_IO_old_file_jumps;\n- _IO_old_file_init_internal ((struct _IO_FILE_plus *) &new_f->fp);\n+ _IO_old_file_init_internal ((struct _IO_FILE_old_plus *) &new_f->fp);\n #if !_IO_UNIFIED_JUMPTABLES\n new_f->fp.vtable = NULL;\n #endif\n- if (_IO_old_file_attach (&new_f->fp.file._file, fd) == NULL)\n+ if (_IO_old_file_attach (&new_f->fp.file, fd) == NULL)\n {\n- _IO_un_link ((struct _IO_FILE_plus *) &new_f->fp);\n+ _IO_un_link (&new_f->fp);\n free (new_f);\n return NULL;\n }\n- new_f->fp.file._file._flags &= ~_IO_DELETE_DONT_CLOSE;\n+ new_f->fp.file._flags &= ~_IO_DELETE_DONT_CLOSE;\n \n- _IO_mask_flags (&new_f->fp.file._file, read_write,\n+ _IO_mask_flags (&new_f->fp.file, read_write,\n \t\t _IO_NO_READS+_IO_NO_WRITES+_IO_IS_APPENDING);\n \n return (_IO_FILE *) &new_f->fp;\ndiff --git a/libio/oldiofopen.c b/libio/oldiofopen.c\nindex 085267b1d3..f9b336dd25 100644\n--- a/libio/oldiofopen.c\n+++ b/libio/oldiofopen.c\n@@ -38,7 +38,7 @@ _IO_old_fopen (const char *filename, const char *mode)\n {\n struct locked_FILE\n {\n- struct _IO_FILE_complete_plus fp;\n+ struct _IO_FILE_plus fp;\n #ifdef _IO_MTSAFE_IO\n _IO_lock_t lock;\n #endif\n@@ -47,17 +47,17 @@ _IO_old_fopen (const char *filename, const char *mode)\n if (new_f == NULL)\n return NULL;\n #ifdef _IO_MTSAFE_IO\n- new_f->fp.file._file._lock = &new_f->lock;\n+ new_f->fp.file._lock = &new_f->lock;\n #endif\n- _IO_old_init (&new_f->fp.file._file, 0);\n+ _IO_old_init (&new_f->fp.file, 0);\n _IO_JUMPS_FILE_plus (&new_f->fp) = &_IO_old_file_jumps;\n- _IO_old_file_init_internal ((struct _IO_FILE_plus *) &new_f->fp);\n+ _IO_old_file_init_internal ((struct _IO_FILE_old_plus *) &new_f->fp);\n #if !_IO_UNIFIED_JUMPTABLES\n new_f->fp.vtable = NULL;\n #endif\n if (_IO_old_file_fopen ((_IO_FILE *) &new_f->fp, filename, mode) != NULL)\n return (_IO_FILE *) &new_f->fp;\n- _IO_un_link ((struct _IO_FILE_plus *) &new_f->fp);\n+ _IO_un_link (&new_f->fp);\n free (new_f);\n return NULL;\n }\ndiff --git a/libio/oldiopopen.c b/libio/oldiopopen.c\nindex af7774ae90..3aa0447a76 100644\n--- a/libio/oldiopopen.c\n+++ b/libio/oldiopopen.c\n@@ -94,7 +94,7 @@ extern int _IO_dup2 (int fd, int fd2) __THROW;\n \n struct _IO_proc_file\n {\n- struct _IO_FILE_complete_plus file;\n+ struct _IO_FILE_plus file;\n /* Following fields must match those in class procbuf (procbuf.h) */\n _IO_pid_t pid;\n struct _IO_proc_file *next;\n@@ -206,18 +206,18 @@ _IO_old_popen (const char *command, const char *mode)\n if (new_f == NULL)\n return NULL;\n #ifdef _IO_MTSAFE_IO\n- new_f->fpx.file.file._file._lock = &new_f->lock;\n+ new_f->fpx.file.file._lock = &new_f->lock;\n #endif\n- fp = &new_f->fpx.file.file._file;\n+ fp = &new_f->fpx.file.file;\n _IO_old_init (fp, 0);\n- _IO_JUMPS_FILE_plus (&new_f->fpx.file) = &_IO_old_proc_jumps;\n- _IO_old_file_init_internal ((struct _IO_FILE_plus *) &new_f->fpx.file);\n+ _IO_JUMPS_FILE_plus (&new_f->fpx.file.file) = &_IO_old_proc_jumps;\n+ _IO_old_file_init_internal ((struct _IO_FILE_old_plus *) &new_f->fpx.file);\n #if !_IO_UNIFIED_JUMPTABLES\n new_f->fpx.file.vtable = NULL;\n #endif\n if (_IO_old_proc_open (fp, command, mode) != NULL)\n return fp;\n- _IO_un_link ((struct _IO_FILE_plus *) &new_f->fpx.file);\n+ _IO_un_link (&new_f->fpx.file);\n free (new_f);\n return NULL;\n }\ndiff --git a/libio/oldstdfiles.c b/libio/oldstdfiles.c\nindex bed7bceca2..1ce99ef12f 100644\n--- a/libio/oldstdfiles.c\n+++ b/libio/oldstdfiles.c\n@@ -39,11 +39,11 @@\n #ifdef _IO_MTSAFE_IO\n #define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \\\n static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \\\n- struct _IO_FILE_plus NAME \\\n+ struct _IO_FILE_old_plus NAME \\\n = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), &_IO_old_file_jumps};\n #else\n #define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \\\n- struct _IO_FILE_plus NAME \\\n+ struct _IO_FILE_old_plus NAME \\\n = {FILEBUF_LITERAL(CHAIN, FLAGS, FD, NULL), &_IO_old_file_jumps};\n #endif\n \n@@ -81,12 +81,12 @@ _IO_check_libio (void)\n _IO_stdin = stdin = (_IO_FILE *) &_IO_stdin_;\n _IO_stdout = stdout = (_IO_FILE *) &_IO_stdout_;\n _IO_stderr = stderr = (_IO_FILE *) &_IO_stderr_;\n- _IO_list_all = &_IO_stderr_;\n+ _IO_list_all = (struct _IO_FILE_plus *) &_IO_stderr_;\n _IO_stdin->_vtable_offset = _IO_stdout->_vtable_offset =\n \t_IO_stderr->_vtable_offset = stdin->_vtable_offset =\n \tstdout->_vtable_offset = stderr->_vtable_offset =\n-\t((int) sizeof (struct _IO_FILE)\n-\t - (int) sizeof (struct _IO_FILE_complete));\n+\t((int) sizeof (struct _IO_FILE_old)\n+\t - (int) sizeof (struct _IO_FILE));\n }\n }\n \ndiff --git a/libio/stdio.h b/libio/stdio.h\nindex 47490c8299..7019c1d28f 100644\n--- a/libio/stdio.h\n+++ b/libio/stdio.h\n@@ -32,18 +32,22 @@ __BEGIN_DECLS\n #define __need_NULL\n #include <stddef.h>\n \n+#define __need___va_list\n+#include <stdarg.h>\n+\n #include <bits/types.h>\n #include <bits/types/__FILE.h>\n #include <bits/types/FILE.h>\n+#include <bits/types/__fpos_t.h>\n \n-#define _STDIO_USES_IOSTREAM\n-\n-#include <libio.h>\n+#ifdef __USE_GNU\n+# include <bits/types/cookie_io_functions_t.h>\n+#endif\n \n #if defined __USE_XOPEN || defined __USE_XOPEN2K8\n # ifdef __GNUC__\n # ifndef _VA_LIST_DEFINED\n-typedef _G_va_list va_list;\n+typedef __gnuc_va_list va_list;\n # define _VA_LIST_DEFINED\n # endif\n # else\n@@ -75,12 +79,12 @@ typedef __ssize_t ssize_t;\n \n /* The type of the second argument to `fgetpos' and `fsetpos'. */\n #ifndef __USE_FILE_OFFSET64\n-typedef _G_fpos_t fpos_t;\n+typedef __fpos_t fpos_t;\n #else\n-typedef _G_fpos64_t fpos_t;\n+typedef __fpos64_t fpos_t;\n #endif\n #ifdef __USE_LARGEFILE64\n-typedef _G_fpos64_t fpos64_t;\n+typedef __fpos64_t fpos64_t;\n #endif\n \n /* The possibilities for the third argument to `setvbuf'. */\n@@ -91,7 +95,7 @@ typedef _G_fpos64_t fpos64_t;\n \n /* Default buffer size. */\n #ifndef BUFSIZ\n-# define BUFSIZ _IO_BUFSIZ\n+# define BUFSIZ 8192\n #endif\n \n \n@@ -132,9 +136,9 @@ typedef _G_fpos64_t fpos64_t;\n \n \n /* Standard streams. */\n-extern struct _IO_FILE *stdin;\t\t/* Standard input stream. */\n-extern struct _IO_FILE *stdout;\t\t/* Standard output stream. */\n-extern struct _IO_FILE *stderr;\t\t/* Standard error output stream. */\n+extern FILE *stdin;\t\t/* Standard input stream. */\n+extern FILE *stdout;\t\t/* Standard output stream. */\n+extern FILE *stderr;\t\t/* Standard error output stream. */\n /* C89/C99 say they're macros. Make them happy. */\n #define stdin stdin\n #define stdout stdout\n@@ -270,7 +274,7 @@ extern FILE *fdopen (int __fd, const char *__modes) __THROW __wur;\n and uses the given functions for input and output. */\n extern FILE *fopencookie (void *__restrict __magic_cookie,\n \t\t\t const char *__restrict __modes,\n-\t\t\t _IO_cookie_io_functions_t __io_funcs) __THROW __wur;\n+\t\t\t cookie_io_functions_t __io_funcs) __THROW __wur;\n #endif\n \n #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)\n@@ -325,15 +329,15 @@ extern int sprintf (char *__restrict __s,\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\n extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,\n-\t\t _G_va_list __arg);\n+\t\t __gnuc_va_list __arg);\n /* Write formatted output to stdout from argument list ARG.\n \n This function is a possible cancellation point and therefore not\n marked with __THROW. */\n-extern int vprintf (const char *__restrict __format, _G_va_list __arg);\n+extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);\n /* Write formatted output to S from argument list ARG. */\n extern int vsprintf (char *__restrict __s, const char *__restrict __format,\n-\t\t _G_va_list __arg) __THROWNL;\n+\t\t __gnuc_va_list __arg) __THROWNL;\n \n #if defined __USE_ISOC99 || defined __USE_UNIX98\n /* Maximum chars of output to write in MAXLEN. */\n@@ -342,7 +346,7 @@ extern int snprintf (char *__restrict __s, size_t __maxlen,\n __THROWNL __attribute__ ((__format__ (__printf__, 3, 4)));\n \n extern int vsnprintf (char *__restrict __s, size_t __maxlen,\n-\t\t const char *__restrict __format, _G_va_list __arg)\n+\t\t const char *__restrict __format, __gnuc_va_list __arg)\n __THROWNL __attribute__ ((__format__ (__printf__, 3, 0)));\n #endif\n \n@@ -350,7 +354,7 @@ extern int vsnprintf (char *__restrict __s, size_t __maxlen,\n /* Write formatted output to a string dynamically allocated with `malloc'.\n Store the address of the string in *PTR. */\n extern int vasprintf (char **__restrict __ptr, const char *__restrict __f,\n-\t\t _G_va_list __arg)\n+\t\t __gnuc_va_list __arg)\n __THROWNL __attribute__ ((__format__ (__printf__, 2, 0))) __wur;\n extern int __asprintf (char **__restrict __ptr,\n \t\t const char *__restrict __fmt, ...)\n@@ -363,7 +367,7 @@ extern int asprintf (char **__restrict __ptr,\n #ifdef __USE_XOPEN2K8\n /* Write formatted output to a file descriptor. */\n extern int vdprintf (int __fd, const char *__restrict __fmt,\n-\t\t _G_va_list __arg)\n+\t\t __gnuc_va_list __arg)\n __attribute__ ((__format__ (__printf__, 2, 0)));\n extern int dprintf (int __fd, const char *__restrict __fmt, ...)\n __attribute__ ((__format__ (__printf__, 2, 3)));\n@@ -418,19 +422,19 @@ extern int __isoc99_sscanf (const char *__restrict __s,\n This function is a possible cancellation point and therefore not\n marked with __THROW. */\n extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,\n-\t\t _G_va_list __arg)\n+\t\t __gnuc_va_list __arg)\n __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;\n \n /* Read formatted input from stdin into argument list ARG.\n \n This function is a possible cancellation point and therefore not\n marked with __THROW. */\n-extern int vscanf (const char *__restrict __format, _G_va_list __arg)\n+extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)\n __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;\n \n /* Read formatted input from S into argument list ARG. */\n extern int vsscanf (const char *__restrict __s,\n-\t\t const char *__restrict __format, _G_va_list __arg)\n+\t\t const char *__restrict __format, __gnuc_va_list __arg)\n __THROW __attribute__ ((__format__ (__scanf__, 2, 0)));\n \n # if !defined __USE_GNU \\\n@@ -442,26 +446,26 @@ extern int vsscanf (const char *__restrict __s,\n s, S or [. */\n extern int __REDIRECT (vfscanf,\n \t\t (FILE *__restrict __s,\n-\t\t\tconst char *__restrict __format, _G_va_list __arg),\n+\t\t\tconst char *__restrict __format, __gnuc_va_list __arg),\n \t\t __isoc99_vfscanf)\n __attribute__ ((__format__ (__scanf__, 2, 0))) __wur;\n extern int __REDIRECT (vscanf, (const char *__restrict __format,\n-\t\t\t\t_G_va_list __arg), __isoc99_vscanf)\n+\t\t\t\t__gnuc_va_list __arg), __isoc99_vscanf)\n __attribute__ ((__format__ (__scanf__, 1, 0))) __wur;\n extern int __REDIRECT_NTH (vsscanf,\n \t\t\t (const char *__restrict __s,\n \t\t\t const char *__restrict __format,\n-\t\t\t _G_va_list __arg), __isoc99_vsscanf)\n+\t\t\t __gnuc_va_list __arg), __isoc99_vsscanf)\n __attribute__ ((__format__ (__scanf__, 2, 0)));\n # else\n extern int __isoc99_vfscanf (FILE *__restrict __s,\n \t\t\t const char *__restrict __format,\n-\t\t\t _G_va_list __arg) __wur;\n+\t\t\t __gnuc_va_list __arg) __wur;\n extern int __isoc99_vscanf (const char *__restrict __format,\n-\t\t\t _G_va_list __arg) __wur;\n+\t\t\t __gnuc_va_list __arg) __wur;\n extern int __isoc99_vsscanf (const char *__restrict __s,\n \t\t\t const char *__restrict __format,\n-\t\t\t _G_va_list __arg) __THROW;\n+\t\t\t __gnuc_va_list __arg) __THROW;\n # define vfscanf __isoc99_vfscanf\n # define vscanf __isoc99_vscanf\n # define vsscanf __isoc99_vsscanf\n@@ -483,10 +487,6 @@ extern int getc (FILE *__stream);\n marked with __THROW. */\n extern int getchar (void);\n \n-/* The C standard explicitly says this is a macro, so we always do the\n- optimization for it. */\n-#define getc(_fp) _IO_getc (_fp)\n-\n #ifdef __USE_POSIX199506\n /* These are defined in POSIX.1:1996.\n \n@@ -523,10 +523,6 @@ extern int putc (int __c, FILE *__stream);\n marked with __THROW. */\n extern int putchar (int __c);\n \n-/* The C standard explicitly says this can be a macro,\n- so we always do the optimization for it. */\n-#define putc(_ch, _fp) _IO_putc (_ch, _fp)\n-\n #ifdef __USE_MISC\n /* Faster version when locking is not necessary.\n \n@@ -600,12 +596,12 @@ extern char *fgets_unlocked (char *__restrict __s, int __n,\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation they are cancellation points and\n therefore not marked with __THROW. */\n-extern _IO_ssize_t __getdelim (char **__restrict __lineptr,\n-\t\t\t size_t *__restrict __n, int __delimiter,\n-\t\t\t FILE *__restrict __stream) __wur;\n-extern _IO_ssize_t getdelim (char **__restrict __lineptr,\n+extern __ssize_t __getdelim (char **__restrict __lineptr,\n \t\t\t size_t *__restrict __n, int __delimiter,\n \t\t\t FILE *__restrict __stream) __wur;\n+extern __ssize_t getdelim (char **__restrict __lineptr,\n+\t\t\t size_t *__restrict __n, int __delimiter,\n+\t\t\t FILE *__restrict __stream) __wur;\n \n /* Like `getdelim', but reads up to a newline.\n \n@@ -613,9 +609,9 @@ extern _IO_ssize_t getdelim (char **__restrict __lineptr,\n cancellation point. But due to similarity with an POSIX interface\n or due to the implementation it is a cancellation point and\n therefore not marked with __THROW. */\n-extern _IO_ssize_t getline (char **__restrict __lineptr,\n-\t\t\t size_t *__restrict __n,\n-\t\t\t FILE *__restrict __stream) __wur;\n+extern __ssize_t getline (char **__restrict __lineptr,\n+\t\t\t size_t *__restrict __n,\n+\t\t\t FILE *__restrict __stream) __wur;\n #endif\n \n \n@@ -828,7 +824,7 @@ extern int obstack_printf (struct obstack *__restrict __obstack,\n __THROWNL __attribute__ ((__format__ (__printf__, 2, 3)));\n extern int obstack_vprintf (struct obstack *__restrict __obstack,\n \t\t\t const char *__restrict __format,\n-\t\t\t _G_va_list __args)\n+\t\t\t __gnuc_va_list __args)\n __THROWNL __attribute__ ((__format__ (__printf__, 2, 0)));\n #endif /* Use GNU. */\n \ndiff --git a/malloc/malloc.c b/malloc/malloc.c\nindex e3ff778113..eb2cf3a081 100644\n--- a/malloc/malloc.c\n+++ b/malloc/malloc.c\n@@ -222,6 +222,7 @@\n \n #include <unistd.h>\n #include <stdio.h> /* needed for malloc_stats */\n+#include <libio.h> /* needed for FILE internals in malloc_stats */\n #include <errno.h>\n \n #include <shlib-compat.h>\ndiff --git a/misc/err.c b/misc/err.c\nindex 3da4e9d6b0..7b4b7ef814 100644\n--- a/misc/err.c\n+++ b/misc/err.c\n@@ -22,10 +22,8 @@\n #include <errno.h>\n #include <string.h>\n #include <stdio.h>\n-\n+#include <libio.h>\n #include <wchar.h>\n-#define flockfile(s) _IO_flockfile (s)\n-#define funlockfile(s) _IO_funlockfile (s)\n \n extern char *__progname;\n \ndiff --git a/misc/getpass.c b/misc/getpass.c\nindex 89c783fe20..9d84a7f9cd 100644\n--- a/misc/getpass.c\n+++ b/misc/getpass.c\n@@ -22,8 +22,6 @@\n #include <unistd.h>\n \n #include <wchar.h>\n-#define flockfile(s) _IO_flockfile (s)\n-#define funlockfile(s) _IO_funlockfile (s)\n #include <libc-lock.h>\n \n /* It is desirable to use this bit on systems that have it.\ndiff --git a/misc/getttyent.c b/misc/getttyent.c\nindex 73002f52d1..64a93e9003 100644\n--- a/misc/getttyent.c\n+++ b/misc/getttyent.c\n@@ -37,9 +37,6 @@ static char sccsid[] = \"@(#)getttyent.c\t8.1 (Berkeley) 6/4/93\";\n #include <ctype.h>\n #include <string.h>\n \n-#define flockfile(s) _IO_flockfile (s)\n-#define funlockfile(s) _IO_funlockfile (s)\n-\n static char zapchar;\n static FILE *tf;\n \ndiff --git a/misc/mntent_r.c b/misc/mntent_r.c\nindex 30f55212be..02319d152b 100644\n--- a/misc/mntent_r.c\n+++ b/misc/mntent_r.c\n@@ -23,9 +23,6 @@\n #include <string.h>\n #include <sys/types.h>\n \n-#define flockfile(s) _IO_flockfile (s)\n-#define funlockfile(s) _IO_funlockfile (s)\n-\n #undef __setmntent\n #undef __endmntent\n #undef __getmntent_r\ndiff --git a/posix/getopt.c b/posix/getopt.c\nindex 543c8e7284..2efdea85dd 100644\n--- a/posix/getopt.c\n+++ b/posix/getopt.c\n@@ -29,17 +29,13 @@\n #include <unistd.h>\n \n #ifdef _LIBC\n-/* When used as part of glibc, error printing must be done differently\n- for standards compliance. getopt is not a cancellation point, so\n- it must not call functions that are, and it is specified by an\n- older standard than stdio locking, so it must not refer to\n- functions in the \"user namespace\" related to stdio locking.\n- Finally, it must use glibc's internal message translation so that\n- the messages are looked up in the proper text domain. */\n+/* When used as part of glibc, error printing must be done\n+ differently: getopt is not a cancellation point, so it must not\n+ call functions that are, and it must use glibc's internal message\n+ translation so that the messages are looked up in the proper text\n+ domain. */\n # include <libintl.h>\n # define fprintf __fxprintf_nocancel\n-# define flockfile(fp) _IO_flockfile (fp)\n-# define funlockfile(fp) _IO_funlockfile (fp)\n #else\n # include \"gettext.h\"\n # define _(msgid) gettext (msgid)\ndiff --git a/pwd/fgetpwent_r.c b/pwd/fgetpwent_r.c\nindex 8aa8f69372..044f19b20b 100644\n--- a/pwd/fgetpwent_r.c\n+++ b/pwd/fgetpwent_r.c\n@@ -20,9 +20,6 @@\n #include <stdio.h>\n #include <pwd.h>\n \n-#define flockfile(s) _IO_flockfile (s)\n-#define funlockfile(s) _IO_funlockfile (s)\n-\n /* Define a line parsing function using the common code\n used in the nss_files module. */\n \ndiff --git a/shadow/fgetspent_r.c b/shadow/fgetspent_r.c\nindex 42106302c1..260f59bbc5 100644\n--- a/shadow/fgetspent_r.c\n+++ b/shadow/fgetspent_r.c\n@@ -20,8 +20,6 @@\n #include <shadow.h>\n #include <stdio.h>\n \n-#define flockfile(s) _IO_flockfile (s)\n-#define funlockfile(s) _IO_funlockfile (s)\n \n /* Define a line parsing function using the common code\n used in the nss_files module. */\ndiff --git a/shadow/putspent.c b/shadow/putspent.c\nindex 5e27340b5d..6dad45f401 100644\n--- a/shadow/putspent.c\n+++ b/shadow/putspent.c\n@@ -20,8 +20,6 @@\n #include <stdio.h>\n #include <shadow.h>\n \n-#define flockfile(s) _IO_flockfile (s)\n-#define funlockfile(s) _IO_funlockfile (s)\n \n #define _S(x)\tx ? x : \"\"\n \ndiff --git a/stdio-common/tstgetln.c b/stdio-common/tstgetln.c\nindex 79ab90c7cc..3b7ecefc0a 100644\n--- a/stdio-common/tstgetln.c\n+++ b/stdio-common/tstgetln.c\n@@ -15,9 +15,8 @@\n License along with the GNU C Library; if not, see\n <http://www.gnu.org/licenses/>. */\n \n+#include <sys/types.h>\n #include <stdio.h>\n-#undef ssize_t\n-#define ssize_t _IO_ssize_t\n \n int\n main (int argc, char *argv[])\ndiff --git a/sysdeps/generic/_G_config.h b/sysdeps/generic/_G_config.h\nindex c49eed395b..d98cb3824d 100644\n--- a/sysdeps/generic/_G_config.h\n+++ b/sysdeps/generic/_G_config.h\n@@ -1,58 +1,8 @@\n-/* This file is needed by libio to define various configuration parameters.\n- These are always the same in the GNU C library. */\n+/* Configuration parameter overrides for libio - generic version. */\n \n #ifndef _G_config_h\n #define _G_config_h 1\n \n-/* Define types for libio in terms of the standard internal type names. */\n-\n-#include <bits/types.h>\n-#define __need_size_t\n-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n-# define __need_wchar_t\n-#endif\n-#define __need_NULL\n-#include <stddef.h>\n-\n-#include <bits/types/__mbstate_t.h>\n-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n-# include <bits/types/wint_t.h>\n-#endif\n-\n-typedef struct\n-{\n- __off_t __pos;\n- __mbstate_t __state;\n-} _G_fpos_t;\n-typedef struct\n-{\n- __off64_t __pos;\n- __mbstate_t __state;\n-} _G_fpos64_t;\n-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n-# include <gconv.h>\n-typedef union\n-{\n- struct __gconv_info __cd;\n- struct\n- {\n- struct __gconv_info __cd;\n- struct __gconv_step_data __data;\n- } __combined;\n-} _G_iconv_t;\n-#endif\n-\n-\n-/* These library features are always available in the GNU C library. */\n-#define _G_va_list __gnuc_va_list\n-\n-#define _G_HAVE_MMAP 1\n-\n-#define _G_IO_IO_FILE_VERSION 0x20001\n-\n-/* This is defined by <bits/stat.h> if `st_blksize' exists. */\n-#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)\n-\n-#define _G_BUFSIZ 8192\n+#undef _G_HAVE_MREMAP\n \n #endif\t/* _G_config.h */\ndiff --git a/sysdeps/ieee754/ldbl-opt/Makefile b/sysdeps/ieee754/ldbl-opt/Makefile\nindex 81429d0ddd..15a217ec75 100644\n--- a/sysdeps/ieee754/ldbl-opt/Makefile\n+++ b/sysdeps/ieee754/ldbl-opt/Makefile\n@@ -11,7 +11,7 @@ libm-routines += s_nexttowardfd\n routines += math_ldbl_opt nldbl-compat\n \n extra-libs += libnldbl\n-libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf iovfscanf \\\n+libnldbl-calls = asprintf dprintf fprintf fscanf fwprintf fwscanf \\\n \t\t obstack_printf obstack_vprintf printf scanf snprintf \\\n \t\t sprintf sscanf swprintf swscanf vasprintf vdprintf vfprintf \\\n \t\t vfscanf vfwprintf vfwscanf vprintf vscanf vsnprintf \\\ndiff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c\nindex e11d6d1bd0..4c4e429eb2 100644\n--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.c\n+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.c\n@@ -176,7 +176,7 @@ strong_alias (__nldbl_vfprintf, __nldbl__IO_vfprintf)\n \n int\n attribute_compat_text_section\n-__nldbl__IO_vsprintf (char *string, const char *fmt, va_list ap)\n+__nldbl_vsprintf (char *string, const char *fmt, va_list ap)\n {\n int done;\n __no_long_double = 1;\n@@ -184,8 +184,8 @@ __nldbl__IO_vsprintf (char *string, const char *fmt, va_list ap)\n __no_long_double = 0;\n return done;\n }\n-weak_alias (__nldbl__IO_vsprintf, __nldbl_vsprintf)\n libc_hidden_def (__nldbl_vsprintf)\n+strong_alias (__nldbl_vsprintf, __nldbl__IO_vsprintf)\n \n int\n attribute_compat_text_section\ndiff --git a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h\nindex 72ec0db390..790be2a837 100644\n--- a/sysdeps/ieee754/ldbl-opt/nldbl-compat.h\n+++ b/sysdeps/ieee754/ldbl-opt/nldbl-compat.h\n@@ -36,7 +36,6 @@\n /* Declare the __nldbl_NAME function the wrappers call that's in libc.so. */\n #define NLDBL_DECL(name) extern __typeof (name) __nldbl_##name\n \n-NLDBL_DECL (_IO_vfscanf);\n NLDBL_DECL (vfscanf);\n NLDBL_DECL (vfwscanf);\n NLDBL_DECL (obstack_vprintf);\n@@ -82,22 +81,23 @@ extern ssize_t __nldbl___vstrfmon (char *, size_t, const char *, va_list)\n /* These don't use __typeof because they were not declared by the headers,\n since we don't compile with _FORTIFY_SOURCE. */\n extern int __nldbl___vfprintf_chk (FILE *__restrict, int,\n-\t\t\t\t const char *__restrict, _G_va_list);\n+\t\t\t\t const char *__restrict, __gnuc_va_list);\n extern int __nldbl___vfwprintf_chk (FILE *__restrict, int,\n \t\t\t\t const wchar_t *__restrict, __gnuc_va_list);\n extern int __nldbl___vsprintf_chk (char *__restrict, int, size_t,\n-\t\t\t\t const char *__restrict, _G_va_list) __THROW;\n+\t\t\t\t const char *__restrict, __gnuc_va_list)\n+ __THROW;\n extern int __nldbl___vsnprintf_chk (char *__restrict, size_t, int, size_t,\n-\t\t\t\t const char *__restrict, _G_va_list)\n+\t\t\t\t const char *__restrict, __gnuc_va_list)\n __THROW;\n extern int __nldbl___vswprintf_chk (wchar_t *__restrict, size_t, int, size_t,\n \t\t\t\t const wchar_t *__restrict, __gnuc_va_list)\n __THROW;\n-extern int __nldbl___vasprintf_chk (char **, int, const char *, _G_va_list)\n+extern int __nldbl___vasprintf_chk (char **, int, const char *, __gnuc_va_list)\n __THROW;\n-extern int __nldbl___vdprintf_chk (int, int, const char *, _G_va_list);\n+extern int __nldbl___vdprintf_chk (int, int, const char *, __gnuc_va_list);\n extern int __nldbl___obstack_vprintf_chk (struct obstack *, int, const char *,\n-\t\t\t\t\t _G_va_list) __THROW;\n+\t\t\t\t\t __gnuc_va_list) __THROW;\n extern void __nldbl___vsyslog_chk (int, int, const char *, va_list);\n \n \ndiff --git a/sysdeps/ieee754/ldbl-opt/nldbl-fscanf.c b/sysdeps/ieee754/ldbl-opt/nldbl-fscanf.c\nindex 1b768e306f..1f78f0d2dc 100644\n--- a/sysdeps/ieee754/ldbl-opt/nldbl-fscanf.c\n+++ b/sysdeps/ieee754/ldbl-opt/nldbl-fscanf.c\n@@ -8,7 +8,7 @@ fscanf (FILE *stream, const char *fmt, ...)\n int done;\n \n va_start (arg, fmt);\n- done = __nldbl__IO_vfscanf (stream, fmt, arg, NULL);\n+ done = __nldbl_vfscanf (stream, fmt, arg);\n va_end (arg);\n \n return done;\ndiff --git a/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c b/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c\ndeleted file mode 100644\nindex 05581c0354..0000000000\n--- a/sysdeps/ieee754/ldbl-opt/nldbl-iovfscanf.c\n+++ /dev/null\n@@ -1,8 +0,0 @@\n-#include \"nldbl-compat.h\"\n-\n-int\n-attribute_hidden\n-_IO_vfscanf (FILE *s, const char *fmt, _IO_va_list ap, int *errp)\n-{\n- return __nldbl__IO_vfscanf (s, fmt, ap, errp);\n-}\ndiff --git a/sysdeps/ieee754/ldbl-opt/nldbl-scanf.c b/sysdeps/ieee754/ldbl-opt/nldbl-scanf.c\nindex bbab371cbe..d4111c87d4 100644\n--- a/sysdeps/ieee754/ldbl-opt/nldbl-scanf.c\n+++ b/sysdeps/ieee754/ldbl-opt/nldbl-scanf.c\n@@ -8,7 +8,7 @@ scanf (const char *fmt, ...)\n int done;\n \n va_start (arg, fmt);\n- done = __nldbl__IO_vfscanf (stdin, fmt, arg, NULL);\n+ done = __nldbl_vfscanf (stdin, fmt, arg);\n va_end (arg);\n \n return done;\ndiff --git a/sysdeps/ieee754/ldbl-opt/nldbl-vfscanf.c b/sysdeps/ieee754/ldbl-opt/nldbl-vfscanf.c\nindex f23465ee95..e10ce137fb 100644\n--- a/sysdeps/ieee754/ldbl-opt/nldbl-vfscanf.c\n+++ b/sysdeps/ieee754/ldbl-opt/nldbl-vfscanf.c\n@@ -4,7 +4,7 @@ int\n attribute_hidden\n __vfscanf (FILE *s, const char *fmt, va_list ap)\n {\n- return __nldbl__IO_vfscanf (s, fmt, ap, NULL);\n+ return __nldbl_vfscanf (s, fmt, ap);\n }\n extern __typeof (__vfscanf) vfscanf attribute_hidden;\n weak_alias (__vfscanf, vfscanf)\ndiff --git a/sysdeps/ieee754/ldbl-opt/nldbl-vscanf.c b/sysdeps/ieee754/ldbl-opt/nldbl-vscanf.c\nindex e75907b905..71aa080405 100644\n--- a/sysdeps/ieee754/ldbl-opt/nldbl-vscanf.c\n+++ b/sysdeps/ieee754/ldbl-opt/nldbl-vscanf.c\n@@ -5,5 +5,5 @@ attribute_hidden\n weak_function\n vscanf (const char *fmt, va_list ap)\n {\n- return __nldbl__IO_vfscanf (stdin, fmt, ap, NULL);\n+ return __nldbl_vfscanf (stdin, fmt, ap);\n }\ndiff --git a/sysdeps/unix/sysv/linux/_G_config.h b/sysdeps/unix/sysv/linux/_G_config.h\nindex 3bc6cfd595..69d5f4694f 100644\n--- a/sysdeps/unix/sysv/linux/_G_config.h\n+++ b/sysdeps/unix/sysv/linux/_G_config.h\n@@ -1,59 +1,8 @@\n-/* This file is needed by libio to define various configuration parameters.\n- These are always the same in the GNU C library. */\n+/* Configuration parameter overrides for libio - Linux version. */\n \n #ifndef _G_config_h\n #define _G_config_h 1\n \n-/* Define types for libio in terms of the standard internal type names. */\n-\n-#include <bits/types.h>\n-#define __need_size_t\n-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n-# define __need_wchar_t\n-#endif\n-#define __need_NULL\n-#include <stddef.h>\n-\n-#include <bits/types/__mbstate_t.h>\n-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n-# include <bits/types/wint_t.h>\n-#endif\n-\n-typedef struct\n-{\n- __off_t __pos;\n- __mbstate_t __state;\n-} _G_fpos_t;\n-typedef struct\n-{\n- __off64_t __pos;\n- __mbstate_t __state;\n-} _G_fpos64_t;\n-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T\n-# include <gconv.h>\n-typedef union\n-{\n- struct __gconv_info __cd;\n- struct\n- {\n- struct __gconv_info __cd;\n- struct __gconv_step_data __data;\n- } __combined;\n-} _G_iconv_t;\n-#endif\n-\n-\n-/* These library features are always available in the GNU C library. */\n-#define _G_va_list __gnuc_va_list\n-\n-#define _G_HAVE_MMAP 1\n #define _G_HAVE_MREMAP 1\n \n-#define _G_IO_IO_FILE_VERSION 0x20001\n-\n-/* This is defined by <bits/stat.h> if `st_blksize' exists. */\n-#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)\n-\n-#define _G_BUFSIZ 8192\n-\n #endif\t/* _G_config.h */\n", "prefixes": [ "RFC" ] }