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=-3.1 required=5.0 tests=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 C0E5D29D4E for ; Mon, 11 Mar 2024 20:44:31 +0100 (CET) Received: (qmail 28463 invoked by uid 550); 11 Mar 2024 19:40:20 -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 28437 invoked from network); 11 Mar 2024 19:40:19 -0000 Date: Mon, 11 Mar 2024 15:44:35 -0400 From: Rich Felker To: enh Cc: sjf5462@rit.edu, Florian Weimer , Andreas Schwab , Alejandro Colomar , Thorsten Glaser , musl@lists.openwall.com, NRK , Guillem Jover , libc-alpha@sourceware.org, libbsd@lists.freedesktop.org, "Serge E. Hallyn" , Iker Pedrosa , Christian Brauner Message-ID: <20240311194435.GX4163@brightrain.aerifal.cx> References: <20240310234410.GW4163@brightrain.aerifal.cx> <875xxsljax.fsf@oldenburg.str.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Re: Tweaking the program name for functions On Mon, Mar 11, 2024 at 12:05:11PM -0700, enh wrote: > Android's libc actually does do this for everything except for > first-stage `init`, the one process that doesn't have a /dev/null > equivalent available yet: > https://android.googlesource.com/platform/bionic/+/master/libc/bionic/libc_init_common.cpp#358 In the absence of /dev/null, you could probably call pipe() and close the unwanted end. This works with no fs available, and has the "bonus" that you'll get a nice SIGPIPE crash if you accidentally try to write anything to it. Rich