From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 760613858413 for ; Tue, 31 Jan 2023 09:01:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 760613858413 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675155712; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=DRwjQVr12uPUjWJkZ+9RGO/TR5R3xTFz6zuMKhTvtSU=; b=MHMJ3ZM1RBYbMk1VuvMn1VY6Y4pCjAoUXlBE2tJklZenufhJUuzDPSSBo/oPj2ubLqvF4M zEmwhAXrnjKgzsi5R+zSt7sHoJ2iluy+f8qP36UWzZG5qfXOU4eJ7kD7Dv6Ogs7lzSY5Br 4e5R2rjA3iAl8KnFqJNM5TmN4Mtql/A= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-A11b02cyNoO5DUg1SKGA8g-1; Tue, 31 Jan 2023 04:01:51 -0500 X-MC-Unique: A11b02cyNoO5DUg1SKGA8g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 486B229AA2CC for ; Tue, 31 Jan 2023 09:01:51 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.39.192.5]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 253A640C2064 for ; Tue, 31 Jan 2023 09:01:51 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id E29E4A81B7B; Tue, 31 Jan 2023 10:01:49 +0100 (CET) Date: Tue, 31 Jan 2023 10:01:49 +0100 From: Corinna Vinschen To: newlib@sourceware.org Subject: Re: mkdtemp() and HAVE_MKDIR Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: newlib@sourceware.org References: <5be15e6f-66a7-4b49-41c7-c074a4994d08@embedded-brains.de> MIME-Version: 1.0 In-Reply-To: <5be15e6f-66a7-4b49-41c7-c074a4994d08@embedded-brains.de> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Jan 30 10:11, Sebastian Huber wrote: > Hello, > > in the mkdtemp() implementation we have: > > for (;;) > { > #if !defined _ELIX_LEVEL || _ELIX_LEVEL >= 4 > if (domkdir) > { > #ifdef HAVE_MKDIR > if (_mkdir_r (ptr, path, 0700) == 0) > return 1; > if (_REENT_ERRNO(ptr) != EEXIST) > return 0; > #else /* !HAVE_MKDIR */ > _REENT_ERRNO(ptr) = ENOSYS; > return 0; > #endif /* !HAVE_MKDIR */ > } > else > #endif /* _ELIX_LEVEL */ > > The HAVE_MKDIR was added by: > > commit 12387ab6f77d6ae4fa3d8fdc1756d416a27197dd > Author: Jeff Johnston > Date: Wed Aug 12 18:22:38 2009 +0000 > > 2009=08-12 Jeff Johnston > > * libc/stdio/mktemp.c (_gettemp): Do not call _mkdir_r unless > HAVE_MKDIR is defined. > > Do we really need this check since Newlib provides an mkdir() > implementation? How should a system set the HAVE_MKDIR define? I asked the same question back in 2009: https://sourceware.org/pipermail/newlib/2009/007905.html and got this reply from Jeff: https://sourceware.org/pipermail/newlib/2009/007906.html Corinna