3 # See if we need to emulate a missing ftruncate function using fcntl.
5 AC_DEFUN(jm_FUNC_FTRUNCATE,
7 AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
9 if test "$ftruncate_missing" = yes; then
10 AC_CHECK_HEADERS(unistd.h)
11 AC_MSG_CHECKING([fcntl emulation of ftruncate])
12 AC_CACHE_VAL(fu_cv_sys_ftruncate_emulation,
14 #include <sys/types.h>
15 #include <fcntl.h>], [
16 #if !defined(F_CHSIZE) && !defined(F_FREESP)
20 fu_cv_sys_ftruncate_emulation=yes,
21 fu_cv_sys_ftruncate_emulation=no)])
22 AC_MSG_RESULT($fu_cv_sys_ftruncate_emulation)
23 if test $fu_cv_sys_ftruncate_emulation = yes; then
24 LIBOBJS="$LIBOBJS ftruncate.$ac_objext"