mkdtemp() and HAVE_MKDIR

Sebastian Huber <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
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 <[email protected]>
Date:   Wed Aug 12 18:22:38 2009 +0000

     2009=08-12  Jeff Johnston  <[email protected]>

             * 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: [email protected]
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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.