aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-12 19:11:35 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2023-06-15 13:38:25 +0200
commit1f506a17903f5eeaded9065e42726c1a09dc6f89 (patch)
tree6f3cff994ca5794ef41777845ebc7ff6d41525cb /include
parenteb9a4b9034453ae3093d678a6f3898303dc5a5a0 (diff)
libio: flip the meaning of the ostream_t sparse flag
Instead of "open sparse", make that the default and turn it into a "no sparse" flag. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/io/file.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/include/io/file.h b/include/io/file.h
index 44fd224..297047f 100644
--- a/include/io/file.h
+++ b/include/io/file.h
@@ -20,7 +20,7 @@ typedef int os_file_t;
enum {
OSTREAM_OPEN_OVERWRITE = 0x01,
- OSTREAM_OPEN_SPARSE = 0x02,
+ OSTREAM_OPEN_NO_SPARSE = 0x02,
};
#ifdef __cplusplus
@@ -48,9 +48,10 @@ SQFS_INTERNAL istream_t *istream_open_handle(const char *path, os_file_t fd);
*
* @memberof ostream_t
*
- * If the flag OSTREAM_OPEN_SPARSE is set, the underlying implementation tries
- * to use seek/truncate style API to create sparse output files. If the flag
- * is not set, holes will always be filled with zero bytes.
+ * If the flag OSTREAM_OPEN_NO_SPARSE is set, the underlying implementation
+ * always writes chunks of zero bytes when passing a NULL pointer to append.
+ * Otherwise, it tries to use seek/truncate style APIs to create sparse output
+ * files.
*
* @param path The name to associate with the handle.
* @param fd A native file handle.
@@ -81,9 +82,10 @@ SQFS_INTERNAL istream_t *istream_open_file(const char *path);
* function fails, unless the flag OSTREAM_OPEN_OVERWRITE is set, in which
* case the file is opened and its contents are discarded.
*
- * If the flag OSTREAM_OPEN_SPARSE is set, the underlying implementation tries
- * to support sparse output files. If the flag is not set, holes will always
- * be filled with zero bytes.
+ * If the flag OSTREAM_OPEN_NO_SPARSE is set, the underlying implementation
+ * always writes chunks of zero bytes when passing a NULL pointer to append.
+ * Otherwise, it tries to use seek/truncate style APIs to create sparse output
+ * files.
*
* @param path A path to the file to open or create.
* @param flags A combination of flags controling how to open/create the file.