Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <5.1.1.6.2.20030319175830.00a020f0@mail.actron.com> X-Sender: nsomos AT mail DOT actron DOT com Date: Wed, 19 Mar 2003 18:17:48 -0500 To: cygwin AT cygwin DOT com From: Neil Somos Subject: strange bug : select() always generate 10022 error Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Compiling with -E can give some clues. The second case winds up producing some code like ... do { u_int __i;for (__i = 0; __i < ((fd_set *)(&fds))->fd_count ; __i++) { if (((fd_set *)(&fds))->fd_array[__i] == ((unsigned)s)) { break; }}if (__i == ((fd_set *)(&fds))->fd_count) { if (((fd_set *)(&fds))->fd_count < 64) { ((fd_set *)(&fds))->fd_array[__i] = ((unsigned)s); ((fd_set *)(&fds))->fd_count++; }}} while(0); while the first case produces code like ... (__extension__ (void)({ size_t __i; char *__tmp = (char *)&fds; for (__i = 0; __i < sizeof (*(&fds)); ++__i) *__tmp++ = 0; })); (Yes each of those are actually just one long line) If it is really important, then you can carefully track down the results of preprocessing in each case, and figure out what is being superceded by what else to cause this sort of effect. Although there are other differences, they are mainly just a name change and its effects. (fd_set versus _types_fd_set) The second case also winds up referencing SOCKET fd_array[64]; while the first one does not; This may be a clue. neal -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/