1--- src/ftp.c.ORIG 2006-11-09 15:06:13.000000000 -0800 2+++ src/ftp.c 2006-11-09 15:08:14.000000000 -0800 3@@ -101,6 +101,10 @@ 4 #include "lukemftp.h" 5 6 #include <arpa/telnet.h> 7+#ifdef __APPLE__ 8+#include <sys/mount.h> 9+#include <fcntl.h> 10+#endif /* __APPLE__ */ 11 12 #include "ftp_var.h" 13 14@@ -1055,6 +1059,31 @@ 15 16 progressmeter(-1); 17 18+#ifdef __APPLE__ 19+ /* 20+ * Pre-allocate blocks for the destination file if it 21+ * resides on Xsan. 22+ * Take the restart position into consideration 23+ * when computing the length. PR-4074918 24+ */ 25+ 26+ if (filesize - restart_point > 0 ) { 27+ struct statfs sfs; 28+ 29+ if (fstatfs(fileno(fout), &sfs) == 0 && 30+ strcmp(sfs.f_fstypename, "acfs") == 0) { 31+ fstore_t fst; 32+ 33+ fst.fst_flags = 0; 34+ fst.fst_posmode = F_PEOFPOSMODE; 35+ fst.fst_offset = 0; 36+ fst.fst_length = filesize - restart_point; 37+ 38+ (void) fcntl(fileno(fout), F_PREALLOCATE, &fst); 39+ } 40+ } 41+#endif /* __APPLE__ */ 42+ 43 switch (curtype) { 44 45 case TYPE_I: 46 47