There is no reason to include <sys/socket.h> from <sys/select.h> except on native Windows platforms. I've tested this on various platforms.
2010-12-24 Bruno Haible <br...@clisp.org> sys_select: Remove unneeded include. * lib/sys_select.in.h: Don't include <sys/socket.h> on platforms that have <sys/select.h>. --- lib/sys_select.in.h.orig Fri Dec 24 16:21:19 2010 +++ lib/sys_select.in.h Fri Dec 24 16:19:49 2010 @@ -65,8 +65,11 @@ #ifndef _GL_SYS_SELECT_H #define _GL_SYS_SELECT_H -#if !...@have_sys_select_h@ || @REPLACE_SELECT@ +#if !...@have_sys_select_h@ /* A platform that lacks <sys/select.h>. */ +/* On native Windows platforms: + Get the 'fd_set' type. Also, gnulib's <sys/socket.h> redefines select + so as to hide the declaration from <winsock2.h>. */ # include <sys/socket.h> #endif