From owner-freebsd-current@FreeBSD.ORG Fri Jan 11 20:42:03 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DA20193F; Fri, 11 Jan 2013 20:42:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id B85AFF72; Fri, 11 Jan 2013 20:42:03 +0000 (UTC) Received: from ralph.baldwin.cx (c-68-39-198-164.hsd1.de.comcast.net [68.39.198.164]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 10165B968; Fri, 11 Jan 2013 15:42:03 -0500 (EST) From: John Baldwin To: freebsd-current@freebsd.org Subject: Re: FILE's _file can only hold a short Date: Fri, 11 Jan 2013 10:44:32 -0500 User-Agent: KMail/1.13.7 (FreeBSD/9.1-PRERELEASE; KDE/4.8.4; amd64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201301111044.32719.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 11 Jan 2013 15:42:03 -0500 (EST) Cc: mdf@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Fri, 11 Jan 2013 20:42:03 -0000 On Wednesday, October 31, 2012 02:12:55 PM mdf@freebsd.org wrote: > I seem to recall a thread earlier on this limitation, but looking at > actual libc/stdio sources, the 4 year old check for open(2)'s fd being > less than SHRT_MAX is still there. I thought I saw a patch to change > this to an int, but it's not in the tree. Was this in a PR or a > mailing list thread or am I just imagining things? > > We've run into this limitation at work, where some processes have > around 32k open file descriptors and then try to use the libc FILE > interface. Since we control ABI we can just change this to int, but I > had been hoping there was a FreeBSD revision we could pull instead of > having another diff. I had been working on a port-exp run. The problem I have run into is that perl actually reaches inside of FILE directly to clear out _file so it can control when the fd is actually closed (really gross). I have extended my stuff so that old Perl binaries should still work, but wanted to figure out how to prevent future Perl binaries from growing the same dependency. Also, I haven't had a chance to do a follow-up to find what else out in ports-land tries to use _file directly from FILE. -- John Baldwin