]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Wed, 7 Jun 2000 22:50:32 +0000 (22:50 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 7 Jun 2000 22:50:32 +0000 (22:50 +0000)
2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>

Lock for stdio stream list becomes global, for use in LinuxThreads.

* libio/genops.c (_IO_iter_begin, _IO_iter_end,
_IO_iter_next, _IO_iter_file, _IO_list_lock, _IO_list_unlock,
_IO_list_resetlock): New interface for iterating global list of
streams without accessing the _IO_list_all global variable,
and for manipulating the lock which protects this list.
* libio/libioP.h: Likewise.
* libio/Version: Add entries for the new functions.

* libio/libioP.h (_IO_ITER): New typedef, just an alias for
pointer to _IO_FILE.

ChangeLog
libio/Versions
libio/genops.c
libio/libioP.h

index 8143dc479f0de1de8af80fdfbdab23cb5e88269d..e15d6c43b4143061e270ce8949729645ce2ea4dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2000-06-04  Kaz Kylheku  <kaz@ashi.footprints.net>
+
+       Lock for stdio stream list becomes global, for use in LinuxThreads.
+
+       * libio/genops.c (_IO_iter_begin, _IO_iter_end,
+       _IO_iter_next, _IO_iter_file, _IO_list_lock, _IO_list_unlock,
+       _IO_list_resetlock): New interface for iterating global list of
+       streams without accessing the _IO_list_all global variable,
+       and for manipulating the lock which protects this list.
+       * libio/libioP.h: Likewise.
+       * libio/Version: Add entries for the new functions.
+
+       * libio/libioP.h (_IO_ITER): New typedef, just an alias for
+       pointer to _IO_FILE.
+
 2000-06-07  Ulrich Drepper  <drepper@redhat.com>
 
        * locale/programs/ld-ctype.c (set_class_defaults): Several uses of
index 654ca29a895896313b2212bf2354d7cd630ebf1a..1fbc313cb9a0bbc18dd6c02546990eecb8738a53 100644 (file)
@@ -104,6 +104,10 @@ libc {
     # functions used in libstdc++
     _IO_fgetpos; _IO_fgetpos64; _IO_fsetpos; _IO_fsetpos64;
 
+    # LinuxThreads uses this protected interface
+    _IO_iter_begin; _IO_iter_end; _IO_iter_next; _IO_iter_file;
+    _IO_list_lock; _IO_list_unlock; _IO_list_resetlock;
+
     # f*
     fgetpos; fgetpos64; fgetwc; fgetwc_unlocked; fgetws; fgetws_unlocked;
     fputwc; fputwc_unlocked; fputws; fputws_unlocked; fsetpos; fsetpos64;
index c59518143f5a138025a0d397510533b19d79635d..fb4f08bd3faf06c66718a27d50317cdd35b14fed 100644 (file)
@@ -1028,6 +1028,50 @@ _IO_default_imbue (fp, locale)
 {
 }
 
+_IO_ITER
+_IO_iter_begin()
+{
+  return _IO_list_all;
+}
+
+_IO_ITER
+_IO_iter_end()
+{
+       return NULL;
+}
+
+_IO_ITER
+_IO_iter_next(iter)
+    _IO_ITER iter;
+{
+  return iter->_chain;
+}
+
+_IO_FILE *
+_IO_iter_file(iter)
+    _IO_ITER iter;
+{
+  return iter;
+}
+
+void
+_IO_list_lock()
+{
+  _IO_lock_lock (list_all_lock);
+}
+
+void
+_IO_list_unlock()
+{
+    _IO_lock_unlock (list_all_lock);
+}
+
+void
+_IO_list_resetlock()
+{
+  _IO_lock_init (list_all_lock);
+}
+
 
 #ifdef TODO
 #if defined(linux)
index 59d20cd4be9ca8767a3027318bb487ceb9a522ac..090f98a02d54733929de151f223f69de7d0259be 100644 (file)
@@ -313,6 +313,10 @@ struct _IO_FILE_plus
   const struct _IO_jump_t *vtable;
 };
 
+/* Iterator type for walking global linked list of _IO_FILE objects. */
+
+typedef _IO_FILE *_IO_ITER;
+
 /* Generic functions */
 
 extern void _IO_switch_to_main_get_area __P ((_IO_FILE *));
@@ -351,6 +355,17 @@ extern int _IO_wmarker_delta __P ((struct _IO_marker *));
 extern int _IO_seekmark __P ((_IO_FILE *, struct _IO_marker *, int));
 extern int _IO_seekwmark __P ((_IO_FILE *, struct _IO_marker *, int));
 
+/* Functions for iterating global list and dealing with
+   its lock */
+
+extern _IO_ITER _IO_iter_begin __P ((void));
+extern _IO_ITER _IO_iter_end __P ((void));
+extern _IO_ITER _IO_iter_next __P ((_IO_ITER));
+extern _IO_FILE *_IO_iter_file __P ((_IO_ITER));
+extern void _IO_list_lock __P ((void));
+extern void _IO_list_unlock __P ((void));
+extern void _IO_list_resetlock __P ((void));
+
 /* Default jumptable functions. */
 
 extern int _IO_default_underflow __P ((_IO_FILE *));