]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
natFileDescriptorPosix.cc (setLength): Handle case where ftruncate is missing.
authorTom Tromey <tromey@redhat.com>
Thu, 29 Aug 2002 18:05:15 +0000 (18:05 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 29 Aug 2002 18:05:15 +0000 (18:05 +0000)
* 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

libjava/ChangeLog
libjava/acconfig.h
libjava/configure
libjava/configure.in
libjava/include/config.h.in
libjava/java/io/natFileDescriptorPosix.cc

index 8d8f248bed3a75fb0bcdba3121913344dd89a2f8..a00a4db5f9001cf6dc72c9754820dae0b6980563 100644 (file)
@@ -1,3 +1,11 @@
+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.
index bd02d33c16f9de13c107381ee025e5e451d792dc..308f71ebdec6e71ddc2701239bbf7abfb1dc067c 100644 (file)
 #undef HAVE_READDIR_R
 #undef HAVE_GETHOSTBYNAME_R
 #undef HAVE_GETHOSTBYADDR_R
+#undef HAVE_FTRUNCATE
 
 /* Define if you want a bytecode interpreter.  */
 #undef INTERPRETER
index cb4425d07ded9706ae2bc104b1373afbde8fdb6d..20b1836aa47958622f2c32fcf4c2f6aeaeccb040 100755 (executable)
@@ -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.
index 752739ba2651aebc202a6ae7619ec33bde3a13f1..93437c685b78c46a776366f534128120fbaa374f 100644 (file)
@@ -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
index 266d6e3032dd3034d8e03bae1198b7d12de1c01a..f75f74f0318f6e7bbb8029ae25b135db7825f704 100644 (file)
 #undef HAVE_READDIR_R
 #undef HAVE_GETHOSTBYNAME_R
 #undef HAVE_GETHOSTBYADDR_R
+#undef HAVE_FTRUNCATE
 
 /* Define if you want a bytecode interpreter.  */
 #undef INTERPRETER
 /* 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
 
index 9f4c7c3cb1dcec5f9a5bb0b10d875aca6997aa03..9929c3021f74f76c5fdcb26c5fd4c31382fca4db 100644 (file)
@@ -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