From owner-freebsd-current@FreeBSD.ORG  Fri Nov  2 19:09:39 2012
Return-Path: <owner-freebsd-current@FreeBSD.ORG>
Delivered-To: freebsd-current@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
 by hub.freebsd.org (Postfix) with ESMTP id E6BC5ED4
 for <freebsd-current@freebsd.org>; Fri,  2 Nov 2012 19:09:39 +0000 (UTC)
 (envelope-from mdf356@gmail.com)
Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com
 [209.85.220.54])
 by mx1.freebsd.org (Postfix) with ESMTP id B363B8FC08
 for <freebsd-current@freebsd.org>; Fri,  2 Nov 2012 19:09:39 +0000 (UTC)
Received: by mail-pa0-f54.google.com with SMTP id bi1so2835457pad.13
 for <freebsd-current@freebsd.org>; Fri, 02 Nov 2012 12:09:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
 h=mime-version:sender:in-reply-to:references:date
 :x-google-sender-auth:message-id:subject:from:to:cc:content-type;
 bh=YPjOMSCAlm89FlWEUM+BhD6omI3vqwuQ9kyvz8KeG+0=;
 b=lnvWQfEWkI91Lcn757rVkKbl4cBZ2BR0iGJavWXdqbTCsJf8VgivSlobu1S/3ZQyjc
 ls9pjvhiZ2002KpMxZFhqHGu1zGp9QiFDEKihDUu9u9CF8M3cSahcQcC7LeRT5l3y7Jj
 AaQXNZK0zIsitSTbbcTfy9t/JmrT1v2aqKjIwtC3SW0Zw4dBl+c5TOB2yUfmhDwNeYTZ
 b5Pi1/4c7pzF42YWc1f/5XKorUMDRB1fWr78exQzpzic2gXhDj31C7fMhlSufIs52+k6
 JvZA0lecaqvA7yaGZ4pAXVNAVP/vz7CR0jcrNphI12Ex77y87KzigAu7YT0+V+OHHxvo
 jTkw==
MIME-Version: 1.0
Received: by 10.66.74.65 with SMTP id r1mr7716257pav.75.1351883378802; Fri, 02
 Nov 2012 12:09:38 -0700 (PDT)
Sender: mdf356@gmail.com
Received: by 10.68.223.105 with HTTP; Fri, 2 Nov 2012 12:09:38 -0700 (PDT)
In-Reply-To: <CAF6rxgkdsfDJ0m+MTZYn0dBSVGb9jCYCUo3Q9FhT3dEvYJZGJQ@mail.gmail.com>
References: <CAMBSHm_-5JUGX5nGyOLjMxpQjnh=7+5NkPnP1-i0OjSEKe7D6Q@mail.gmail.com>
 <1351780831.1120.137.camel@revolution.hippie.lan>
 <CAF6rxgkdsfDJ0m+MTZYn0dBSVGb9jCYCUo3Q9FhT3dEvYJZGJQ@mail.gmail.com>
Date: Fri, 2 Nov 2012 12:09:38 -0700
X-Google-Sender-Auth: -j3LYyx-bfmemg1wRoOMGotjTps
Message-ID: <CAMBSHm8Hf5mi36dsa+YJwgjkxHe-Pxs6K2OCa=VkbWdxSERbQA@mail.gmail.com>
Subject: Re: FILE's _file can only hold a short
From: mdf@FreeBSD.org
To: Eitan Adler <lists@eitanadler.com>
Content-Type: text/plain; charset=ISO-8859-1
Cc: Ian Lepore <freebsd@damnhippie.dyndns.org>, freebsd-current@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
 <freebsd-current.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/options/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current>
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-current>,
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Fri, 02 Nov 2012 19:09:40 -0000

On Thu, Nov 1, 2012 at 7:41 PM, Eitan Adler <lists@eitanadler.com> wrote:
> On 1 November 2012 10:40, Ian Lepore <freebsd@damnhippie.dyndns.org> wrote:
>> On Wed, 2012-10-31 at 11:12 -0700, 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.
>>
>> FWIW, I also remember some discussion recently (this year) on some
>> mailing list about this, but I can't find it now.  I thought it was
>> somehow related to in-lib versus external uses of the funopen()
>> function, but I may be conflating two unrelated discusssions in my head.
>
> Perhaps http://freebsd.1045724.n5.nabble.com/stdio-and-short-file-descriptors-revisited-td5747703.html
> ?

Yes, that was it exactly.  Thanks!  My (quick) search had not been fruitful.

Thanks,
matthew