Changeset 7098


Ignore:
Timestamp:
Nov 12, 2008, 3:59:30 AM (12 years ago)
Author:
charles
Message:

(libT) better testing for fallocate() on linux

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r7097 r7098  
    5050AC_HEADER_STDC
    5151AC_HEADER_TIME
    52 AC_CHECK_FUNCS([lrintf strlcpy daemon dirname basename daemon strcasecmp localtime_r fallocate posix_fallocate])
     52
     53AC_MSG_CHECKING([for fallocate])
     54AC_TRY_LINK([#include <linux/falloc.h>],
     55            [return fallocate(-1,0,0,0);],
     56            [AC_DEFINE([HAVE_FALLOCATE],[1],[Defined if fallocate() exists])
     57             AC_MSG_RESULT([yes])],
     58            [AC_MSG_RESULT([no])])
     59AC_CHECK_FUNCS([lrintf strlcpy daemon dirname basename daemon strcasecmp localtime_r posix_fallocate])
    5360AC_PROG_INSTALL
    5461AC_PROG_MAKE_SET
  • trunk/libtransmission/fdlimit.c

    r7051 r7098  
    3737#endif
    3838
     39#ifdef HAVE_FALLOCATE
     40 #include <linux/falloc.h>
     41#endif
     42
    3943#include <sys/types.h>
    4044#include <sys/stat.h>
     
    105109#ifdef HAVE_FALLOCATE
    106110
    107     return fallocate( fd, 0, offset, length );
     111    return fallocate( fd, FALLOC_FL_KEEP_SIZE, 0, length );
    108112
    109113#elif defined(HAVE_POSIX_FALLOCATE)
Note: See TracChangeset for help on using the changeset viewer.