From owner-freebsd-current@FreeBSD.ORG Fri Dec 26 22:33:12 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A60B16A4CE; Fri, 26 Dec 2003 22:33:12 -0800 (PST) Received: from mhub-m5.tc.umn.edu (mhub-m5.tc.umn.edu [160.94.23.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id AA49E43D46; Fri, 26 Dec 2003 22:33:10 -0800 (PST) (envelope-from ryans@gamersimpact.com) Received: from [24.107.70.120] by mhub-m5.tc.umn.edu with ESMTP; Sat, 27 Dec 2003 00:33:09 -0600 From: Ryan Sommers To: Yaoping Ruan In-Reply-To: <3FECB894.54922CA6@cs.princeton.edu> References: <3FECB894.54922CA6@cs.princeton.edu> Content-Type: text/plain Message-Id: <1072506787.650.48.camel@localhost> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Sat, 27 Dec 2003 00:33:07 -0600 Content-Transfer-Encoding: 7bit cc: hackers@freebsd.org cc: freebsd-current@freebsd.org Subject: Re: select() in 5.X X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Dec 2003 06:33:12 -0000 On Fri, 2003-12-26 at 16:39, Yaoping Ruan wrote: > Not sure if somebody here has already noticed this problem before. I > have a small program using select() . Though it works correctly on 4.x, > some problem happens on 5.1. First of all, I notice that macros about > FD_xx have been moved into sys/select.h. Then FD_ZERO() seems to be > failed. My program looks like follow: > > main( ) > { ... > fd_set rfdset; > > FD_ZERO(&rfdset); > > .... > } > I'm unable to duplicate your results. Are you setting FD_SETSIZE somewhere? Here are my results on 5.2-CURRENT (note sys/select.h hasn't been changed for 11 months and that log didn't mention the macros): Script started on Sat Dec 27 00:24:39 2003 ryans@lilshadow(~/src):gdb ./test GNU gdb 5.2.1 (FreeBSD) Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-undermydesk-freebsd"... (gdb) list 7 2#include 3 4void 5main() 6{ 7int n = _howmany(FD_SETSIZE, _NFDBITS); 8fd_set tset; 9 10FD_ZERO(&tset); 11}; (gdb) break 8 Breakpoint 1 at 0x80484ce: file test.c, line 8. (gdb) run Starting program: /usr/home/ryans/src/test Breakpoint 1, main () at test.c:10 10FD_ZERO(&tset); (gdb) print n $1 = 32 (gdb) print tset $2 = {__fds_bits = {134513140, 3217025816, 671419022, 134513327, 109760260, 671535104, 3217025800, 1, 671514200, 3217025816, 671419879, 671547392, 16777216, 671535616, 671514200, 671514200, 672308176, 3217025864, 671406660, 672307790, 1, 3217025848, 1, 1, 3217025948, 3217025940, 3217025900, 672308220, 3217025876, 3217025932, 671404993, 671535104}} (gdb) next 11}; (gdb) print tset $3 = {__fds_bits = {0 }} (gdb) quit The program is running. Exit anyway? (y or n) y ryans@lilshadow(~/src):exit exit Script done on Sat Dec 27 00:25:10 2003 -- Ryan "leadZERO" Sommers Gamer's Impact President ryans@gamersimpact.com ICQ: 1019590 AIM/MSN: leadZERO -= http://www.gamersimpact.com =-