aboutsummaryrefslogtreecommitdiff
path: root/libjava
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2002-08-29 18:05:15 +0000
committerTom Tromey <tromey@gcc.gnu.org>2002-08-29 18:05:15 +0000
commit0148e1ee90a9cec90cbd0b32b99cf532eaae9699 (patch)
treea31a718cf9037c5c8f783d5e793792805d6ed4b0 /libjava
parent3308c46e47a0b17d37b4c29a130e6519c424a737 (diff)
downloadgcc-0148e1ee90a9cec90cbd0b32b99cf532eaae9699.zip
gcc-0148e1ee90a9cec90cbd0b32b99cf532eaae9699.tar.gz
gcc-0148e1ee90a9cec90cbd0b32b99cf532eaae9699.tar.bz2
natFileDescriptorPosix.cc (setLength): Handle case where ftruncate is missing.
* java/io/natFileDescriptorPosix.cc (setLength): Handle case where ftruncate is missing. * configure, include/config.h.in: Rebuilt. * acconfig.h (HAVE_FTRUNCATE): Mention. * configure.in: Check for ftruncate. From-SVN: r56658
Diffstat (limited to 'libjava')
-rw-r--r--libjava/ChangeLog8
-rw-r--r--libjava/acconfig.h1
-rwxr-xr-xlibjava/configure4
-rw-r--r--libjava/configure.in2
-rw-r--r--libjava/include/config.h.in4
-rw-r--r--libjava/java/io/natFileDescriptorPosix.cc4
6 files changed, 20 insertions, 3 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index 8d8f248..a00a4db 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,5 +1,13 @@
2002-08-29 Tom Tromey <tromey@redhat.com>
+ * java/io/natFileDescriptorPosix.cc (setLength): Handle case where
+ ftruncate is missing.
+ * configure, include/config.h.in: Rebuilt.
+ * acconfig.h (HAVE_FTRUNCATE): Mention.
+ * configure.in: Check for ftruncate.
+
+2002-08-29 Tom Tromey <tromey@redhat.com>
+
* include/jvm.h (struct _Jv_frame_info): New structure.
* gnu/gcj/runtime/natNameFinder.cc: Include StringBuffer.h,
java-interp.h.
diff --git a/libjava/acconfig.h b/libjava/acconfig.h
index bd02d33..308f71e 100644
--- a/libjava/acconfig.h
+++ b/libjava/acconfig.h
@@ -107,6 +107,7 @@
#undef HAVE_READDIR_R
#undef HAVE_GETHOSTBYNAME_R
#undef HAVE_GETHOSTBYADDR_R
+#undef HAVE_FTRUNCATE
/* Define if you want a bytecode interpreter. */
#undef INTERPRETER
diff --git a/libjava/configure b/libjava/configure
index cb4425d..20b1836 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -3734,7 +3734,7 @@ else
fi
done
- for ac_func in fork execvp pipe sigaction
+ for ac_func in fork execvp pipe sigaction ftruncate
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:3741: checking for $ac_func" >&5
@@ -7730,7 +7730,7 @@ cat >> $CONFIG_STATUS <<\EOF
# Split the substitutions into bite-sized pieces for seds with
# small command number limits, like on Digital OSF/1 and HP-UX.
-ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_max_sed_cmds=60 # Maximum number of lines to put in a sed script.
ac_file=1 # Number of current file.
ac_beg=1 # First line for current file.
ac_end=$ac_max_sed_cmds # Line after last line for current file.
diff --git a/libjava/configure.in b/libjava/configure.in
index 752739b..93437c6 100644
--- a/libjava/configure.in
+++ b/libjava/configure.in
@@ -507,7 +507,7 @@ else
AC_CHECK_FUNCS(nl_langinfo setlocale)
AC_CHECK_FUNCS(inet_aton inet_addr, break)
AC_CHECK_FUNCS(inet_pton uname inet_ntoa)
- AC_CHECK_FUNCS(fork execvp pipe sigaction)
+ AC_CHECK_FUNCS(fork execvp pipe sigaction ftruncate)
AC_CHECK_HEADERS(execinfo.h unistd.h dlfcn.h)
AC_CHECK_FUNC(backtrace, [
case "$host" in
diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in
index 266d6e3..f75f74f 100644
--- a/libjava/include/config.h.in
+++ b/libjava/include/config.h.in
@@ -132,6 +132,7 @@
#undef HAVE_READDIR_R
#undef HAVE_GETHOSTBYNAME_R
#undef HAVE_GETHOSTBYADDR_R
+#undef HAVE_FTRUNCATE
/* Define if you want a bytecode interpreter. */
#undef INTERPRETER
@@ -201,6 +202,9 @@
/* Define if you have the ftime function. */
#undef HAVE_FTIME
+/* Define if you have the ftruncate function. */
+#undef HAVE_FTRUNCATE
+
/* Define if you have the getcwd function. */
#undef HAVE_GETCWD
diff --git a/libjava/java/io/natFileDescriptorPosix.cc b/libjava/java/io/natFileDescriptorPosix.cc
index 9f4c7c3..9929c30 100644
--- a/libjava/java/io/natFileDescriptorPosix.cc
+++ b/libjava/java/io/natFileDescriptorPosix.cc
@@ -195,6 +195,7 @@ java::io::FileDescriptor::setLength (jlong pos)
struct stat sb;
off_t orig;
+#ifdef HAVE_FTRUNCATE
if (::fstat (fd, &sb))
throw new IOException (JvNewStringLatin1 (strerror (errno)));
@@ -219,6 +220,9 @@ java::io::FileDescriptor::setLength (jlong pos)
}
else if (::ftruncate (fd, (off_t) pos))
throw new IOException (JvNewStringLatin1 (strerror (errno)));
+#else /* HAVE_FTRUNCATE */
+ throw new IOException (JvNewStringLatin1 ("FileDescriptor.setLength not implemented"));
+#endif /* HAVE_FTRUNCATE */
}
jint