Commit a54b1ce7 authored by fxcoudert's avatar fxcoudert
Browse files

* configure.ac: Check for ftruncate and chsize.

	* io/unix.c (fd_truncate): Provide chsize as alternative to
	ftruncate.
	* config.h.in: Regenerate.
	* configure: Regenerate.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@98989 138bc75d-0d04-0410-961f-82ee72b054a4
parent 41b9306e
2005-04-29 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* configure.ac: Check for ftruncate and chsize.
* io/unix.c (fd_truncate): Provide chsize as alternative to
ftruncate.
* config.h.in: Regenerate.
* configure: Regenerate.
2004-04-29 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de>
* intrinsics/rename.c: Add missing #includes.
......
......@@ -30,6 +30,9 @@
/* Define to 1 if you have the `chdir' function. */
#undef HAVE_CHDIR
/* Define to 1 if you have the `chsize' function. */
#undef HAVE_CHSIZE
/* complex.h exists */
#undef HAVE_COMPLEX_H
......@@ -69,6 +72,9 @@
/* libm includes frexpf */
#undef HAVE_FREXPF
/* Define to 1 if you have the `ftruncate' function. */
#undef HAVE_FTRUNCATE
/* libc includes getgid */
#undef HAVE_GETGID
......
This diff is collapsed.
......@@ -166,7 +166,7 @@ AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_CHECK_LIB([m],[csin],[need_math="no"],[need_math="yes"])
# Check for library functions.
AC_CHECK_FUNCS(getrusage times mkstemp strtof snprintf)
AC_CHECK_FUNCS(getrusage times mkstemp strtof snprintf ftruncate chsize)
AC_CHECK_FUNCS(chdir strerror getlogin gethostname kill link symlink perror)
AC_CHECK_FUNCS(sleep time)
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment