This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Misc fixes


Hi!

Most of the changes don't probably need comments, they are there just
to shut up warnings or fix tst-clock2 failing on i386.
The __nwaiters change makes x86-64 look like the rest of arches,
consistency is good and the type really should be unsigned.
The allocatestack.c change is to make GCC 4 and 3.4.2-RH happy,
otherwise I get:
allocatestack.c:778: warning: `visibility' attribute ignored on non-class types
You know the GCC PR for this already...

2004-10-06  Jakub Jelinek  <jakub@redhat.com>

	* posix/tst-getaddrinfo2.c: Include stdlib.h and string.h.
	(do_test): Use %p instead of 0x%08X to print a pointer.

	* malloc/malloc.c: Include stdio-common/_itoa.h.
nptl/
	* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h (pthread_cond_t):
	Change __data.__nwaiters from int to unsigned int.

	* tst-clock2.c (do_test): Don't fail if _POSIX_THREAD_CPUTIME == 0 and
	sysconf (_SC_THREAD_CPUTIME) returns negative value.

	* allocatestack.c (__find_thread_by_id): Move attribute_hidden
	before return type.

--- libc/posix/tst-getaddrinfo2.c.jj	2004-09-26 10:42:15.000000000 +0200
+++ libc/posix/tst-getaddrinfo2.c	2004-10-06 13:03:39.000000000 +0200
@@ -2,6 +2,8 @@
 #include <errno.h>
 #include <netdb.h>
 #include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/socket.h>
 
 static int
@@ -47,7 +49,7 @@ do_test (void)
       if (err)
         {
           printf ("FAIL getaddrinfo IPv4 socktype 0,513: "
-                  "fam %d alen %d addr 0x%08X addr/fam %d "
+                  "fam %d alen %d addr %p addr/fam %d "
                   "addr/port %d H[%d]\n",
                   pai->ai_family, pai->ai_addrlen, psin,
                   psin ? psin->sin_family : 0,
--- libc/malloc/malloc.c.jj	2004-10-05 09:04:44.000000000 +0200
+++ libc/malloc/malloc.c	2004-10-06 12:59:31.000000000 +0200
@@ -257,6 +257,10 @@
 
 #include <malloc-machine.h>
 
+#ifdef _LIBC
+#include <stdio-common/_itoa.h>
+#endif
+
 #ifdef __cplusplus
 extern "C" {
 #endif
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h.jj	2004-09-30 00:50:04.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h	2004-10-06 12:55:33.312919606 +0200
@@ -100,7 +100,7 @@ typedef union
     __extension__ unsigned long long int __wakeup_seq;
     __extension__ unsigned long long int __woken_seq;
     void *__mutex;
-    int __nwaiters;
+    unsigned int __nwaiters;
     unsigned int __broadcast_seq;
   } __data;
   char __size[__SIZEOF_PTHREAD_COND_T];
--- libc/nptl/tst-clock2.c.jj	2004-10-06 11:04:06.000000000 +0200
+++ libc/nptl/tst-clock2.c	2004-10-06 13:21:51.000000000 +0200
@@ -58,6 +58,14 @@ do_test (void)
 #if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
 # define N 10
 
+# if _POSIX_THREAD_CPUTIME == 0
+  if (sysconf (_SC_THREAD_CPUTIME) < 0)
+    {
+      puts ("_POSIX_THREAD_CPUTIME option not available");
+      return 0;
+    }
+# endif
+
   if (pthread_barrier_init (&b2, NULL, 2) != 0
       || pthread_barrier_init (&bN, NULL, N + 1) != 0)
     {
--- libc/nptl/allocatestack.c.jj	2004-10-06 13:17:51.000000000 +0200
+++ libc/nptl/allocatestack.c	2004-10-06 13:17:51.000000000 +0200
@@ -772,8 +772,8 @@ __reclaim_stacks (void)
 
 #if HP_TIMING_AVAIL
 /* Find a thread given the thread ID.  */
-struct pthread *
 attribute_hidden
+struct pthread *
 __find_thread_by_id (pid_t tid)
 {
   struct pthread *result = NULL;

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]