about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-04-13 13:16:49 -0400
committerRich Felker <dalias@aerifal.cx>2011-04-13 13:16:49 -0400
commitcac7d837ccc35b7e80d8f1eb7338f8e9d8b1b2d8 (patch)
treeb95687d3a7052d9e73046b6c5e212962390e5461
parent91e836fda7d4e2a4ba38d5faec6e3876b1b5e179 (diff)
downloadmusl-cac7d837ccc35b7e80d8f1eb7338f8e9d8b1b2d8.tar.gz
musl-cac7d837ccc35b7e80d8f1eb7338f8e9d8b1b2d8.tar.xz
musl-cac7d837ccc35b7e80d8f1eb7338f8e9d8b1b2d8.zip
fix and cleanup suseconds_t/timeval stuff (broken on 64-bit)
trash in the upper 32 bits was making the kernel sleep forever in
select on 64-bit systems.
-rwxr-xr-xarch/x86_64/bits/alltypes.h.sh2
-rw-r--r--include/sys/select.h1
-rw-r--r--include/sys/time.h9
3 files changed, 2 insertions, 10 deletions
diff --git a/arch/x86_64/bits/alltypes.h.sh b/arch/x86_64/bits/alltypes.h.sh
index af2a4d9a..19843bd3 100755
--- a/arch/x86_64/bits/alltypes.h.sh
+++ b/arch/x86_64/bits/alltypes.h.sh
@@ -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;
diff --git a/include/sys/select.h b/include/sys/select.h
index c44eada4..54d8030f 100644
--- a/include/sys/select.h
+++ b/include/sys/select.h
@@ -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
diff --git a/include/sys/time.h b/include/sys/time.h
index 70fd5687..b39800f2 100644
--- a/include/sys/time.h
+++ b/include/sys/time.h
@@ -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)