about summary refs log tree commit diff
path: root/libio
diff options
context:
space:
mode:
Diffstat (limited to 'libio')
-rw-r--r--libio/Banner1
-rw-r--r--libio/bits/stdio.h12
-rw-r--r--libio/fileops.c11
-rw-r--r--libio/libio.h32
-rw-r--r--libio/libioP.h235
-rw-r--r--libio/oldfileops.c5
-rw-r--r--libio/stdio.c10
-rw-r--r--libio/stdio.h41
-rw-r--r--libio/vswprintf.c2
9 files changed, 164 insertions, 185 deletions
diff --git a/libio/Banner b/libio/Banner
new file mode 100644
index 0000000000..8ec3141927
--- /dev/null
+++ b/libio/Banner
@@ -0,0 +1 @@
+GNU libio by Per Bothner
diff --git a/libio/bits/stdio.h b/libio/bits/stdio.h
index 9e951ad8e4..2d44fad1f5 100644
--- a/libio/bits/stdio.h
+++ b/libio/bits/stdio.h
@@ -1,5 +1,5 @@
 /* Optimizing macros and inline functions for stdio functions.
-   Copyright (C) 1998, 2000, 2001, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1998, 2000, 2001, 2004, 2007 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -44,6 +44,16 @@ getchar (void)
 }
 
 
+# ifdef __USE_MISC
+/* Faster version when locking is not necessary.  */
+__STDIO_INLINE int
+fgetc_unlocked (FILE *__fp)
+{
+  return _IO_getc_unlocked (__fp);
+}
+# endif /* misc */
+
+
 # if defined __USE_POSIX || defined __USE_MISC
 /* This is defined in POSIX.1:1996.  */
 __STDIO_INLINE int
diff --git a/libio/fileops.c b/libio/fileops.c
index dbd7a7a8f2..886b3729c3 100644
--- a/libio/fileops.c
+++ b/libio/fileops.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993, 1995, 1997-2005, 2006 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997-2005, 2006, 2007
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Per Bothner <bothner@cygnus.com>.
 
@@ -472,7 +473,7 @@ _IO_file_setbuf_mmap (fp, p, len)
   return result;
 }
 
-static _IO_size_t new_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
+static _IO_size_t new_do_write (_IO_FILE *, const char *, _IO_size_t);
 
 /* Write TO_DO bytes from DATA to FP.
    Then mark FP as having empty buffers. */
@@ -1468,8 +1469,7 @@ _IO_file_xsgetn (fp, data, n)
 }
 INTDEF(_IO_file_xsgetn)
 
-static _IO_size_t _IO_file_xsgetn_mmap (_IO_FILE *, void *, _IO_size_t)
-     __THROW;
+static _IO_size_t _IO_file_xsgetn_mmap (_IO_FILE *, void *, _IO_size_t);
 static _IO_size_t
 _IO_file_xsgetn_mmap (fp, data, n)
      _IO_FILE *fp;
@@ -1528,8 +1528,7 @@ _IO_file_xsgetn_mmap (fp, data, n)
   return s - (char *) data;
 }
 
-static _IO_size_t _IO_file_xsgetn_maybe_mmap (_IO_FILE *, void *, _IO_size_t)
-     __THROW;
+static _IO_size_t _IO_file_xsgetn_maybe_mmap (_IO_FILE *, void *, _IO_size_t);
 static _IO_size_t
 _IO_file_xsgetn_maybe_mmap (fp, data, n)
      _IO_FILE *fp;
diff --git a/libio/libio.h b/libio/libio.h
index 428e035540..9df08614ee 100644
--- a/libio/libio.h
+++ b/libio/libio.h
@@ -410,12 +410,12 @@ extern void _IO_cookie_init (struct _IO_cookie_file *__cfile, int __read_write,
 extern "C" {
 #endif
 
-extern int __underflow (_IO_FILE *) __THROW;
-extern int __uflow (_IO_FILE *) __THROW;
-extern int __overflow (_IO_FILE *, int) __THROW;
-extern _IO_wint_t __wunderflow (_IO_FILE *) __THROW;
-extern _IO_wint_t __wuflow (_IO_FILE *) __THROW;
-extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t) __THROW;
+extern int __underflow (_IO_FILE *);
+extern int __uflow (_IO_FILE *);
+extern int __overflow (_IO_FILE *, int);
+extern _IO_wint_t __wunderflow (_IO_FILE *);
+extern _IO_wint_t __wuflow (_IO_FILE *);
+extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t);
 
 #if  __GNUC__ >= 3
 # define _IO_BE(expr, res) __builtin_expect ((expr), res)
@@ -448,12 +448,12 @@ extern _IO_wint_t __woverflow (_IO_FILE *, _IO_wint_t) __THROW;
 #define _IO_feof_unlocked(__fp) (((__fp)->_flags & _IO_EOF_SEEN) != 0)
 #define _IO_ferror_unlocked(__fp) (((__fp)->_flags & _IO_ERR_SEEN) != 0)
 
-extern int _IO_getc (_IO_FILE *__fp) __THROW;
-extern int _IO_putc (int __c, _IO_FILE *__fp) __THROW;
+extern int _IO_getc (_IO_FILE *__fp);
+extern int _IO_putc (int __c, _IO_FILE *__fp);
 extern int _IO_feof (_IO_FILE *__fp) __THROW;
 extern int _IO_ferror (_IO_FILE *__fp) __THROW;
 
-extern int _IO_peekc_locked (_IO_FILE *__fp) __THROW;
+extern int _IO_peekc_locked (_IO_FILE *__fp);
 
 /* This one is for Emacs. */
 #define _IO_PENDING_OUTPUT_COUNT(_fp)	\
@@ -482,17 +482,17 @@ extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
 			_IO_va_list, int *__restrict);
 extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
 			 _IO_va_list);
-extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t) __THROW;
-extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t) __THROW;
+extern _IO_ssize_t _IO_padn (_IO_FILE *, int, _IO_ssize_t);
+extern _IO_size_t _IO_sgetn (_IO_FILE *, void *, _IO_size_t);
 
-extern _IO_off64_t _IO_seekoff (_IO_FILE *, _IO_off64_t, int, int) __THROW;
-extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int) __THROW;
+extern _IO_off64_t _IO_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int);
 
 extern void _IO_free_backup_area (_IO_FILE *) __THROW;
 
 #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-extern _IO_wint_t _IO_getwc (_IO_FILE *__fp) __THROW;
-extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp) __THROW;
+extern _IO_wint_t _IO_getwc (_IO_FILE *__fp);
+extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp);
 extern int _IO_fwide (_IO_FILE *__fp, int __mode) __THROW;
 # if __GNUC__ >= 2
 /* While compiling glibc we have to handle compatibility with very old
@@ -531,7 +531,7 @@ extern int _IO_vfwscanf (_IO_FILE * __restrict, const wchar_t * __restrict,
 			 _IO_va_list, int *__restrict);
 extern int _IO_vfwprintf (_IO_FILE *__restrict, const wchar_t *__restrict,
 			  _IO_va_list);
-extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t) __THROW;
+extern _IO_ssize_t _IO_wpadn (_IO_FILE *, wint_t, _IO_ssize_t);
 extern void _IO_free_wbackup_area (_IO_FILE *) __THROW;
 #endif
 
diff --git a/libio/libioP.h b/libio/libioP.h
index a2cd4c2202..a574b40f77 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997-2003,2004,2005,2006
+/* Copyright (C) 1993, 1997-2003,2004,2005,2006,2007
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -380,7 +380,7 @@ typedef struct _IO_FILE *_IO_ITER;
 
 extern void _IO_switch_to_main_get_area (_IO_FILE *) __THROW;
 extern void _IO_switch_to_backup_area (_IO_FILE *) __THROW;
-extern int _IO_switch_to_get_mode (_IO_FILE *) __THROW;
+extern int _IO_switch_to_get_mode (_IO_FILE *);
 extern void _IO_init (_IO_FILE *, int) __THROW;
 extern int _IO_sputbackc (_IO_FILE *, int) __THROW;
 extern int _IO_sungetc (_IO_FILE *) __THROW;
@@ -394,7 +394,7 @@ extern unsigned _IO_adjust_column (unsigned, const char *, int) __THROW;
 
 extern void _IO_switch_to_main_wget_area (_IO_FILE *) __THROW;
 extern void _IO_switch_to_wbackup_area (_IO_FILE *) __THROW;
-extern int _IO_switch_to_wget_mode (_IO_FILE *) __THROW;
+extern int _IO_switch_to_wget_mode (_IO_FILE *);
 extern void _IO_wsetb (_IO_FILE *, wchar_t *, wchar_t *, int) __THROW;
 extern wint_t _IO_sputbackwc (_IO_FILE *, wint_t) __THROW;
 extern wint_t _IO_sungetwc (_IO_FILE *) __THROW;
@@ -404,8 +404,8 @@ extern unsigned _IO_adjust_wcolumn (unsigned, const wchar_t *, int) __THROW;
 
 /* Marker-related function. */
 
-extern void _IO_init_marker (struct _IO_marker *, _IO_FILE *) __THROW;
-extern void _IO_init_wmarker (struct _IO_marker *, _IO_FILE *) __THROW;
+extern void _IO_init_marker (struct _IO_marker *, _IO_FILE *);
+extern void _IO_init_wmarker (struct _IO_marker *, _IO_FILE *);
 extern void _IO_remove_marker (struct _IO_marker *) __THROW;
 extern int _IO_marker_difference (struct _IO_marker *, struct _IO_marker *)
      __THROW;
@@ -434,22 +434,22 @@ libc_hidden_proto (_IO_list_resetlock)
 /* Default jumptable functions. */
 
 extern int _IO_default_underflow (_IO_FILE *) __THROW;
-extern int _IO_default_uflow (_IO_FILE *) __THROW;
-extern wint_t _IO_wdefault_uflow (_IO_FILE *) __THROW;
+extern int _IO_default_uflow (_IO_FILE *);
+extern wint_t _IO_wdefault_uflow (_IO_FILE *);
 extern int _IO_default_doallocate (_IO_FILE *) __THROW;
 extern int _IO_wdefault_doallocate (_IO_FILE *) __THROW;
 extern void _IO_default_finish (_IO_FILE *, int) __THROW;
 extern void _IO_wdefault_finish (_IO_FILE *, int) __THROW;
 extern int _IO_default_pbackfail (_IO_FILE *, int) __THROW;
 extern wint_t _IO_wdefault_pbackfail (_IO_FILE *, wint_t) __THROW;
-extern _IO_FILE* _IO_default_setbuf (_IO_FILE *, char *, _IO_ssize_t) __THROW;
+extern _IO_FILE* _IO_default_setbuf (_IO_FILE *, char *, _IO_ssize_t);
 extern _IO_size_t _IO_default_xsputn (_IO_FILE *, const void *, _IO_size_t);
 extern _IO_size_t _IO_wdefault_xsputn (_IO_FILE *, const void *, _IO_size_t);
 extern _IO_size_t _IO_default_xsgetn (_IO_FILE *, void *, _IO_size_t);
 extern _IO_size_t _IO_wdefault_xsgetn (_IO_FILE *, void *, _IO_size_t);
 extern _IO_off64_t _IO_default_seekoff (_IO_FILE *, _IO_off64_t, int, int)
      __THROW;
-extern _IO_off64_t _IO_default_seekpos (_IO_FILE *, _IO_off64_t, int) __THROW;
+extern _IO_off64_t _IO_default_seekpos (_IO_FILE *, _IO_off64_t, int);
 extern _IO_ssize_t _IO_default_write (_IO_FILE *, const void *, _IO_ssize_t);
 extern _IO_ssize_t _IO_default_read (_IO_FILE *, void *, _IO_ssize_t);
 extern int _IO_default_stat (_IO_FILE *, void *) __THROW;
@@ -473,22 +473,22 @@ extern const struct _IO_jump_t _IO_old_proc_jumps attribute_hidden;
 extern const struct _IO_jump_t _IO_str_jumps attribute_hidden;
 extern const struct _IO_jump_t _IO_wstr_jumps attribute_hidden;
 extern const struct _IO_codecvt __libio_codecvt attribute_hidden;
-extern int _IO_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
-extern int _IO_new_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
-extern int _IO_old_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
-extern int _IO_wdo_write (_IO_FILE *, const wchar_t *, _IO_size_t) __THROW;
-extern int _IO_flush_all_lockp (int) __THROW;
-extern int _IO_flush_all (void) __THROW;
-extern int _IO_cleanup (void) __THROW;
-extern void _IO_flush_all_linebuffered (void) __THROW;
-extern int _IO_new_fgetpos (_IO_FILE *, _IO_fpos_t *) __THROW;
-extern int _IO_old_fgetpos (_IO_FILE *, _IO_fpos_t *) __THROW;
-extern int _IO_new_fsetpos (_IO_FILE *, const _IO_fpos_t *) __THROW;
-extern int _IO_old_fsetpos (_IO_FILE *, const _IO_fpos_t *) __THROW;
-extern int _IO_new_fgetpos64 (_IO_FILE *, _IO_fpos64_t *) __THROW;
-extern int _IO_old_fgetpos64 (_IO_FILE *, _IO_fpos64_t *) __THROW;
-extern int _IO_new_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *) __THROW;
-extern int _IO_old_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *) __THROW;
+extern int _IO_do_write (_IO_FILE *, const char *, _IO_size_t);
+extern int _IO_new_do_write (_IO_FILE *, const char *, _IO_size_t);
+extern int _IO_old_do_write (_IO_FILE *, const char *, _IO_size_t);
+extern int _IO_wdo_write (_IO_FILE *, const wchar_t *, _IO_size_t);
+extern int _IO_flush_all_lockp (int);
+extern int _IO_flush_all (void);
+extern int _IO_cleanup (void);
+extern void _IO_flush_all_linebuffered (void);
+extern int _IO_new_fgetpos (_IO_FILE *, _IO_fpos_t *);
+extern int _IO_old_fgetpos (_IO_FILE *, _IO_fpos_t *);
+extern int _IO_new_fsetpos (_IO_FILE *, const _IO_fpos_t *);
+extern int _IO_old_fsetpos (_IO_FILE *, const _IO_fpos_t *);
+extern int _IO_new_fgetpos64 (_IO_FILE *, _IO_fpos64_t *);
+extern int _IO_old_fgetpos64 (_IO_FILE *, _IO_fpos64_t *);
+extern int _IO_new_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *);
+extern int _IO_old_fsetpos64 (_IO_FILE *, const _IO_fpos64_t *);
 extern void _IO_old_init (_IO_FILE *fp, int flags) __THROW;
 
 
@@ -534,95 +534,79 @@ extern void _IO_old_init (_IO_FILE *fp, int flags) __THROW;
 /* Jumptable functions for files. */
 
 extern int _IO_file_doallocate (_IO_FILE *) __THROW;
-extern _IO_FILE* _IO_file_setbuf (_IO_FILE *, char *, _IO_ssize_t) __THROW;
-extern _IO_off64_t _IO_file_seekoff (_IO_FILE *, _IO_off64_t, int, int)
-     __THROW;
+extern _IO_FILE* _IO_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);
+extern _IO_off64_t _IO_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);
 extern _IO_off64_t _IO_file_seekoff_mmap (_IO_FILE *, _IO_off64_t, int, int)
      __THROW;
-extern _IO_size_t _IO_file_xsputn (_IO_FILE *, const void *, _IO_size_t)
-     __THROW;
-extern _IO_size_t _IO_file_xsgetn (_IO_FILE *, void *, _IO_size_t) __THROW;
+extern _IO_size_t _IO_file_xsputn (_IO_FILE *, const void *, _IO_size_t);
+extern _IO_size_t _IO_file_xsgetn (_IO_FILE *, void *, _IO_size_t);
 extern int _IO_file_stat (_IO_FILE *, void *) __THROW;
 extern int _IO_file_close (_IO_FILE *) __THROW;
 extern int _IO_file_close_mmap (_IO_FILE *) __THROW;
-extern int _IO_file_underflow (_IO_FILE *) __THROW;
-extern int _IO_file_underflow_mmap (_IO_FILE *) __THROW;
-extern int _IO_file_underflow_maybe_mmap (_IO_FILE *) __THROW;
-extern int _IO_file_overflow (_IO_FILE *, int) __THROW;
+extern int _IO_file_underflow (_IO_FILE *);
+extern int _IO_file_underflow_mmap (_IO_FILE *);
+extern int _IO_file_underflow_maybe_mmap (_IO_FILE *);
+extern int _IO_file_overflow (_IO_FILE *, int);
 #define _IO_file_is_open(__fp) ((__fp)->_fileno != -1)
 extern void _IO_file_init (struct _IO_FILE_plus *) __THROW;
-extern _IO_FILE* _IO_file_attach (_IO_FILE *, int) __THROW;
-extern _IO_FILE* _IO_file_open (_IO_FILE *, const char *, int, int, int, int)
-     __THROW;
+extern _IO_FILE* _IO_file_attach (_IO_FILE *, int);
+extern _IO_FILE* _IO_file_open (_IO_FILE *, const char *, int, int, int, int);
 libc_hidden_proto (_IO_file_open)
-extern _IO_FILE* _IO_file_fopen (_IO_FILE *, const char *, const char *, int)
-     __THROW;
-extern _IO_ssize_t _IO_file_write (_IO_FILE *, const void *, _IO_ssize_t)
-     __THROW;
-extern _IO_ssize_t _IO_file_read (_IO_FILE *, void *, _IO_ssize_t) __THROW;
-extern int _IO_file_sync (_IO_FILE *) __THROW;
-extern int _IO_file_close_it (_IO_FILE *) __THROW;
+extern _IO_FILE* _IO_file_fopen (_IO_FILE *, const char *, const char *, int);
+extern _IO_ssize_t _IO_file_write (_IO_FILE *, const void *, _IO_ssize_t);
+extern _IO_ssize_t _IO_file_read (_IO_FILE *, void *, _IO_ssize_t);
+extern int _IO_file_sync (_IO_FILE *);
+extern int _IO_file_close_it (_IO_FILE *);
 extern _IO_off64_t _IO_file_seek (_IO_FILE *, _IO_off64_t, int) __THROW;
-extern void _IO_file_finish (_IO_FILE *, int) __THROW;
+extern void _IO_file_finish (_IO_FILE *, int);
 
-extern _IO_FILE* _IO_new_file_attach (_IO_FILE *, int) __THROW;
-extern int _IO_new_file_close_it (_IO_FILE *) __THROW;
-extern void _IO_new_file_finish (_IO_FILE *, int) __THROW;
+extern _IO_FILE* _IO_new_file_attach (_IO_FILE *, int);
+extern int _IO_new_file_close_it (_IO_FILE *);
+extern void _IO_new_file_finish (_IO_FILE *, int);
 extern _IO_FILE* _IO_new_file_fopen (_IO_FILE *, const char *, const char *,
-				     int) __THROW;
+				     int);
 extern void _IO_no_init (_IO_FILE *, int, int, struct _IO_wide_data *,
 			 const struct _IO_jump_t *) __THROW;
 extern void _IO_new_file_init (struct _IO_FILE_plus *) __THROW;
-extern _IO_FILE* _IO_new_file_setbuf (_IO_FILE *, char *, _IO_ssize_t) __THROW;
-extern _IO_FILE* _IO_file_setbuf_mmap (_IO_FILE *, char *, _IO_ssize_t)
-     __THROW;
-extern int _IO_new_file_sync (_IO_FILE *) __THROW;
-extern int _IO_new_file_underflow (_IO_FILE *) __THROW;
-extern int _IO_new_file_overflow (_IO_FILE *, int) __THROW;
-extern _IO_off64_t _IO_new_file_seekoff (_IO_FILE *, _IO_off64_t, int, int)
-     __THROW;
-extern _IO_ssize_t _IO_new_file_write (_IO_FILE *, const void *, _IO_ssize_t)
-     __THROW;
-extern _IO_size_t _IO_new_file_xsputn (_IO_FILE *, const void *, _IO_size_t)
-     __THROW;
-
-extern _IO_FILE* _IO_old_file_setbuf (_IO_FILE *, char *, _IO_ssize_t) __THROW;
-extern _IO_off64_t _IO_old_file_seekoff (_IO_FILE *, _IO_off64_t, int, int)
-     __THROW;
-extern _IO_size_t _IO_old_file_xsputn (_IO_FILE *, const void *, _IO_size_t)
-     __THROW;
-extern int _IO_old_file_underflow (_IO_FILE *) __THROW;
-extern int _IO_old_file_overflow (_IO_FILE *, int) __THROW;
+extern _IO_FILE* _IO_new_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);
+extern _IO_FILE* _IO_file_setbuf_mmap (_IO_FILE *, char *, _IO_ssize_t);
+extern int _IO_new_file_sync (_IO_FILE *);
+extern int _IO_new_file_underflow (_IO_FILE *);
+extern int _IO_new_file_overflow (_IO_FILE *, int);
+extern _IO_off64_t _IO_new_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+extern _IO_ssize_t _IO_new_file_write (_IO_FILE *, const void *, _IO_ssize_t);
+extern _IO_size_t _IO_new_file_xsputn (_IO_FILE *, const void *, _IO_size_t);
+
+extern _IO_FILE* _IO_old_file_setbuf (_IO_FILE *, char *, _IO_ssize_t);
+extern _IO_off64_t _IO_old_file_seekoff (_IO_FILE *, _IO_off64_t, int, int);
+extern _IO_size_t _IO_old_file_xsputn (_IO_FILE *, const void *, _IO_size_t);
+extern int _IO_old_file_underflow (_IO_FILE *);
+extern int _IO_old_file_overflow (_IO_FILE *, int);
 extern void _IO_old_file_init (struct _IO_FILE_plus *) __THROW;
-extern _IO_FILE* _IO_old_file_attach (_IO_FILE *, int) __THROW;
-extern _IO_FILE* _IO_old_file_fopen (_IO_FILE *, const char *, const char *)
-     __THROW;
-extern _IO_ssize_t _IO_old_file_write (_IO_FILE *, const void *, _IO_ssize_t)
-     __THROW;
-extern int _IO_old_file_sync (_IO_FILE *) __THROW;
-extern int _IO_old_file_close_it (_IO_FILE *) __THROW;
-extern void _IO_old_file_finish (_IO_FILE *, int) __THROW;
+extern _IO_FILE* _IO_old_file_attach (_IO_FILE *, int);
+extern _IO_FILE* _IO_old_file_fopen (_IO_FILE *, const char *, const char *);
+extern _IO_ssize_t _IO_old_file_write (_IO_FILE *, const void *, _IO_ssize_t);
+extern int _IO_old_file_sync (_IO_FILE *);
+extern int _IO_old_file_close_it (_IO_FILE *);
+extern void _IO_old_file_finish (_IO_FILE *, int);
 
 extern int _IO_wfile_doallocate (_IO_FILE *) __THROW;
-extern _IO_size_t _IO_wfile_xsputn (_IO_FILE *, const void *, _IO_size_t)
-     __THROW;
-extern _IO_FILE* _IO_wfile_setbuf (_IO_FILE *, wchar_t *, _IO_ssize_t) __THROW;
-extern wint_t _IO_wfile_sync (_IO_FILE *) __THROW;
-extern wint_t _IO_wfile_underflow (_IO_FILE *) __THROW;
-extern wint_t _IO_wfile_overflow (_IO_FILE *, wint_t) __THROW;
-extern _IO_off64_t _IO_wfile_seekoff (_IO_FILE *, _IO_off64_t, int, int)
-     __THROW;
+extern _IO_size_t _IO_wfile_xsputn (_IO_FILE *, const void *, _IO_size_t);
+extern _IO_FILE* _IO_wfile_setbuf (_IO_FILE *, wchar_t *, _IO_ssize_t);
+extern wint_t _IO_wfile_sync (_IO_FILE *);
+extern wint_t _IO_wfile_underflow (_IO_FILE *);
+extern wint_t _IO_wfile_overflow (_IO_FILE *, wint_t);
+extern _IO_off64_t _IO_wfile_seekoff (_IO_FILE *, _IO_off64_t, int, int);
 
 /* Jumptable functions for proc_files. */
 extern _IO_FILE* _IO_proc_open (_IO_FILE *, const char *, const char *)
      __THROW;
 extern _IO_FILE* _IO_new_proc_open (_IO_FILE *, const char *, const char *)
      __THROW;
-extern _IO_FILE* _IO_old_proc_open (_IO_FILE *, const char *, const char *)
-     __THROW;
+extern _IO_FILE* _IO_old_proc_open (_IO_FILE *, const char *, const char *);
 extern int _IO_proc_close (_IO_FILE *) __THROW;
 extern int _IO_new_proc_close (_IO_FILE *) __THROW;
-extern int _IO_old_proc_close (_IO_FILE *) __THROW;
+extern int _IO_old_proc_close (_IO_FILE *);
 
 /* Jumptable functions for strfiles. */
 extern int _IO_str_underflow (_IO_FILE *) __THROW;
@@ -660,73 +644,62 @@ extern int _IO_vsnprintf (char *string, _IO_size_t maxlen,
 extern _IO_size_t _IO_getline (_IO_FILE *,char *, _IO_size_t, int, int);
 extern _IO_size_t _IO_getline_info (_IO_FILE *,char *, _IO_size_t,
 				    int, int, int *);
-extern _IO_ssize_t _IO_getdelim (char **, _IO_size_t *, int, _IO_FILE *)
-     __THROW;
+extern _IO_ssize_t _IO_getdelim (char **, _IO_size_t *, int, _IO_FILE *);
 extern _IO_size_t _IO_getwline (_IO_FILE *,wchar_t *, _IO_size_t, wint_t, int);
 extern _IO_size_t _IO_getwline_info (_IO_FILE *,wchar_t *, _IO_size_t,
 				     wint_t, int, wint_t *);
-extern double _IO_strtod (const char *, char **) __THROW;
-extern char *_IO_dtoa (double __d, int __mode, int __ndigits,
-		       int *__decpt, int *__sign, char **__rve) __THROW;
-extern int _IO_outfloat (double __value, _IO_FILE *__sb, int __type,
-			 int __width, int __precision, int __flags,
-			 int __sign_mode, int __fill) __THROW;
 
 extern struct _IO_FILE_plus *_IO_list_all;
 extern void (*_IO_cleanup_registration_needed) (void);
 
 /* Prototype for functions with alternative entry point.  */
-extern int _IO_flush_all_internal (void) __THROW;
-extern unsigned _IO_adjust_column_internal (unsigned, const char *, int)
-     __THROW;
+extern int _IO_flush_all_internal (void);
+extern unsigned _IO_adjust_column_internal (unsigned, const char *, int);
 
-extern int _IO_default_uflow_internal (_IO_FILE *) __THROW;
+extern int _IO_default_uflow_internal (_IO_FILE *);
 extern void _IO_default_finish_internal (_IO_FILE *, int) __THROW;
 extern int _IO_default_pbackfail_internal (_IO_FILE *, int) __THROW;
 extern _IO_size_t _IO_default_xsputn_internal (_IO_FILE *, const void *,
-					       _IO_size_t) __THROW;
-extern _IO_size_t _IO_default_xsgetn_internal (_IO_FILE *, void *, _IO_size_t)
-     __THROW;
+					       _IO_size_t);
+extern _IO_size_t _IO_default_xsgetn_internal (_IO_FILE *, void *, _IO_size_t);
 extern int _IO_default_doallocate_internal (_IO_FILE *) __THROW;
 extern void _IO_wdefault_finish_internal (_IO_FILE *, int) __THROW;
 extern wint_t _IO_wdefault_pbackfail_internal (_IO_FILE *, wint_t) __THROW;
 extern _IO_size_t _IO_wdefault_xsputn_internal (_IO_FILE *, const void *,
-						_IO_size_t) __THROW;
+						_IO_size_t);
 extern _IO_size_t _IO_wdefault_xsgetn_internal (_IO_FILE *, void *,
-						_IO_size_t) __THROW;
+						_IO_size_t);
 extern int _IO_wdefault_doallocate_internal (_IO_FILE *) __THROW;
-extern wint_t _IO_wdefault_uflow_internal (_IO_FILE *) __THROW;
+extern wint_t _IO_wdefault_uflow_internal (_IO_FILE *);
 
 extern int _IO_file_doallocate_internal (_IO_FILE *) __THROW;
-extern _IO_FILE* _IO_file_setbuf_internal (_IO_FILE *, char *, _IO_ssize_t)
-     __THROW;
+extern _IO_FILE* _IO_file_setbuf_internal (_IO_FILE *, char *, _IO_ssize_t);
 extern _IO_off64_t _IO_file_seekoff_internal (_IO_FILE *, _IO_off64_t,
-					      int, int) __THROW;
+					      int, int);
 extern _IO_size_t _IO_file_xsputn_internal (_IO_FILE *, const void *,
-					    _IO_size_t) __THROW;
-extern _IO_size_t _IO_file_xsgetn_internal (_IO_FILE *, void *, _IO_size_t)
-     __THROW;
+					    _IO_size_t);
+extern _IO_size_t _IO_file_xsgetn_internal (_IO_FILE *, void *, _IO_size_t);
 extern int _IO_file_stat_internal (_IO_FILE *, void *) __THROW;
 extern int _IO_file_close_internal (_IO_FILE *) __THROW;
-extern int _IO_file_close_it_internal (_IO_FILE *) __THROW;
-extern int _IO_file_underflow_internal (_IO_FILE *) __THROW;
-extern int _IO_file_overflow_internal (_IO_FILE *, int) __THROW;
+extern int _IO_file_close_it_internal (_IO_FILE *);
+extern int _IO_file_underflow_internal (_IO_FILE *);
+extern int _IO_file_overflow_internal (_IO_FILE *, int);
 extern void _IO_file_init_internal (struct _IO_FILE_plus *) __THROW;
-extern _IO_FILE* _IO_file_attach_internal (_IO_FILE *, int) __THROW;
+extern _IO_FILE* _IO_file_attach_internal (_IO_FILE *, int);
 extern _IO_FILE* _IO_file_fopen_internal (_IO_FILE *, const char *,
-					  const char *, int) __THROW;
+					  const char *, int);
 extern _IO_ssize_t _IO_file_read_internal (_IO_FILE *, void *,
 					   _IO_ssize_t);
-extern int _IO_file_sync_internal (_IO_FILE *) __THROW;
+extern int _IO_file_sync_internal (_IO_FILE *);
 extern _IO_off64_t _IO_file_seek_internal (_IO_FILE *, _IO_off64_t, int)
      __THROW;
-extern void _IO_file_finish_internal (_IO_FILE *, int) __THROW;
+extern void _IO_file_finish_internal (_IO_FILE *, int);
 
 extern _IO_size_t _IO_wfile_xsputn_internal (_IO_FILE *, const void *,
-					     _IO_size_t) __THROW;
+					     _IO_size_t);
 extern _IO_off64_t _IO_wfile_seekoff_internal (_IO_FILE *, _IO_off64_t,
-					       int, int) __THROW;
-extern wint_t _IO_wfile_sync_internal (_IO_FILE *) __THROW;
+					       int, int);
+extern wint_t _IO_wfile_sync_internal (_IO_FILE *);
 
 extern int _IO_str_underflow_internal (_IO_FILE *) __THROW;
 extern int _IO_str_overflow_internal (_IO_FILE *, int) __THROW;
@@ -747,12 +720,12 @@ extern void _IO_wdoallocbuf_internal (_IO_FILE *) __THROW;
 
 extern _IO_size_t _IO_sgetn_internal (_IO_FILE *, void *, _IO_size_t);
 extern void _IO_flush_all_linebuffered_internal (void) __THROW;
-extern int _IO_switch_to_wget_mode_internal (_IO_FILE *) __THROW;
+extern int _IO_switch_to_wget_mode_internal (_IO_FILE *);
 extern void _IO_unsave_markers_internal (_IO_FILE *) __THROW;
 extern void _IO_switch_to_main_wget_area_internal (_IO_FILE *) __THROW;
 extern int _IO_wdo_write_internal (_IO_FILE *, const wchar_t *, _IO_size_t);
 extern int _IO_do_write_internal (_IO_FILE *, const char *, _IO_size_t);
-extern _IO_ssize_t _IO_padn_internal (_IO_FILE *, int, _IO_ssize_t) __THROW;
+extern _IO_ssize_t _IO_padn_internal (_IO_FILE *, int, _IO_ssize_t);
 extern _IO_size_t _IO_getline_info_internal (_IO_FILE *,char *, _IO_size_t,
 					     int, int, int *);
 extern _IO_size_t _IO_getline_internal (_IO_FILE *, char *, _IO_size_t, int,
@@ -762,7 +735,7 @@ extern void _IO_free_backup_area_internal (_IO_FILE *) __THROW;
 extern void _IO_switch_to_wbackup_area_internal (_IO_FILE *) __THROW;
 extern void _IO_setb_internal (_IO_FILE *, char *, char *, int) __THROW;
 extern wint_t _IO_sputbackwc_internal (_IO_FILE *, wint_t) __THROW;
-extern int _IO_switch_to_get_mode_internal (_IO_FILE *) __THROW;
+extern int _IO_switch_to_get_mode_internal (_IO_FILE *);
 extern int _IO_vfscanf_internal (_IO_FILE * __restrict,
 				 const char * __restrict,
 				 _IO_va_list, int *__restrict);
@@ -772,9 +745,9 @@ extern void _IO_doallocbuf_internal (_IO_FILE *) __THROW;
 extern void _IO_wsetb_internal (_IO_FILE *, wchar_t *, wchar_t *, int)
      __THROW;
 extern _IO_off64_t _IO_seekoff_unlocked (_IO_FILE *, _IO_off64_t, int, int)
-     attribute_hidden __THROW;
+     attribute_hidden;
 extern _IO_off64_t _IO_seekpos_unlocked (_IO_FILE *, _IO_off64_t, int)
-     attribute_hidden __THROW;
+     attribute_hidden;
 extern int _IO_putc_internal (int __c, _IO_FILE *__fp);
 extern void _IO_init_internal (_IO_FILE *, int) __THROW;
 extern void _IO_un_link_internal (struct _IO_FILE_plus *) __THROW;
@@ -866,12 +839,6 @@ extern void _IO_un_link_internal (struct _IO_FILE_plus *) __THROW;
 #ifndef OS_FSTAT
 # define OS_FSTAT fstat
 #endif
-struct stat;
-extern _IO_ssize_t _IO_read (int, void *, _IO_size_t);
-extern _IO_ssize_t _IO_write (int, const void *, _IO_size_t);
-extern _IO_off64_t _IO_lseek (int, _IO_off64_t, int) __THROW;
-extern int _IO_close (int);
-extern int _IO_fstat (int, struct stat *) __THROW;
 extern int _IO_vscanf (const char *, _IO_va_list) __THROW;
 
 /* _IO_pos_BAD is an _IO_off64_t value indicating error, unknown, or EOF. */
diff --git a/libio/oldfileops.c b/libio/oldfileops.c
index a69c87e8b8..3bd0aa175b 100644
--- a/libio/oldfileops.c
+++ b/libio/oldfileops.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993, 1995, 1997-2004, 2005 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1997-2004, 2005, 2007
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Per Bothner <bothner@cygnus.com>.
 
@@ -271,7 +272,7 @@ _IO_old_file_setbuf (fp, p, len)
     return fp;
 }
 
-static int old_do_write (_IO_FILE *, const char *, _IO_size_t) __THROW;
+static int old_do_write (_IO_FILE *, const char *, _IO_size_t);
 
 /* Write TO_DO bytes from DATA to FP.
    Then mark FP as having empty buffers. */
diff --git a/libio/stdio.c b/libio/stdio.c
index b2baf65be3..8dc24ed98f 100644
--- a/libio/stdio.c
+++ b/libio/stdio.c
@@ -1,5 +1,4 @@
-/* Copyright (C) 1993,1994,1996,1997,2000,2002,2006
-   Free Software Foundation, Inc.
+/* Copyright (C) 1993,1994,1996,1997,2000,2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -41,9 +40,14 @@ _IO_FILE *stderr = (FILE *) &_IO_2_1_stderr_;
 #undef _IO_stderr
 #ifdef _LIBC
 # define AL(name) AL2 (name, _IO_##name)
-# define AL2(name, al) \
+# if defined HAVE_VISIBILITY_ATTRIBUTE
+#  define AL2(name, al) \
   extern __typeof (name) al __attribute__ ((alias (#name),                    \
                                             visibility ("hidden")))
+# else
+#  define AL2(name, al) \
+  extern __typeof (name) al __attribute__ ((alias (#name)))
+# endif
 AL(stdin);
 AL(stdout);
 AL(stderr);
diff --git a/libio/stdio.h b/libio/stdio.h
index 3738e6d3b6..5e74305638 100644
--- a/libio/stdio.h
+++ b/libio/stdio.h
@@ -166,27 +166,27 @@ __BEGIN_NAMESPACE_STD
    This function is a possible cancellation points and therefore not
    marked with __THROW.  */
 #ifndef __USE_FILE_OFFSET64
-extern FILE *tmpfile (void) __wur;
+extern FILE *tmpfile (void);
 #else
 # ifdef __REDIRECT
-extern FILE *__REDIRECT (tmpfile, (void), tmpfile64) __wur;
+extern FILE *__REDIRECT (tmpfile, (void), tmpfile64);
 # else
 #  define tmpfile tmpfile64
 # endif
 #endif
 
 #ifdef __USE_LARGEFILE64
-extern FILE *tmpfile64 (void) __wur;
+extern FILE *tmpfile64 (void);
 #endif
 
 /* Generate a temporary filename.  */
-extern char *tmpnam (char *__s) __THROW __wur;
+extern char *tmpnam (char *__s) __THROW;
 __END_NAMESPACE_STD
 
 #ifdef __USE_MISC
 /* This is the reentrant variant of `tmpnam'.  The only difference is
    that it does not allow S to be NULL.  */
-extern char *tmpnam_r (char *__s) __THROW __wur;
+extern char *tmpnam_r (char *__s) __THROW;
 #endif
 
 
@@ -199,7 +199,7 @@ extern char *tmpnam_r (char *__s) __THROW __wur;
    P_tmpdir is tried and finally "/tmp".  The storage for the filename
    is allocated by `malloc'.  */
 extern char *tempnam (__const char *__dir, __const char *__pfx)
-     __THROW __attribute_malloc__ __wur;
+     __THROW __attribute_malloc__;
 #endif
 
 
@@ -244,23 +244,21 @@ __BEGIN_NAMESPACE_STD
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern FILE *fopen (__const char *__restrict __filename,
-		    __const char *__restrict __modes) __wur;
+		    __const char *__restrict __modes);
 /* Open a file, replacing an existing stream with it.
 
    This function is a possible cancellation point and therefore not
    marked with __THROW.  */
 extern FILE *freopen (__const char *__restrict __filename,
 		      __const char *__restrict __modes,
-		      FILE *__restrict __stream) __wur;
+		      FILE *__restrict __stream);
 #else
 # ifdef __REDIRECT
 extern FILE *__REDIRECT (fopen, (__const char *__restrict __filename,
-				 __const char *__restrict __modes), fopen64)
-  __wur;
+				 __const char *__restrict __modes), fopen64);
 extern FILE *__REDIRECT (freopen, (__const char *__restrict __filename,
 				   __const char *__restrict __modes,
-				   FILE *__restrict __stream), freopen64)
-  __wur;
+				   FILE *__restrict __stream), freopen64);
 # else
 #  define fopen fopen64
 #  define freopen freopen64
@@ -269,15 +267,15 @@ extern FILE *__REDIRECT (freopen, (__const char *__restrict __filename,
 __END_NAMESPACE_STD
 #ifdef __USE_LARGEFILE64
 extern FILE *fopen64 (__const char *__restrict __filename,
-		      __const char *__restrict __modes) __wur;
+		      __const char *__restrict __modes);
 extern FILE *freopen64 (__const char *__restrict __filename,
 			__const char *__restrict __modes,
-			FILE *__restrict __stream) __wur;
+			FILE *__restrict __stream);
 #endif
 
 #ifdef	__USE_POSIX
 /* Create a new stream that refers to an existing system file descriptor.  */
-extern FILE *fdopen (int __fd, __const char *__modes) __THROW __wur;
+extern FILE *fdopen (int __fd, __const char *__modes) __THROW;
 #endif
 
 #ifdef	__USE_GNU
@@ -285,16 +283,15 @@ extern FILE *fdopen (int __fd, __const char *__modes) __THROW __wur;
    and uses the given functions for input and output.  */
 extern FILE *fopencookie (void *__restrict __magic_cookie,
 			  __const char *__restrict __modes,
-			  _IO_cookie_io_functions_t __io_funcs) __THROW __wur;
+			  _IO_cookie_io_functions_t __io_funcs) __THROW;
 
 /* Create a new stream that refers to a memory buffer.  */
-extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes)
-  __THROW __wur;
+extern FILE *fmemopen (void *__s, size_t __len, __const char *__modes) __THROW;
 
 /* Open a stream that writes into a malloc'd buffer that is expanded as
    necessary.  *BUFLOC and *SIZELOC are updated with the buffer's location
    and the number of characters written on fflush or fclose.  */
-extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW __wur;
+extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __THROW;
 #endif
 
 
@@ -370,13 +367,13 @@ __END_NAMESPACE_C99
    Store the address of the string in *PTR.  */
 extern int vasprintf (char **__restrict __ptr, __const char *__restrict __f,
 		      _G_va_list __arg)
-     __THROW __attribute__ ((__format__ (__printf__, 2, 0))) __wur;
+     __THROW __attribute__ ((__format__ (__printf__, 2, 0)));
 extern int __asprintf (char **__restrict __ptr,
 		       __const char *__restrict __fmt, ...)
-     __THROW __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
+     __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
 extern int asprintf (char **__restrict __ptr,
 		     __const char *__restrict __fmt, ...)
-     __THROW __attribute__ ((__format__ (__printf__, 2, 3))) __wur;
+     __THROW __attribute__ ((__format__ (__printf__, 2, 3)));
 
 /* Write formatted output to a file descriptor.
 
diff --git a/libio/vswprintf.c b/libio/vswprintf.c
index e9a316a01c..5bbd20227b 100644
--- a/libio/vswprintf.c
+++ b/libio/vswprintf.c
@@ -119,7 +119,7 @@ _IO_vswprintf (string, maxlen, format, args)
 
   if (sf.f._sbf._f._wide_data->_IO_buf_base == sf.overflow_buf)
     /* ISO C99 requires swprintf/vswprintf to return an error if the
-       output does not fit in the provided buffer.  */
+       output does not fit int he provided buffer.  */
     return -1;
 
   /* Terminate the string.  */