public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: newlib <newlib@sourceware.org>
Subject: mkdtemp() and HAVE_MKDIR
Date: Mon, 30 Jan 2023 10:11:51 +0100	[thread overview]
Message-ID: <5be15e6f-66a7-4b49-41c7-c074a4994d08@embedded-brains.de> (raw)

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 <jjohnstn@redhat.com>
Date:   Wed Aug 12 18:22:38 2009 +0000

     2009=08-12  Jeff Johnston  <jjohnstn@redhat.com>

             * 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?

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/

             reply	other threads:[~2023-01-30  9:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30  9:11 Sebastian Huber [this message]
2023-01-31  9:01 ` Corinna Vinschen
2023-02-01  6:58   ` Sebastian Huber

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5be15e6f-66a7-4b49-41c7-c074a4994d08@embedded-brains.de \
    --to=sebastian.huber@embedded-brains.de \
    --cc=newlib@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).