From owner-freebsd-current Thu Jul 18 10:46:18 2002 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 619A937B400 for ; Thu, 18 Jul 2002 10:46:16 -0700 (PDT) Received: from mail.speakeasy.net (mail13.speakeasy.net [216.254.0.213]) by mx1.FreeBSD.org (Postfix) with ESMTP id 917FD43E58 for ; Thu, 18 Jul 2002 10:46:15 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 7779 invoked from network); 18 Jul 2002 17:46:14 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail13.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 18 Jul 2002 17:46:14 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g6IHkC062154; Thu, 18 Jul 2002 13:46:13 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 Date: Thu, 18 Jul 2002 13:46:18 -0400 (EDT) From: John Baldwin To: dillon@FreeBSD.org Subject: Questions about kern_descrip.c Cc: current@FreeBSD.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In revision 1.94 of kern_descrip.c, in the dup2() syscall a goto retry loop was added so that if we did a fdalloc() we always retested everything. Since fd_nfiles can't shrink and new and old can't change, I don't see why the loop is necessary. Neither dup() or the F_DUPFD fcntl() were modified in this way either. Also, calling fdalloc() in this case is somewhat bogus, because fdalloc() is going to try and reserve an open slot and update variables such as fd_lastfile, etc. appropriately. Perhaps we should have an fdextend() function that both dup2() and fdalloc() call? Also, in do_dup() you have commented out the call to munmapfd() on an open file with UF_MAPPED and never turned it back on. Was that intentional or just an accidental oversight? -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message