summaryrefslogtreecommitdiff
path: root/source3/lib/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/system.c')
-rw-r--r--source3/lib/system.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 86802d0c8d..b18358d8b2 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -610,6 +610,20 @@ int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf,
}
/*******************************************************************
+ An posix_fallocate() wrapper that will deal with 64 bit filesizes.
+********************************************************************/
+#if defined(HAVE_POSIX_FALLOCATE64) || defined(HAVE_POSIX_FALLOCATE)
+int sys_posix_fallocate(int fd, SMB_OFF_T offset, SMB_OFF_T len)
+{
+#if defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_OFF64_T) && defined(HAVE_POSIX_FALLOCATE64)
+ return posix_fallocate64(fd, offset, len);
+#else
+ return posix_fallocate(fd, offset, len);
+#endif
+}
+#endif
+
+/*******************************************************************
An ftruncate() wrapper that will deal with 64 bit filesizes.
********************************************************************/