add mkstemps

Eric Blake ebb9@byu.net
Mon Jun 29 12:43:00 GMT 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The ability to have an arbitrary file suffix on a temporary file is quite
useful for programs that react to a file's extension; in fact, git wants
to use mk[s]temps when available, even though no standards bodies have
adopted it yet.  According to google, mkstemps is available on several
systems (sometimes by the more confusing name mktemps), but there is no
consistency on whether it should be in <stdlib.h> or <unistd.h>.  I went
with <stdlib.h>, since that is where POSIX puts mkstemp.  This also fixes
the documentation (mktemp is NOT in <stdio.h>), but does not move the
files to a more appropriate subdirectory.

OK to apply?

2009-06-27  Eric Blake  <ebb9@byu.net>

	Add mkstemps.
	* libc/stdio/mktemp.c: Fix documentation.
	(_gettemp): Add length parameter.
	(_mkstemp_r, _mktemp_r, mkstemp, mktemp): Adjust clients.
	(_mkstemps_r, mkstemps): New functions.
	* libc/include/stdlib.h (_mkstemps_r, mkstemps): Declare them.

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

iEYEARECAAYFAkpGoAUACgkQ84KuGfSFAYB43QCfdlbQ8d34x2u+D3y29jfRAG0u
dPMAoImTaRB0t/0FHcrS3jB0zJ62P9n8
=PJPD
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: newlib.patch36
URL: <http://sourceware.org/pipermail/newlib/attachments/20090629/d4c0e442/attachment.ksh>


More information about the Newlib mailing list