add mkostemp

Eric Blake
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).


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

	* (_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    +1-801-349-2682
Libvirt virtualization library
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygwin.patch37
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 616 bytes
Desc: OpenPGP digital signature
URL: <>

More information about the Cygwin-patches mailing list