]> sourceware.org Git - glibc.git/commitdiff
Make libio compile without _IO_MTSAFE_IO.
authorRoland McGrath <roland@hack.frob.com>
Fri, 17 Aug 2012 16:35:36 +0000 (09:35 -0700)
committerRoland McGrath <roland@hack.frob.com>
Fri, 17 Aug 2012 16:35:36 +0000 (09:35 -0700)
ChangeLog
libio/genops.c
libio/libioP.h
misc/Makefile
nptl/ChangeLog
nptl/sysdeps/unix/sysv/linux/Makefile

index 3e37db91a150215d5bd6cc821477e1ab4024e933..9d8543c8850815a90ed1e0caa64e043c1e589112 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-08-17  Roland McGrath  <roland@hack.frob.com>
 
+       * libio/genops.c (_IO_unbuffer_write): Conditionalize locking code on
+       [_IO_MTSAFE_IO].
+       * libio/libioP.h [!_IO_MTSAFE_IO && !NOT_IN_libc]
+       (_IO_acquire_lock, _IO_acquire_lock_clear_flags2, _IO_release_lock):
+       New macros.
+
        * Makeconfig [$(libc-reentrant) = yes] (libio-mtsafe): New variable.
        * libio/Makefile (CPPFLAGS): Append $(libio-mtsafe) unconditionally
        rather than -D_IO_MTSAFE_IO conditionally.
index c8297ff1286ff3e8046e5f5b50c85f3edeecfcc6..0a81a5d101c6bf9c3f2938d037afcff3a65f7c1a 100644 (file)
@@ -952,6 +952,7 @@ _IO_unbuffer_write (void)
          /* Iff stream is un-orientated, it wasn't used. */
          && fp->_mode != 0)
        {
+#ifdef _IO_MTSAFE_IO
          int cnt;
 #define MAXTRIES 2
          for (cnt = 0; cnt < MAXTRIES; ++cnt)
@@ -961,6 +962,7 @@ _IO_unbuffer_write (void)
              /* Give the other thread time to finish up its use of the
                 stream.  */
              __sched_yield ();
+#endif
 
          if (! dealloc_buffers && !(fp->_flags & _IO_USER_BUF))
            {
@@ -974,8 +976,10 @@ _IO_unbuffer_write (void)
 
          _IO_SETBUF (fp, NULL, 0);
 
+#ifdef _IO_MTSAFE_IO
          if (cnt < MAXTRIES && fp->_lock != NULL)
            _IO_lock_unlock (*fp->_lock);
+#endif
        }
 
       /* Make sure that never again the wide char functions can be
index 486c670b519e168b9c5a5d017575633c66b15652..aa2b3bfa907123202e94056ccff03e102c8966b5 100644 (file)
@@ -933,3 +933,17 @@ _IO_acquire_lock_clear_flags2_fct (_IO_FILE **p)
   if ((fp->_flags & _IO_USER_LOCK) == 0)
     _IO_funlockfile (fp);
 }
+
+#if !defined _IO_MTSAFE_IO && !defined NOT_IN_libc
+# define _IO_acquire_lock(_fp)                                               \
+  do {                                                                       \
+    _IO_FILE *_IO_acquire_lock_file = NULL
+# define _IO_acquire_lock_clear_flags2(_fp)                                  \
+  do {                                                                       \
+    _IO_FILE *_IO_acquire_lock_file = (_fp)
+# define _IO_release_lock(_fp)                                               \
+    if (_IO_acquire_lock_file != NULL)                                       \
+      _IO_acquire_lock_file->_flags2 &= ~(_IO_FLAGS2_FORTIFY                 \
+                                          | _IO_FLAGS2_SCANF_STD);           \
+  } while (0)
+#endif
index d1c0a02e17aabb19993a3224f099ec2925695c7d..d35654cc3f4a5f0f22ac39c6322153fc77413226 100644 (file)
@@ -95,7 +95,6 @@ CFLAGS-getsysstats.c = -fexceptions
 CFLAGS-getusershell.c = -fexceptions
 CFLAGS-err.c = -fexceptions
 CFLAGS-tst-tsearch.c = $(stack-align-test-flags)
-CFLAGS-mntent_r.c = -D_IO_MTSAFE_IO
 
 include ../Rules
 
index 8a8cbb8d3db189bec8238255897a527c55f9dd56..eb84863588f6ed1c3dfa3b1e55c2791209ec9485 100644 (file)
@@ -1,8 +1,13 @@
+2012-08-15  Roland McGrath  <roland@hack.frob.com>
+
+2012-08-15  Roland McGrath  <roland@hack.frob.com>
+
 2012-08-15  Roland McGrath  <roland@hack.frob.com>
 
        * Makefile (CFLAGS-flockfile.c): Use $(libio-mtsafe) instead
        of -D_IO_MTSAFE_IO.
        (CFLAGS-ftrylockfile.c, CFLAGS-funlockfile.c): Likewise.
+       * sysdeps/unix/sysv/linux/Makefile (CFLAGS-fork.c): Likewise.
 
 2012-08-16  Joseph Myers  <joseph@codesourcery.com>
 
index 64a3f4f0d0192a6adaba03beb3a3735d86275426..d24a9bc7a29388dc52c45fa4cb3d7efce7d6d351 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -29,7 +29,7 @@ gen-as-const-headers += lowlevelcond.sym lowlevelrwlock.sym \
 endif
 
 ifeq ($(subdir),posix)
-CFLAGS-fork.c = -D_IO_MTSAFE_IO
+CFLAGS-fork.c = $(libio-mtsafe)
 CFLAGS-getpid.o = -fomit-frame-pointer
 CFLAGS-getpid.os = -fomit-frame-pointer
 endif
This page took 0.141042 seconds and 5 git commands to generate.