This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [RFA:] add _mkdir_r, fixing fallout from "add mkstemps, mkdtemp"
- From: Eric Blake <ebb9 at byu dot net>
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Cc: newlib at sources dot redhat dot com
- Date: Tue, 11 Aug 2009 20:54:31 -0600
- Subject: Re: [RFA:] add _mkdir_r, fixing fallout from "add mkstemps, mkdtemp"
- References: <200908112340.n7BNe4Lv016915@ignucius.se.axis.com>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Hans-Peter Nilsson on 8/11/2009 5:40 PM:
>> +#if !defined _ELIX_LEVEL || _ELIX_LEVEL >= 2
>> + if (domkdir)
>> + {
>> + if (_mkdir_r (ptr, path, 0700) == 0)
>> + return 1;
>> + if (ptr->_errno != EEXIST)
>> + return 0;
>> + }
>> + else
>> +#endif /* _ELIX_LEVEL */
>
> So, where did you find that _mkdir_r you're calling? Were there
> missing parts to the above patches? Would those parts look like
> the patches below, adding necessary framework and stub for the
> mkdir syscall?
I just assumed that it worked like any other syscall, but you are correct
that newlib has not yet wrapped mkdir. It worked for me on cygwin because
cygwin overrides mk*temp* in order to use a more secure random string
generation function, so this particular block wasn't getting compiled
under cygwin.
> With this patch, I can use today's newlib with test-suite
> results fixed (the same as before the above patch) for cris-elf.
> Nope, didn't test it anywhere else. Not trying to raise the bar.
>
> Ok to commit?
I can't approve it, but it looks obvious to me.
> (PS. can we start using ISO C89 non-K&R function headers soon?)
Not really - there are other benefits to using macro wrappers, such as
cygwin being able to add dllexport attributes to all exported functions by
merely changing a single #define, rather than rewriting every file.
>
> libgloss:
> 2009-08-11 Hans-Peter Nilsson <hp@axis.com>
>
> * libnosys/Makefile.in (OBJS): Add mkdir.
> * libnosys/mkdir.c: New file.
>
> newlib:
> 2009-08-11 Hans-Peter Nilsson <hp@axis.com>
>
> * libc/include/reent.h: Add prototype and definition of _mkdir_r.
> * libc/reent/Makefile.am (GENERAL_SOURCES): Add mkdirr.c.
> (CHEWOUT_FILES): Add mkdirr.def.
> * libc/reent/Makefile.in: Regenerate.
> * libc/reent/mkdirr.c: New file.
>
- --
Don't work too hard, make some time for fun as well!
Eric Blake ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkqCLucACgkQ84KuGfSFAYCA8gCglC6j2Ffp+7jdXD8M5vFtrS8k
AkIAn3xlONnkRpXwx+0D/HahQePomQxK
=pLHZ
-----END PGP SIGNATURE-----