From 755c41dc4bcde575ae654065921206ab4efec962 Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sat, 3 Mar 2012 10:24:44 -0800 Subject: Add "x" (O_EXCL) and "e" (O_CLOEXEC) modes support to gzopen(). --- zlib.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'zlib.h') diff --git a/zlib.h b/zlib.h index 2cbd981..ca6123c 100644 --- a/zlib.h +++ b/zlib.h @@ -1217,7 +1217,10 @@ ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); "a" can be used instead of "w" to request that the gzip stream that will be written be appended to the file. "+" will result in an error, since - reading and writing to the same gzip file is not supported. + reading and writing to the same gzip file is not supported. The addition of + "x" when writing will create the file exclusively, which fails if the file + already exists. On systems that support it, the addition of "e" when + reading or writing will set the flag to close the file on an execve() call. These functions, as well as gzip, will read and decode a sequence of gzip streams in a file. The append function of gzopen() can be used to create -- cgit v1.2.3-55-g6feb