From: Jim Meyering <jim@meyering.net>
Date: Sat, 26 Aug 2000 11:55:12 +0000 (+0000)
Subject: *** empty log message ***
X-Git-Tag: FILEUTILS-4_0z~22
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=b3467d18575fa78e0b7a86e40b74a6a86e91f630;p=gnulib.git

*** empty log message ***
---

diff --git a/lib/__fpending.c b/lib/__fpending.c
index 5b6e3e3817..00ca83b6ab 100644
--- a/lib/__fpending.c
+++ b/lib/__fpending.c
@@ -1,43 +1,8 @@
+#include <stdio.h>
+#include <sys/types.h>
+
 size_t
 __fpending (FILE *fp)
 {
-#if STREAM_FPENDING_GLIBC2
-  return fp->_IO_write_ptr - fp->_IO_write_base;
-#endif
-
-#if STREAM_FPENDING__PTR
-  /* Traditional Unix */
-  return fp->_ptr - fp->_base;
-#endif
-
-#if STREAM_FPENDING__P
-  /* BSD */
-  return fp->_p - fp->_bf._base;
-#endif
-
-#if STREAM_FPENDING__P
-  /* SCO, Unixware */
-  return fp->__ptr - fp->__base;
-#endif
-
-#if STREAM_FPENDING__BUFP
-  /* old glibc? */
-  return fp->__bufp - fp->__buffer;
-#endif
-
-#if STREAM_FPENDING__PPTR
-  /* old glibc iostream? */
-  return fp->_pptr - fp->_pbase;
-#endif
-
-#if STREAM_FPENDING__PTR_DEREF
-  /* VMS */
-  return (*fp)->_ptr - (*fp)->_base;
-#endif
-
-#if STREAM_FPENDING_NOT_AVAILABLE
-  /* e.g., DGUX R4.11 */
-  return 1; /* i.e. the info is not available */
-#endif
-
+  return PENDING_OUTPUT_N_BYTES;
 }
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 5343e52996..0bfd0fd418 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,8 @@
+2000-08-26  Jim Meyering  <meyering@lucent.com>
+
+	* jm-macros.m4: Use jm_FUNC_FPENDING.
+	* fpending.m4: New file.
+
 2000-08-20  Jim Meyering  <meyering@lucent.com>
 
 	* check-decl.m4: Include utmp.h `#if HAVE_UTMP_H', rather than
diff --git a/m4/fpending.m4 b/m4/fpending.m4
index 6e287975e6..b512f5d0bd 100644
--- a/m4/fpending.m4
+++ b/m4/fpending.m4
@@ -4,6 +4,10 @@ dnl From Jim Meyering
 dnl Using code from emacs, based on suggestions from Paul Eggert
 dnl and Ulrich Drepper.
 
+dnl Find out how to determine the number of pending output bytes on a stream.
+dnl Solaris provides __fpending.  On other systems, we have to grub around
+dnl in the FILE struct.
+
 AC_DEFUN(jm_FUNC_FPENDING,
 [
   AC_CHECK_HEADERS(stdio_ext.h)