[klibc] [klibc:master] include: [sys/time.h] fix for Linux 3.5.1

klibc-bot for Colin Watson cjwatson at ubuntu.com
Mon Oct 1 06:12:02 PDT 2012

Commit-ID:  0dbcedacde2847e254373fce6f80c63e003a69ca
Gitweb:     http://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=0dbcedacde2847e254373fce6f80c63e003a69ca
Author:     Colin Watson <cjwatson at ubuntu.com>
AuthorDate: Tue, 25 Sep 2012 12:31:16 +0100
Committer:  maximilian attems <max at stro.at>
CommitDate: Mon, 1 Oct 2012 15:04:49 +0200

[klibc] include: [sys/time.h] fix for Linux 3.5.1

>From 3.5.1, <linux/time.h> does not even define FD_ZERO etc.

With Linux 3.5.1, 'make test' fails with:

  usr/klibc/tests/select.c: In function ‘main’:
  usr/klibc/tests/select.c:31:14: error: ‘FD_SETSIZE’ undeclared (first use in this function)
  usr/klibc/tests/select.c:31:14: note: each undeclared identifier is reported only once for each function it appears in

This is due to Linux commit 8ded2bbc1845e19c771eb55209aab166ef011243.
Handle it by making sure that FD_SETSIZE is defined.

Signed-off-by: Colin Watson <cjwatson at ubuntu.com>
Signed-off-by: maximilian attems <max at stro.at>

 usr/include/sys/time.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/usr/include/sys/time.h b/usr/include/sys/time.h
index 7a2f8b9..98497e7 100644
--- a/usr/include/sys/time.h
+++ b/usr/include/sys/time.h
@@ -23,6 +23,7 @@
 #undef FD_SET
 #undef FD_CLR
 #undef FD_ISSET
+#undef FD_SETSIZE
 __extern void *memset(void *, int, size_t);
 static inline void FD_ZERO(fd_set *__fdsetp)
@@ -45,6 +46,8 @@ static inline int FD_ISSET(int __fd, fd_set *__fdsetp)
 		(__fd % BITS_PER_LONG)) & 1;
 __extern int gettimeofday(struct timeval *, struct timezone *);
 __extern int settimeofday(const struct timeval *, const struct timezone *);
 __extern int getitimer(int, struct itimerval *);

More information about the klibc mailing list