xref: /netbsd/external/gpl2/xcvs/dist/m4/ftruncate.m4 (revision a7c91847)
1#serial 7
2
3# See if we need to emulate a missing ftruncate function using fcntl or chsize.
4
5# Copyright (C) 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
6# This file is free software; the Free Software Foundation
7# gives unlimited permission to copy and/or distribute it,
8# with or without modifications, as long as this notice is preserved.
9
10AC_DEFUN([gl_FUNC_FTRUNCATE],
11[
12  AC_REPLACE_FUNCS(ftruncate)
13  if test $ac_cv_func_ftruncate = no; then
14    gl_PREREQ_FTRUNCATE
15  fi
16])
17
18# Prerequisites of lib/ftruncate.c.
19AC_DEFUN([gl_PREREQ_FTRUNCATE],
20[
21  AC_CHECK_HEADERS_ONCE(unistd.h)
22  AC_CHECK_FUNCS(chsize)
23])
24