annotate m4/ftruncate.m4 @ 17252:7a29ec33d6c5

missing @item
author Karl Berry <karl@freefriends.org>
date Tue, 01 Jan 2013 09:17:08 -0800
parents e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
17188
d7a44f0f7a15 ftruncate, fts, lstat, openat, raise: no 'static inline'
Paul Eggert <eggert@cs.ucla.edu>
parents: 16795
diff changeset
1 # serial 20
2201
941d51aef6f1 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
2
15739
9f82d16d3139 ftruncate: Un-deprecate, concentrate on Win32 support.
Bruno Haible <bruno@clisp.org>
parents: 14950
diff changeset
3 # See if we need to emulate a missing ftruncate function using chsize.
2201
941d51aef6f1 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
4
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 17188
diff changeset
5 # Copyright (C) 2000-2001, 2003-2007, 2009-2013 Free Software Foundation, Inc.
5611
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5016
diff changeset
6 # This file is free software; the Free Software Foundation
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5016
diff changeset
7 # gives unlimited permission to copy and/or distribute it,
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5016
diff changeset
8 # with or without modifications, as long as this notice is preserved.
87c42e194f4a Use an all-permissive copyright notice, recommended by RMS.
Paul Eggert <eggert@cs.ucla.edu>
parents: 5016
diff changeset
9
5016
7141ea4946af Change jm_ to gl_ in AC_DEFINE'd names. Update all uses.
Jim Meyering <jim@meyering.net>
parents: 4108
diff changeset
10 AC_DEFUN([gl_FUNC_FTRUNCATE],
2201
941d51aef6f1 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
11 [
8199
51d32a83a7df Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents: 6927
diff changeset
12 AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
51d32a83a7df Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents: 6927
diff changeset
13 AC_CHECK_FUNCS_ONCE([ftruncate])
16795
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
14 if test $ac_cv_func_ftruncate = yes; then
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
15 m4_ifdef([gl_LARGEFILE], [
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
16 AC_REQUIRE([AC_CANONICAL_HOST])
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
17 case "$host_os" in
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
18 mingw*)
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
19 dnl Native Windows, and Large File Support is requested.
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
20 dnl The MSVCRT _chsize() function only accepts a 32-bit file size,
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
21 dnl and the mingw64 ftruncate64() function is unreliable (it may
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
22 dnl delete the file, see
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
23 dnl <http://mingw-w64.sourcearchive.com/documentation/2.0-1/ftruncate64_8c_source.html>).
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
24 dnl Use gnulib's ftruncate() implementation instead.
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
25 REPLACE_FTRUNCATE=1
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
26 ;;
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
27 esac
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
28 ], [
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
29 :
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
30 ])
6a9ea5d7b466 Large File Support for native Windows platforms.
Bruno Haible <bruno@clisp.org>
parents: 16201
diff changeset
31 else
8199
51d32a83a7df Move more declarations into <unistd.h>.
Bruno Haible <bruno@clisp.org>
parents: 6927
diff changeset
32 HAVE_FTRUNCATE=0
2201
941d51aef6f1 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
33 fi
941d51aef6f1 *** empty log message ***
Jim Meyering <jim@meyering.net>
parents:
diff changeset
34 ])
4108
c1d472db5c30 An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents: 3339
diff changeset
35
c1d472db5c30 An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents: 3339
diff changeset
36 # Prerequisites of lib/ftruncate.c.
c1d472db5c30 An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents: 3339
diff changeset
37 AC_DEFUN([gl_PREREQ_FTRUNCATE],
c1d472db5c30 An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents: 3339
diff changeset
38 [
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 8205
diff changeset
39 AC_CHECK_FUNCS([chsize])
4108
c1d472db5c30 An independent .m4 file for each module.
Bruno Haible <bruno@clisp.org>
parents: 3339
diff changeset
40 ])