add mkostemp

Eric Blake eblake@redhat.com
Mon Jul 19 16:27:00 GMT 2010


Sed wants to use the glibc invention of mkostemp as enhanced by gnulib, in
order to control the use of O_TEXT vs. O_BINARY vs. 0 (for native mount)
mode[1].  glibc added this interface for other reasons as well - it is
also useful to specify O_CLOEXEC, O_APPEND, and/or O_SYNC on some
temporary files.  In glibc, the flags argument explicitly excludes
O_ACCMODE bits, since temp files are already specified as O_RDWR, so I
copied that pattern.  (man-pages 3.23 documents mkostemp since glibc 2.7,
but fails to document mkostemps, even though it was added at the same time
as mkstemps in glibc 2.11).

[1] http://lists.gnu.org/archive/html/bug-coreutils/2010-07/msg00114.html

Okay to commit, along with a corresponding patch to doc/new-features.sgml
and a cygwin-specific patch to newlib's stdlib.h?

2010-07-19  Eric Blake  <eblake@redhat.com>

	* mktemp.cc (_gettemp): Add flags argument.  All callers updated.
	(mkostemp, mkostemps): New functions.
	* cygwin.din (mkostemp, mkostemps): Export.
	* posix.sgml: Document them.
	* include/cygwin/version.h: Bump version.

-- 
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwin.patch37
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20100719/f1790b19/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 616 bytes
Desc: OpenPGP digital signature
URL: <http://cygwin.com/pipermail/cygwin-patches/attachments/20100719/f1790b19/attachment.sig>


More information about the Cygwin-patches mailing list