fix and cleanup suseconds_t/timeval stuff (broken on 64-bit)
authorRich Felker <dalias@aerifal.cx>
Wed, 13 Apr 2011 17:16:49 +0000 (13:16 -0400)
committerRich Felker <dalias@aerifal.cx>
Wed, 13 Apr 2011 17:16:49 +0000 (13:16 -0400)
trash in the upper 32 bits was making the kernel sleep forever in
select on 64-bit systems.

arch/x86_64/bits/alltypes.h.sh
include/sys/select.h
include/sys/time.h

index af2a4d9accfcb9e8f433b34fe3291ebfe4fb643e..19843bd388c05b5c9c1db3682b1e1c8a0896800f 100755 (executable)
@@ -55,7 +55,7 @@ TYPEDEF unsigned long uintptr_t;
 
 TYPEDEF long time_t;
 TYPEDEF long suseconds_t;
-STRUCT timeval { time_t tv_sec; int tv_usec; };
+STRUCT timeval { time_t tv_sec; long tv_usec; };
 STRUCT timespec { time_t tv_sec; long tv_nsec; };
 
 TYPEDEF int pid_t;
index c44eada4cb4ff7593fe6a8aef8bef196bdd0736d..54d8030ff485cd6dfe854f4ce8953fbc65cf07df 100644 (file)
@@ -6,6 +6,7 @@ extern "C" {
 
 #define __NEED_size_t
 #define __NEED_time_t
+#define __NEED_suseconds_t
 #define __NEED_struct_timeval
 #define __NEED_struct_timespec
 #define __NEED_sigset_t
index 70fd56874c20339914367ef4fee0a55c51ac5954..b39800f29f94d6b394bf6f27d0c629b80bc602e5 100644 (file)
@@ -4,17 +4,8 @@
 extern "C" {
 #endif
 
-/* All symbols from select.h except pselect are required anyway... */
 #include <sys/select.h>
 
-#define __NEED_time_t
-#define __NEED_suseconds_t
-#define __NEED_struct_timeval
-
-#include <bits/alltypes.h>
-
-
-
 int gettimeofday (struct timeval *, void *);
 
 #if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)