diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2005-04-29 16:24:04 +0200 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2005-04-29 14:24:04 +0000 |
commit | 1fb2002d69c09edb91d88e99a21a86f908b7b85b (patch) | |
tree | a275ecb539740a9fd80fe2e5eb77413d18dafbd4 /libgfortran/io/unix.c | |
parent | 88c6057f1decb05de984570727588fc29093aaf4 (diff) | |
download | gcc-1fb2002d69c09edb91d88e99a21a86f908b7b85b.zip gcc-1fb2002d69c09edb91d88e99a21a86f908b7b85b.tar.gz gcc-1fb2002d69c09edb91d88e99a21a86f908b7b85b.tar.bz2 |
configure.ac: Check for ftruncate and chsize.
* configure.ac: Check for ftruncate and chsize.
* io/unix.c (fd_truncate): Provide chsize as alternative to
ftruncate.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r98989
Diffstat (limited to 'libgfortran/io/unix.c')
-rw-r--r-- | libgfortran/io/unix.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 5dc31a5..78ed0f7 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -513,8 +513,15 @@ fd_truncate (unix_stream * s) /* non-seekable files, like terminals and fifo's fail the lseek. the fd is a regular file at this point */ +#ifdef HAVE_FTRUNCATE if (ftruncate (s->fd, s->logical_offset)) return FAILURE; +#else +#ifdef HAVE_CHSIZE + if (chsize (s->fd, s->logical_offset)) + return FAILURE; +#endif +#endif s->physical_offset = s->file_length = s->logical_offset; |