about summary refs log tree commit diff
path: root/libio/iofgetpos.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/iofgetpos.c')
-rw-r--r--libio/iofgetpos.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/libio/iofgetpos.c b/libio/iofgetpos.c
index 27f018d07f..5b8f6a4129 100644
--- a/libio/iofgetpos.c
+++ b/libio/iofgetpos.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 95, 96, 97, 98, 99 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -27,11 +27,11 @@
 #include <errno.h>
 
 int
-_IO_fgetpos (fp, posp)
+_IO_new_fgetpos (fp, posp)
      _IO_FILE *fp;
      _IO_fpos_t *posp;
 {
-  _IO_fpos_t pos;
+  _IO_off_t pos;
   CHECK_FILE (fp, EOF);
   _IO_cleanup_region_start ((void (*) __P ((void *))) _IO_funlockfile, fp);
   _IO_flockfile (fp);
@@ -50,10 +50,16 @@ _IO_fgetpos (fp, posp)
 #endif
       return EOF;
     }
-  *posp = pos;
+  posp->__pos = pos;
+  if (fp->_mode > 0
+      && (*fp->_codecvt->__codecvt_do_encoding) (fp->_codecvt) < 0)
+    /* This is a stateful encoding, safe the state.  */
+    posp->__state = fp->_wide_data->_IO_state;
   return 0;
 }
 
 #ifdef weak_alias
-weak_alias (_IO_fgetpos, fgetpos)
+strong_alias (_IO_new_fgetpos, __new_fgetpos)
+default_symbol_version (_IO_new_fgetpos, _IO_fgetpos, GLIBC_2.2);
+default_symbol_version (__new_fgetpos, fgetpos, GLIBC_2.2);
 #endif