summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2017-04-28 15:11:29 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2017-04-28 15:11:29 (GMT)
commitd3b664b6a79508d78974a347a9d450e72defb76b (patch)
treec1d66801ef73f7b1cefbfccbbbe155e9de1b6914 /src/H5private.h
parentc2729b6ad13170d7311848ecba2483515e113825 (diff)
downloadhdf5-d3b664b6a79508d78974a347a9d450e72defb76b.zip
hdf5-d3b664b6a79508d78974a347a9d450e72defb76b.tar.gz
hdf5-d3b664b6a79508d78974a347a9d450e72defb76b.tar.bz2
Changed the Windows POSIX open() file permissions to be correct
according to MSDN. Partial fix for HDFFV-9630.
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/H5private.h b/src/H5private.h
index c588154..fc15e99 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -495,6 +495,24 @@
# define H5_POSIX_MAX_IO_BYTES SSIZET_MAX
#endif
+/* POSIX I/O mode used as the fourth parameter to open/_open
+ * when creating a new file (O_CREAT is set).
+ *
+ * It's a little awkward to put the Unix file permissions
+ * in the symbol name, but that is what is most important
+ * and we only need the symbol to handle Windows' less-capable
+ * system.
+ */
+#if defined(H5_HAVE_WIN32_API)
+# define H5_POSIX_OPEN_MODE_0666 (_S_IREAD | _S_IWRITE)
+# define H5_POSIX_OPEN_MODE_0644 _S_IREAD
+# define H5_POSIX_OPEN_MODE_0000 0
+#else
+# define H5_POSIX_OPEN_MODE_0666 0666
+# define H5_POSIX_OPEN_MODE_0644 0644
+# define H5_POSIX_OPEN_MODE_0000 0000
+#endif
+
/*
* A macro to portably increment enumerated types.
*/