220 33806 <CANh-dX=_vJGW1nxKEEjiSJ_=-+hkUab6i5KVSWJYe03ooBmnfA@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: Thu, 10 Aug 2017 14:28:18 -0700
Lines: 29
Approved: news@gmane.org
Message-ID: <CANh-dX=_vJGW1nxKEEjiSJ_=-+hkUab6i5KVSWJYe03ooBmnfA@mail.gmail.com>
References: <cb7b55ab-7113-4d99-949b-8568627d0b7f@isocpp.org>
 <1894906.unAOSKiKQz@tjmaciei-mobl1> <CANh-dXn0iLxgvBbUFH0UrBM7jdumO_aPX=Y1YxHAMdoBPrS7Cw@mail.gmail.com>
 <1712024.NjvlIh9J0q@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 1502400523 26594 195.159.176.226 (10 Aug 2017 21:28:43 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Thu, 10 Aug 2017 21:28:43 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBDDM34EO6QDRBCFAWPGAKGQELHYERGY@isocpp.org Thu Aug 10 23:28:35 2017
Return-path: <std-proposals+bncBDDM34EO6QDRBCFAWPGAKGQELHYERGY@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-wr0-f198.google.com ([209.85.128.198])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDDM34EO6QDRBCFAWPGAKGQELHYERGY@isocpp.org>)
	id 1dfv0N-0006RX-14
	for gclcip-std-proposals@m.gmane.org; Thu, 10 Aug 2017 23:28:35 +0200
Original-Received: by mail-wr0-f198.google.com with SMTP id 92sf2562662wra.11
        for <gclcip-std-proposals@m.gmane.org>; Thu, 10 Aug 2017 14:28:41 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1502400521; cv=pass;
        d=google.com; s=arc-20160816;
        b=A6KjXCbmKp7MphVEFr6ZlcSU8BDIq2/XaQaJcUJ08pIO6j65QzE929d2KAVmTOqjHS
         983Qvqt8yuqWOrju+arSwxNsbI6Q3Sm5qhLKyM4VAhnIUKDk7nKuTLjOHGmscrp+vJCT
         4wMwdPj7ecpMel6TC6WZELD5vORSJtnog2ekOp2kysem2sNhqOGtvsLwcBSrO11nNzM7
         aHGxJJ18/oatoeTzAw72gL9oCF9jFRYUyLsIMGSnTyUv8GcS2FtdTU/WMlEQM3n64fZV
         CtcTvMCTSOrE/CTlZGB+r4ZghoZ9LphKyNVolnC6cEn5NBvnMX5byTEc+Q0s7lLJY3tD
         cfMw==
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=gko19fPkZmY9YKgObLRr3CqaUa6j/Ykj1D56nHRHV9A=;
        b=IL6KX0EmtGRPp0uKqVOOpRpghxbhx9RX5Hv9Eq4kGoCnYwfeAEdL+I3XfYesr8nSAk
         C/JlfZlW4R4uRcgk30samTl2Sw4gWH6nIGPOTE9N6EdMj+ypl1yJXq23UFb86T9LJuE2
         W1Q1k4fQv1vKFQwgGABbUlmjenU0KCnhQqYHCAAkTqaDqIAFhrH4wnQfA6eJYQvrCFEM
         w0R0mv7fXWHdXRq50MuT/OfIZ6FNH7FY06MMtzZD04VajuCznxDX71dgUoqKVXiMy+0F
         Z0tx7AXmwlFEnWWKe1y19PqdfNum+RbA/o5MpA3P+cpk+ECbTZ4wiWXPwdRtMErjzq30
         RakQ==
ARC-Authentication-Results: i=2; mx.google.com;
       dkim=pass header.i=@google.com header.s=20161025 header.b=sRHU3AON;
       spf=pass (google.com: domain of jyasskin@google.com designates 2a00:1450:400c:c0c::229 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=gko19fPkZmY9YKgObLRr3CqaUa6j/Ykj1D56nHRHV9A=;
        b=wAzUYbDL0QQPHHgLDVmSeO0033o0Scwd28WQcaMEcgl1Qvjr4UQofoh/l6tAfPRvA5
         5OVDuaGM5q7MaD8D+39Mb+nZG4N+2hFRMOasRi9BE2xTGiDr9zVF2bfnGPLmqTLXPg99
         rypc5h2xTrrsZBr81sT7Qa5uiQRW+1/tlCn7iI657bUNQrQMyDS0gGSM5N6/4AqH1vZl
         2awSuYFjARvW4+ZK2CBFxjGcARvCfO14TCFBMUU0sIRuV0UEZFJf5HuXLSbQ6hBw5aKr
         GsdzPK0Nyu3UOzNYDKk02R4zght2t5tBrQctg0WROyP79coEz2wB4KpZ0izpsoZvwyNy
         C/6A==
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=gko19fPkZmY9YKgObLRr3CqaUa6j/Ykj1D56nHRHV9A=;
        b=cTIHd/9kon109yLH6eshZYWHAjwfja8tTDzmCzuvQ4QcYr/PiWKvC2yl7gedEAsniE
         4SZRQqYEbiXg4wrnH//SCK72GoaRClkoTq7tVPFqNnrSIh/2fioHd/NtMF0Kt50v9jKI
         /7GL+1lI8TzpLfAd2zH6zne5CzrYMtGo0PcMrZJLrScbzIJWtUl1m3coxdvCYQH8ujhH
         WnIpiKHWRQhnWofx6bZW39FeuhZKJSld0yw1TGye5QwhvGkMxBh4mxD+JdhEMd0efj6z
         YI9g3o/7Y1V9IM6pd1oWFo07k3pYJZKbm2ZiWuXt80F0zWNEdgF7gJIQssUSHu4+x6o0
         rePg==
X-Gm-Message-State: AHYfb5ioNJJz2NYmYaFcqFHjNIxMxA2A/txXSJsewn8+RiVhmHWO0PbF
	JaIh6PUrwXXd8w==
X-Received: by 10.28.140.204 with SMTP id o195mr1400721wmd.22.1502400521161;
        Thu, 10 Aug 2017 14:28:41 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.28.45.81 with SMTP id t78ls37399wmt.7.canary-gmail; Thu, 10
 Aug 2017 14:28:39 -0700 (PDT)
X-Received: by 10.80.215.215 with SMTP id m23mr13260911edj.69.1502400519932;
        Thu, 10 Aug 2017 14:28:39 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1502400519; cv=none;
        d=google.com; s=arc-20160816;
        b=zuIrqSmH96i4XxROvIjU72SmwCoqmtM82iB+6+6xnDVcUAXt5FNn2y/4KyedfMzwoy
         ySHXKALzZMkPftAw/PecYEZ0+pdWZgBhT3B3zlCWZngSTmJYT3wSuISGPEiZ4QSBYnbg
         unSWfTlqshBxDBXoWeN+voTms7u5pHkcScV+SZZtpmwV7NbI/wxLaJxMzqrSYXPM/itb
         5HJ0F3xWYVdDqsmEzLyxErWv1bpyidc9IvVT3KKFjGZLq194GK9VF61LZTdMt594LoL3
         I8lNjaUkp7hRxnux2rBzLlMNFfpP8GIa9iM4FnsySZa5eVe1E6i3EtUql9LKrPpba4Cx
         f7qA==
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=UgdjXT3dwNOTSaKaNpGaUE4Jye3xg2iPbusfahoJJIU=;
        b=oU8CHgAjJEk4plQLEvOzT/tx3Ry6pYk2P8Mmz6MDZNto4c4H3UG9LfKX8dkRDy6kRg
         Xah8vhsq1XW9u3RB0CiVN8PeZmRxruT86PPB31WdID7dAJP+G+623kYPLgJcEXHDCK5c
         hoxC/3DVuObeAfXp2r2uy8F+MyKe80MJJnW/uMbVY0JNfL4JIOm7xsznpKlpmB/Vk+te
         N0Dua/LzgyWe1tuz2WLRghe0d82IEdu6qrWGg6STBt8pNiynaFA+V3znwmPJw3GWFGhg
         kKztxJjjf/nPCNMz88gwa8GrIV+9Rg8+GJYqrUAKnwHYuL1fl/TshiPzXD7TRADK1FOy
         uGUA==
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=pass header.i=@google.com header.s=20161025 header.b=sRHU3AON;
       spf=pass (google.com: domain of jyasskin@google.com designates 2a00:1450:400c:c0c::229 as permitted sender) smtp.mailfrom=jyasskin@google.com;
       dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com
Original-Received: from mail-wr0-x229.google.com (mail-wr0-x229.google.com. [2a00:1450:400c:c0c::229])
        by mx.google.com with ESMTPS id 16si6926059edz.282.2017.08.10.14.28.39
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Thu, 10 Aug 2017 14:28:39 -0700 (PDT)
Received-SPF: pass (google.com: domain of jyasskin@google.com designates 2a00:1450:400c:c0c::229 as permitted sender) client-ip=2a00:1450:400c:c0c::229;
Original-Received: by mail-wr0-x229.google.com with SMTP id 33so7313108wrz.4
        for <std-proposals@isocpp.org>; Thu, 10 Aug 2017 14:28:39 -0700 (PDT)
X-Received: by 10.223.166.184 with SMTP id t53mr10961574wrc.265.1502400519104;
 Thu, 10 Aug 2017 14:28:39 -0700 (PDT)
Original-Received: by 10.28.146.84 with HTTP; Thu, 10 Aug 2017 14:28:18 -0700 (PDT)
In-Reply-To: <1712024.NjvlIh9J0q@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=sRHU3AON;       spf=pass
 (google.com: domain of jyasskin@google.com designates 2a00:1450:400c:c0c::229
 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:33806
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/33806>

On Thu, Aug 10, 2017 at 8:59 AM, Thiago Macieira <thiago@macieira.org> wrote:
> On quarta-feira, 9 de agosto de 2017 16:21:37 PDT 'Jeffrey Yasskin' via ISO C+
> + Standard - Future Proposals wrote:
>> > 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.)
>
> open(), readlink(), stat(), and their *at() versions, exec*, etc.
>
> See http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
> for the full list (http://man7.org/linux/man-pages/man7/signal-safety.7.html
> too).

All of those have long lists of failure conditions, often including
ENOMEM. Adding "couldn't allocate user-space memory" doesn't seem like
the end of the world.

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-dX%3D_vJGW1nxKEEjiSJ_%3D-%2BhkUab6i5KVSWJYe03ooBmnfA%40mail.gmail.com.

.
