summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-03-30 11:53:35 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-03-30 11:53:35 +0000
commit3e2bb2cf4aca95de907a506a7380bdf05011cf9d (patch)
treee27e066f10e55888f302d7005437b72c16efb252
parent344bb17018198050c2d3c674751c41003add14c2 (diff)
downloadlibapr-3e2bb2cf4aca95de907a506a7380bdf05011cf9d.tar.gz
* include/apr_file_io.h: Add APR_LARGEFILE flag, with warning.
* file_io/unix/open.c (apr_file_open): Map APR_LARGEFILE onto O_LARGEFILE for non-LFS builds. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65032 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--file_io/unix/open.c4
-rw-r--r--include/apr_file_io.h14
2 files changed, 18 insertions, 0 deletions
diff --git a/file_io/unix/open.c b/file_io/unix/open.c
index ee9196214..eab278f64 100644
--- a/file_io/unix/open.c
+++ b/file_io/unix/open.c
@@ -101,6 +101,10 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
#if APR_HAS_LARGE_FILES && defined(_LARGEFILE64_SOURCE)
oflags |= O_LARGEFILE;
+#elif defined(O_LARGEFILE)
+ if (flag & APR_LARGEFILE) {
+ oflags |= O_LARGEFILE;
+ }
#endif
#if APR_HAS_THREADS
diff --git a/include/apr_file_io.h b/include/apr_file_io.h
index dd5acb72b..86692ca7f 100644
--- a/include/apr_file_io.h
+++ b/include/apr_file_io.h
@@ -69,6 +69,20 @@ extern "C" {
is opened */
#define APR_SENDFILE_ENABLED 0x01000 /**< Advisory flag that this file should
support apr_socket_sendfile operation */
+#define APR_LARGEFILE 0x04000 /**< Platform dependent flag to enable large file
+ support; WARNING see below. */
+
+/** @warning The APR_LARGEFILE flag only has effect on some platforms
+ * where sizeof(apr_off_t) == 4. Where implemented, it allows opening
+ * and writing to a file which exceeds the size which can be
+ * represented by apr_off_t (2 gigabytes). When a file's size does
+ * exceed 2Gb, apr_file_info_get() will fail with an error on the
+ * descriptor, likewise apr_stat()/apr_lstat() will fail on the
+ * filename. apr_dir_read() will fail with APR_INCOMPLETE on a
+ * directory entry for a large file depending on the particular
+ * APR_FINFO_* flags. Generally, it is not recommended to use this
+ * flag. */
+
/** @} */
/**