public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
From: Corinna Vinschen <vinschen@redhat.com>
To: newlib@sourceware.org
Subject: Re: mkdtemp() and HAVE_MKDIR
Date: Tue, 31 Jan 2023 10:01:49 +0100	[thread overview]
Message-ID: <Y9jY/bjiYV5q3Bmb@calimero.vinschen.de> (raw)
In-Reply-To: <5be15e6f-66a7-4b49-41c7-c074a4994d08@embedded-brains.de>

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

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


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30  9:11 Sebastian Huber
2023-01-31  9:01 ` Corinna Vinschen [this message]
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=Y9jY/bjiYV5q3Bmb@calimero.vinschen.de \
    --to=vinschen@redhat.com \
    --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).