1 diff -ur transmission-2.30b1.orig/configure.ac transmission-2.30b1/configure.ac
2 --- transmission-2.30b1.orig/configure.ac 2011-04-01 03:28:41.000000000 +0200
3 +++ transmission-2.30b1/configure.ac 2011-04-08 14:31:31.233502737 +0200
8 +AC_MSG_CHECKING([for SYS_fallocate])
9 +AC_TRY_LINK([#include <sys/syscall.h>
10 +#include <sys/types.h>],
11 + [return syscall(SYS_fallocate, 0, 0, (loff_t) 0, (loff_t) 0);],
12 + [AC_DEFINE([HAVE_SYS_FALLOCATE],[1],[Defined if you have the SYS_fallocate syscall number])
13 + AC_MSG_RESULT([yes])],
14 + [AC_MSG_RESULT([no])])
16 AC_CHECK_HEADERS([stdbool.h])
17 AC_CHECK_FUNCS([iconv_open pread pwrite lrintf strlcpy daemon dirname basename strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll])
19 diff -ur transmission-2.30b1.orig/libtransmission/fdlimit.c transmission-2.30b1/libtransmission/fdlimit.c
20 --- transmission-2.30b1.orig/libtransmission/fdlimit.c 2011-04-01 03:28:34.000000000 +0200
21 +++ transmission-2.30b1/libtransmission/fdlimit.c 2011-04-08 14:34:14.120502738 +0200
26 +#ifdef HAVE_SYS_FALLOCATE
27 + #include <sys/syscall.h>
30 #ifdef HAVE_FALLOCATE64
31 /* FIXME can't find the right #include voodoo to pick up the declaration.. */
32 extern int fallocate64( int fd, int mode, uint64_t offset, uint64_t len );
34 success = !fcntl( fd, F_PREALLOCATE, &fst );
38 +# ifdef HAVE_SYS_FALLOCATE
41 + success = !syscall( SYS_fallocate, fd, 0, (loff_t) 0, (loff_t) length );
45 # ifdef HAVE_POSIX_FALLOCATE