From patchwork Thu Dec 10 02:46:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Keith Packard X-Patchwork-Id: 1413784 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=bOIU1zSu; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CryxV514dz9sW8 for ; Thu, 10 Dec 2020 13:47:09 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 556D9384BC17; Thu, 10 Dec 2020 02:47:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 556D9384BC17 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1607568426; bh=ehR8KHFW/FA4s2Et1IfBeYkGhLLJGPpCjtNqmP4VbNs=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=bOIU1zSuq7/7kaArDWibho/hyJBVFwKOQFOBk9sn0zwmeuXmmKcjtajDFYOXDa0mD ESj8B8LHO2x7dV0MERODI4ZBEhPQcn8LKfm7O+4GzD4SsMwhKOykZQBYTC/Ck2VpMR GJ6RmkIK/d3H2buIcR2Nogg3RMh8Fqr+Lshsdol8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by sourceware.org (Postfix) with ESMTPS id B25DE3861012; Thu, 10 Dec 2020 02:47:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org B25DE3861012 Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 054DD3F2E355; Wed, 9 Dec 2020 18:47:02 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vRQrptwrX2X4; Wed, 9 Dec 2020 18:47:01 -0800 (PST) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 94A713F2D58D; Wed, 9 Dec 2020 18:47:01 -0800 (PST) Received: by keithp.com (Postfix, from userid 1000) id 4E27315820DB; Wed, 9 Dec 2020 18:47:01 -0800 (PST) To: libstdc++@gcc.gnu.org Subject: [PATCH 0/2] Support libc with stdio-only I/O in libstdc++ Date: Wed, 9 Dec 2020 18:46:55 -0800 Message-Id: <20201210024657.3395687-1-keithp@keithp.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201209101700.GS2309743@redhat.com> References: <20201209101700.GS2309743@redhat.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Keith Packard via Gcc-patches From: Keith Packard Reply-To: Keith Packard Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" The current libstdc++ basic_file_stdio.cc code assumes a POSIX API underneath the stdio implementation provided by the host libc. This means that the host must provide a fairly broad POSIX file API, including read, write, open, close, lseek and ioctl. This patch changes basic_file_stdio.cc to only use basic ANSI-C stdio functions, allowing it to be used with libc implementations like picolibc which may not have a POSIX operating system underneath. This is version 2 of the patch. This version uses the existing --enable-stdio option, extending that to add 'stdio_pure' for this mode using a patch created by Jonathan Wakely