220 14682 <m4nnnl$ejl$1@ger.gmane.org> article
Path: news.gmane.org!not-for-mail
From: Matthew Woehlke <mw_triad@users.sourceforge.net>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Native raw IO and FILE* wrappers?
Date: Fri, 21 Nov 2014 11:03:00 -0500
Lines: 41
Approved: news@gmane.org
Message-ID: <m4nnnl$ejl$1@ger.gmane.org>
References: <525a4bcf-c4c5-40f4-a89c-620dd543548e@isocpp.org>	<5468B075.8030503@wanadoo.fr>	<d01eaf9f-7645-44fd-a381-43aae0a6f638@isocpp.org>	<FB8F296D-4A60-469F-A19B-09246507380A@gmail.com>	<CAA7U3HNVfsnmOg+i5bQg1iff7TYp27Xfq0ZrOXf167=R0WKrfQ@mail.gmail.com>	<90B6B49B-0202-40CD-B5E2-A7A37CF95470@gmail.com>	<CAA7U3HMN-yCPYfp=WQWUE9aV1wUTRqYP-ov-p=-c0KsWoQsi_g@mail.gmail.com>	<2F8BE7E9-1475-4963-B62A-5118783B6E20@gmail.com>	<CAFk2RUZ=3Up_JATckAakTXFYpeT9rdf2yH_jkoK3u1KMoP5xwQ@mail.gmail.com>	<8C961CA3-1FB2-412C-A712-B737AD46FFE6@gmail.com>	<CAFk2RUaRPRpT7h81eWwa4Pe_zJoY=f9jStVuWRW_C-acCT91zg@mail.gmail.com>	<D65F9FD6-7071-4168-A7C3-A2600FD8CEB7@gmail.com>	<CAFk2RUZTCyxczf3MF3DVgkzNSnougSsScgd1x7CVP0H5SBYSoQ@mail.gmail.com>	<E0A1613B-83AD-4370-89E8-9B55DAD0EF6A@gmail.com> <CAFk2RUZQ62abB3ObU
 ummw-A=iXPvHdLtBn4AH+KqkQKv07aaWQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: plane.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: ger.gmane.org 1416585810 15279 80.91.229.3 (21 Nov 2014 16:03:30 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Fri, 21 Nov 2014 16:03:30 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCO5FYHBU4ERBSGEXWRQKGQEBGQICSY@isocpp.org Fri Nov 21 17:03:24 2014
Return-path: <std-proposals+bncBCO5FYHBU4ERBSGEXWRQKGQEBGQICSY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-ee0-f72.google.com ([74.125.83.72])
	by plane.gmane.org with esmtp (Exim 4.69)
	(envelope-from <std-proposals+bncBCO5FYHBU4ERBSGEXWRQKGQEBGQICSY@isocpp.org>)
	id 1Xrqg7-0000TJ-GV
	for gclcip-std-proposals@m.gmane.org; Fri, 21 Nov 2014 17:03:23 +0100
Original-Received: by mail-ee0-f72.google.com with SMTP id e53sf3537900eek.3
        for <gclcip-std-proposals@m.gmane.org>; Fri, 21 Nov 2014 08:03:23 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:to:from:subject:date:lines:message-id:references
         :mime-version:content-type:content-transfer-encoding:user-agent
         :in-reply-to:x-original-sender:x-original-authentication-results
         :reply-to:precedence:mailing-list:list-id:list-post:list-help
         :list-archive:list-subscribe:list-unsubscribe;
        bh=2esPgnIfZrP+jGU9oFWUzwrX/3yKCDPDh78WcEieXaE=;
        b=bGYle6fVJBqxt4ynYNppRG/luGwUc72XPIzuF+ZcudyXLgLfGE2Y6BZoqDl/PCCl+8
         fjFW1qbqFMKFplTccFldZfkfcdpO4AyqivsdxbGnwBelBPjvXM0iYhFAJrkzm1EELFt9
         loSVmggmus1MrL9CDcZPUdGw7ZOhGkt9eNM14utD7k+lOzSh7qTegCdkGwNxnpdaQVXe
         ahYbFPVu8+bpCuPEMl3wJD6LP0S5aEnczaoPN3TKeNr8AyPIcnnWJqEdSAwrWQmHTLgw
         2ltXG1zJdFjHLflX9v6fa0HrHNnpn1/H3nmEl8RplTQ3uWaW/642if3YsUBHC8ldNMH3
       
X-Gm-Message-State: ALoCoQk8pQX5ruPDl/5jTZ8bWjPejDSk3A7ScBpRcw+B/FlSAXyuP4glxOshWbTc7T+7qtqeTCua
X-Received: by 10.112.72.106 with SMTP id c10mr1127703lbv.15.1416585803203;
        Fri, 21 Nov 2014 08:03:23 -0800 (PST)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.152.197.100 with SMTP id it4ls226048lac.7.gmail; Fri, 21 Nov
 2014 08:03:19 -0800 (PST)
X-Received: by 10.153.6.9 with SMTP id cq9mr5699947lad.79.1416585799878;
        Fri, 21 Nov 2014 08:03:19 -0800 (PST)
Original-Received: from plane.gmane.org (plane.gmane.org. [80.91.229.3])
        by mx.google.com with ESMTPS id qc5si6111839lbb.67.2014.11.21.08.03.18
        for <std-proposals@isocpp.org>
        (version=TLSv1 cipher=RC4-SHA bits=128/128);
        Fri, 21 Nov 2014 08:03:18 -0800 (PST)
Received-SPF: pass (google.com: domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as permitted sender) client-ip=80.91.229.3;
Original-Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gclcip-std-proposals@m.gmane.org>)
	id 1Xrqfy-0000O8-6D
	for std-proposals@isocpp.org; Fri, 21 Nov 2014 17:03:14 +0100
Original-Received: from cpe-67-240-43-113.nycap.res.rr.com ([67.240.43.113])
        by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Fri, 21 Nov 2014 17:03:14 +0100
Original-Received: from mw_triad by cpe-67-240-43-113.nycap.res.rr.com with local (Gmexim 0.1 (Debian))
        id 1AlnuQ-0007hv-00
        for <std-proposals@isocpp.org>; Fri, 21 Nov 2014 17:03:14 +0100
X-Injected-Via-Gmane: http://gmane.org/
Original-Lines: 29
Original-X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: cpe-67-240-43-113.nycap.res.rr.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0
In-Reply-To: <CAFk2RUZQ62abB3ObUummw-A=iXPvHdLtBn4AH+KqkQKv07aaWQ@mail.gmail.com>
X-Original-Sender: mw_triad@users.sourceforge.net
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of gclcip-std-proposals@m.gmane.org designates 80.91.229.3 as
 permitted sender) smtp.mail=gclcip-std-proposals@m.gmane.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <http://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <http://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <http://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <http://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:14682
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/14682>

On 2014-11-21 01:14, Ville Voutilainen wrote:
> On 21 November 2014 08:01, David Krauss <potswa@gmail.com> wrote:
>> Do you know how pipes and BSD sockets get buffered?
>=20
> I think I do. And I still don't see why there's "no way" to buffer
> them in userspace on top of the system buffering.

I think the point here is that the userland buffer had better not block
trying to read more bytes than the user has explicitly requested, since
that is clearly undesired behavior. (It can even lead to deadlocks in
the case of a pipe that is waiting for some response before sending more
data.)

Lets say you have processes A and B connected by a pipe. A sends 52
bytes. B tries to read 48, then sends a reply to A that causes A to send
a bunch more. If B is buffering the pipe, that buffer had better not
decide that it reads 4096 byte chunks from the FD at a time and will not
return from any read request until either that 4096 byte buffer is full
or an EOF occurs. That may be okay for files on disk, but for pipes /
sockets, you just caused B to deadlock.

In other words, the buffer must both accept (without blocking) that it
may not be able to read as many bytes as it would like, AND must not
treat that condition as EOF (because it isn't). It's entirely plausible
that a na=C3=AFve implementation that was designed for handling local files
fails at one or both of those points.

--=20
Matthew

--=20

---=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
Visit this group at http://groups.google.com/a/isocpp.org/group/std-proposa=
ls/.

.
