From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: from second.openwall.net (second.openwall.net [193.110.157.125]) by inbox.vuxu.org (Postfix) with SMTP id 1EB1025872 for ; Tue, 12 Mar 2024 14:54:33 +0100 (CET) Received: (qmail 16265 invoked by uid 550); 12 Mar 2024 13:50:21 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 16239 invoked from network); 12 Mar 2024 13:50:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710251660; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nzwoCPq/B8iylb0W5YixXm2LVPlTaZSWJEKhUHUzIrI=; b=EW89zH8kl0tCOsaeCXwiMzd6ZRO7t6LYXdXcg6pdArN4+2Yfml4eGiKd51fGeGDY7FW7IL kxyUlcWCB+e7uipSlWtm4L3TIwNS7Gh0NWcgEAdJkAIbL5YtHuxHu8pkpLNoX9JKgkRWQg I7CfSowQ8OxmeIix8MPf0o2rAGtPz2I= X-MC-Unique: zCanzcgyOHSmadqoq6ZjFQ-1 From: Florian Weimer To: Gabriel Ravier Cc: Rich Felker , "Skyler Ferrante (RIT Student)" , musl@lists.openwall.com, Andreas Schwab , Alejandro Colomar , Thorsten Glaser , NRK , Guillem Jover , libc-alpha@sourceware.org, libbsd@lists.freedesktop.org, "Serge E. Hallyn" , Iker Pedrosa , Christian Brauner References: <20240310193956.GU4163@brightrain.aerifal.cx> <20240310234410.GW4163@brightrain.aerifal.cx> <20240311194756.GY4163@brightrain.aerifal.cx> <40962405-c5b4-4925-9ca5-7a1c723ebbfd@gmail.com> Date: Tue, 12 Mar 2024 14:54:09 +0100 In-Reply-To: <40962405-c5b4-4925-9ca5-7a1c723ebbfd@gmail.com> (Gabriel Ravier's message of "Tue, 12 Mar 2024 00:18:24 +0000") Message-ID: <875xxrv9mm.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Subject: Re: [musl] Re: Tweaking the program name for functions * Gabriel Ravier: > Doing this would break many programs, such as: > - most of coreutils, e.g. programs like ls, cat or head, since they > always `close` their input and output descriptors (when they've > written or read something) to make sure to diagnose all errors A slightly better way to do this is to do fflush (stdout) followed by error checking on close (dup (fileno (stdout))). We can't do this implicitly as part of fflush because it potentially breaks legacy (non-OFD) POSIX file locking, at least not without parsing /proc and whatnot. The close system call is how the Linux NFS client reports ENOSPC errors without performing a costly fsync on the server. We don't have a better interface for this. Thanks, Florian