220 33753 <CANh-dXn0iLxgvBbUFH0UrBM7jdumO_aPX=Y1YxHAMdoBPrS7Cw@mail.gmail.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: "'Jeffrey Yasskin' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Re: string_view for fstream::open()
Date: Wed, 9 Aug 2017 16:21:37 -0700
Lines: 27
Approved: news@gmane.org
Message-ID: <CANh-dXn0iLxgvBbUFH0UrBM7jdumO_aPX=Y1YxHAMdoBPrS7Cw@mail.gmail.com>
References: <cb7b55ab-7113-4d99-949b-8568627d0b7f@isocpp.org>
 <9fedbad3-c6f6-4dbe-a215-814666c52c6b@isocpp.org> <CANh-dXmwXG=ENS9UhjE25fGq6Kg1quaGNm2OW_Rh_oJLYKtw=g@mail.gmail.com>
 <1894906.unAOSKiKQz@tjmaciei-mobl1>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1502320929 6315 195.159.176.226 (9 Aug 2017 23:22:09 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Wed, 9 Aug 2017 23:22:09 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDDM34EO6QDRBF5SV3GAKGQER4BRUMA@isocpp.org Thu Aug 10 01:21:56 2017
Return-path: <std-proposals+bncBDDM34EO6QDRBF5SV3GAKGQER4BRUMA@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wm0-f69.google.com ([74.125.82.69])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDDM34EO6QDRBF5SV3GAKGQER4BRUMA@isocpp.org>)
	id 1dfaIU-0000x5-RK
	for gclcip-std-proposals@m.gmane.org; Thu, 10 Aug 2017 01:21:54 +0200
Original-Received: by mail-wm0-f69.google.com with SMTP id 185sf987014wmk.12
        for <gclcip-std-proposals@m.gmane.org>; Wed, 09 Aug 2017 16:22:01 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1502320921; cv=pass;
        d=google.com; s=arc-20160816;
        b=k/QPSmAwpl39CMCzr29BrwPf7ZQhT2mG++0D0/cmtCZi5uNy9vKjrf/a4luroFBgjG
         N/8bofAIZgWZkf0uAa1oAZ5qV0TD1WVe029sZM6/k1ouDOaGgiXTrvzC9vbrERhFMoQw
         VbGVcH6Q0adK0CCQGRQgCb6WqZV2dx/7hn4tuM2aa3fzn/13xRncWdRvqhmfRMqYNBao
         muamezBfiYQtBcVYkCpNGRUHO4jli48O8LoDpi83Lo8Pa74H32iAGSvMOcwiwO+ADpA3
         J15j64xc/3vPQyNlBKpEmoMq3iR7lzXpNePS67gHfy0Dme+vdfGXbaTocA79+Cst0kNo
         lsvw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:to:subject:message-id:date
         :from:references:in-reply-to:mime-version:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=vAJBCQGhnd8L8zLAVWQCvwGGtnwLz2v4vEgZAXGTaMM=;
        b=CTepJDbfGFjkxmxZSOqHpkolUY2vtROGtx5T5vI93zbNnYOo07VoKOcfKzERUCvaIZ
         oG3TctWPVkEVW5r4OB0W4DWPvQgEZSKGD5/yBX86puYHTEawOqEuWIV5XvQJ72MDbrjk
         Qk64sW3Sbv5b3Sl8/7z23EfKUqakzt/BnxEVDP1Y1AQK1xfInloxnOpUDk2NRVme8UD/
         EjLz2mXDfSCKDtrzPfH37lWN49QJ1PQ65usR+vg4Gjo8g06Tc1ppjCNR2MuUdZvVpBXk
         ZBXDnq8kVe9Kk8ljpyQPX9/z29MJs9L+k/0BxpliFybsPRHz60WrK7I+GQhrXFR68YTc
         cP1g==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@google.com header.s=20161025 header.b=RncPVkOJ;
       spf=pass (google.com: domain of jyasskin@google.com designates 2a00:1450:400c:c09::22f as permitted sender) smtp.mailfrom=jyasskin@google.com;
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=mime-version:in-reply-to:references:from:date:message-id:subject: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=vAJBCQGhnd8L8zLAVWQCvwGGtnwLz2v4vEgZAXGTaMM=;
        b=JHhpU+iEe6p49Itn8kYfgoWVyMw6PQNKeft2ryEoOlcN+i444s7j0ssZbPlYWjw2KY
         UiaVtzzbYBvwsf8H/tpvc5Ge+kronFCbWvie5Ib6QyAkHrFjycKno2AoVPR2fw1nRvKP
         Ja++VIq9dDobIAvQ8ZocRXzHt1Me8HyuLp292DG+5/GlYJlnoGhmqSaQD+Q9/HaEeq1G
         a1dL4WU6Rld+dFQ+BVX0KOv1Z8zgTWASF4FmUdK1FznJyI5AaNtQXvQ++UVcBozNsGPy
         t5YTfuLv+7rnQJP55hNuoUlyUZP1ktlyswpbkV12kKGsVMtBZmzYdf/z5RwjBGlfYOaR
         IvyQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:in-reply-to:references:from:date
         :message-id:subject:to:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=vAJBCQGhnd8L8zLAVWQCvwGGtnwLz2v4vEgZAXGTaMM=;
        b=PamukooNqXIp2jTVLSaFy1BopzqhWiPlJT6iukNMTcbQVSOBOfN6PUBUxHqH/ZiRBN
         dHVsFOq7QeYVIuYyEpiT8IG0G8N6OGOVMU9JFcsjChS1pxh4qwMSZfud/pp2KCR4A+Bq
         vf6qicdgY0J2owyEmb3GjuVKSzav7+P72XplmxInEns3pqh578qo0YAnHzGw+vNnwvYC
         iJQesMBnoKA4pNohbuKPlsXgmgx5M0O/+HqbakEruqB8CA8cYijBu8ZnOseXGqSKI323
         HGigHz6J1i0GBdyBZ34LIQ+ZKaexF1DKNu8E9HsF2hEgV2EgCDDvBYrJvwZqBLllFEOa
         aICw==
X-Gm-Message-State: AHYfb5javxr7nK3lrl9TQW5mJNIqsTQElHdIHRiziHaE+9Gin9BerjCs
	aHMPg8Rjbj7QKQ==
X-Received: by 10.28.12.134 with SMTP id 128mr1159712wmm.29.1502320920969;
        Wed, 09 Aug 2017 16:22:00 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.55.130 with SMTP id e124ls2527002wma.24.gmail; Wed, 09 Aug
 2017 16:21:59 -0700 (PDT)
X-Received: by 10.80.169.165 with SMTP id n34mr9837774edc.232.1502320919687;
        Wed, 09 Aug 2017 16:21:59 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1502320919; cv=none;
        d=google.com; s=arc-20160816;
        b=i0cKE9ENxG1tfjzfBfiTlgQamhYeBvGHt0pZh/9vsImzLfIETyY7mJUt3YjxVJ8ZUp
         sAxJrDl3evtYC5LX+f7oGvP0j6/hhtHrunkUNdSozSQBqahzaDn5edOM2k7UkmDE8tok
         KeblvKgKCUpg9Hk8NmFMiRj4ULKxfr5KnOZpQ+/Pf2tnXqm58T6l4sV3bUZiAhOsmbpH
         SQVSuvU62jF2ImvofIYd/zUQ13MRqXJCdIIqZ1N4gPz2NIs+8EPipI27BpBab/hVD4ZD
         nc/stsa5ZCxhI6OrFol3eTNB8sKAWSxWJO5QvO8Z/BQxtkkS6gqrtcvGxDR6UCW/+tnd
         wZbA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=to:subject:message-id:date:from:references:in-reply-to:mime-version
         :dkim-signature:arc-authentication-results;
        bh=HmitUhxh1tY44FfBfcS2zkrhiTHpv6zJJv1/DkzVeXs=;
        b=yHp5KHzVSN2HXgp9+plZeot/M0mgt/5aJxkUKM35ZwWfIJX7lAU2bR4tVhDIH4AbLm
         UrPwCtexHTTxTTrYjnBk5lKndou8AHkUzhKM57uD27IgBuhAR+FKUJulPkGAHQ61I0bZ
         RNrRTafKg5EC5dF6AAcQv3cCRoQAPobiXBJPUTPC4iO5B6ltwm4AXbA4bAq+bJ0c+Qqc
         U/UMdPRtPuYF/3EYGitwFTtlgCpRIgZZZCh7+DKRdHBnjic2h2nbFYVEG3CeKiNeRAqP
         3kBO862doHij/syZv7cyMaRwrxlnnhdKypfQwdkpZBbzILHfVwk9PRMGV84vrddBSms+
         jiHw==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@google.com header.s=20161025 header.b=RncPVkOJ;
       spf=pass (google.com: domain of jyasskin@google.com designates 2a00:1450:400c:c09::22f as permitted sender) smtp.mailfrom=jyasskin@google.com;
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com
Original-Received: from mail-wm0-x22f.google.com (mail-wm0-x22f.google.com. [2a00:1450:400c:c09::22f])
        by mx.google.com with ESMTPS id r37si5197468edd.185.2017.08.09.16.21.59
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 09 Aug 2017 16:21:59 -0700 (PDT)
Received-SPF: pass (google.com: domain of jyasskin@google.com designates 2a00:1450:400c:c09::22f as permitted sender) client-ip=2a00:1450:400c:c09::22f;
Original-Received: by mail-wm0-x22f.google.com with SMTP id f15so8489113wmg.1
        for <std-proposals@isocpp.org>; Wed, 09 Aug 2017 16:21:59 -0700 (PDT)
X-Received: by 10.28.221.137 with SMTP id u131mr6251435wmg.19.1502320918706;
 Wed, 09 Aug 2017 16:21:58 -0700 (PDT)
Original-Received: by 10.28.216.144 with HTTP; Wed, 9 Aug 2017 16:21:37 -0700 (PDT)
In-Reply-To: <1894906.unAOSKiKQz@tjmaciei-mobl1>
X-Original-Sender: jyasskin@google.com
X-Original-Authentication-Results: mx.google.com;       dkim=pass
 header.i=@google.com header.s=20161025 header.b=RncPVkOJ;       spf=pass
 (google.com: domain of jyasskin@google.com designates 2a00:1450:400c:c09::22f
 as permitted sender) smtp.mailfrom=jyasskin@google.com;       dmarc=pass
 (p=REJECT sp=REJECT dis=NONE) header.from=google.com
X-Original-From: Jeffrey Yasskin <jyasskin@google.com>
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: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://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>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:33753
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33753>

On Wed, Aug 9, 2017 at 12:49 PM, Thiago Macieira <thiago@macieira.org> wrote:
> On quarta-feira, 9 de agosto de 2017 09:15:59 PDT 'Jeffrey Yasskin' via ISO C+
> + Standard - Future Proposals wrote:
>> However, being system calls, they also cost significantly more than
>> the cost of copying a path-length string, so don't be too afraid of
>> just doing that.
>
> The problem is the copying an input of arbitrary length in an exception-free
> and thread-safe manner.
>
> You can't do malloc(), since that might fail. You can't use new[] because it
> might throw. You can't lock a mutex because that is not async signal safe.

Which are the low-level APIs that take null-terminated strings and are
also async-signal-safe and failure-free? (If I needed
exception-freedom I'd use new(nothrow) or catch the exception and turn
it into a failure.)

Thanks,
Jeffrey

-- 
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 email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CANh-dXn0iLxgvBbUFH0UrBM7jdumO_aPX%3DY1YxHAMdoBPrS7Cw%40mail.gmail.com.

.
