]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* sysdeps/unix/sysv/linux/sparc/bits/siginfo.h (struct sigevent):
authorUlrich Drepper <drepper@redhat.com>
Thu, 5 Feb 2009 00:21:43 +0000 (00:21 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 5 Feb 2009 00:21:43 +0000 (00:21 +0000)
Add _tid slot to maintain consistency with kernel.

ChangeLog
libio/wfileops.c
sysdeps/unix/sysv/linux/sparc/bits/siginfo.h

index 59fb6a1e25ff925b63bdb4ddd5504fbd118846e4..54e96abc8d807cedffb9a9384127826db96b3f82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-11-17  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * sysdeps/unix/sysv/linux/sparc/bits/siginfo.h (struct sigevent):
+       Add _tid slot to maintain consistency with kernel.
+
 2009-02-04  Ulrich Drepper  <drepper@redhat.com>
 
        * libio/wfileops.c (_IO_wfile_underflow): Fix handling of
index c5f0eaf6a7785c4702fd15866da33efd5e1b5280..57ed786a8f2eb9405d9e248adb04aa9ac33653e7 100644 (file)
@@ -297,14 +297,34 @@ _IO_wfile_underflow (fp)
 
       if (naccbuf == 0)
        {
+         if (fp->_IO_read_base < fp->_IO_read_ptr)
+           {
+             /* Partially used the buffer for some input data that
+                produces no output.  */
+             size_t avail = fp->_IO_read_end - fp->_IO_read_ptr;
+             memmove (fp->_IO_read_base, fp->_IO_read_ptr, avail);
+             fp->_IO_read_ptr = fp->_IO_read_base;
+             fp->_IO_read_end -= avail;
+             goto again;
+           }
          naccbuf = fp->_IO_read_end - fp->_IO_read_ptr;
          if (naccbuf >= sizeof (accbuf))
            goto out_eilseq;
 
          memcpy (accbuf, fp->_IO_read_ptr, naccbuf);
        }
-      else if (naccbuf == sizeof (accbuf))
-       goto out_eilseq;
+      else
+       {
+         size_t used = read_ptr_copy - accbuf;
+         if (used > 0)
+           {
+             memmove (accbuf, read_ptr_copy, naccbuf - used);
+             naccbuf -= used;
+           }
+
+         if (naccbuf == sizeof (accbuf))
+           goto out_eilseq;
+       }
 
       fp->_IO_read_ptr = fp->_IO_read_end = fp->_IO_read_base;
 
index 7ff1971c2a412c8440fbcbcc6eb1aa15b4e70216..c0f98f6072ea5f115a0bcca977e7278be1e4e410 100644 (file)
@@ -289,6 +289,10 @@ typedef struct sigevent
       {
        int _pad[__SIGEV_PAD_SIZE];
 
+       /* When SIGEV_SIGNAL and SIGEV_THREAD_ID set, LWP ID of the
+          thread to receive the signal.  */
+       __pid_t _tid;
+
        struct
          {
            void (*_function) (sigval_t);       /* Function to start.  */