summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-03-24 20:09:18 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-03-24 20:09:18 +0000
commite89ec1011c65a91dc8e3f545cd9b352cf46900d7 (patch)
tree088de01f545eca449ae8da5a267fae12d5ce35ec
parent1375dfd74f2ae8e62ebcab3204988ec7e6f4feb8 (diff)
downloadlibapr-e89ec1011c65a91dc8e3f545cd9b352cf46900d7.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. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/APR_0_9_BRANCH@65024 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--CHANGES4
-rw-r--r--file_io/unix/open.c5
-rw-r--r--include/apr_file_io.h14
3 files changed, 23 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index 280b419c8..2282ec61c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
Changes with APR 0.9.5
+ *) Add APR_LARGEFILE flag to allow opening files with the
+ O_LARGEFILE flag; not recommended for general use, see
+ include/apr_file_io.h. [Joe Orton]
+
*) Various build fixes: thread_rwlock.c on some Solaris platforms
(PR 22990); filestat.c on ReliantUnix (PR 22990); config.status
on IRIX (PR 19251). [Various]
diff --git a/file_io/unix/open.c b/file_io/unix/open.c
index f46ac99bc..f28f13b2a 100644
--- a/file_io/unix/open.c
+++ b/file_io/unix/open.c
@@ -98,6 +98,11 @@ APR_DECLARE(apr_status_t) apr_file_open(apr_file_t **new,
oflags |= O_BINARY;
}
#endif
+#ifdef O_LARGEFILE
+ if (flag & APR_LARGEFILE) {
+ oflags |= O_LARGEFILE;
+ }
+#endif
#if APR_HAS_THREADS
if ((flag & APR_BUFFERED) && (flag & APR_XTHREAD)) {
diff --git a/include/apr_file_io.h b/include/apr_file_io.h
index f14b33669..19ffdf995 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_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. */
+
/** @} */
/**