mirror of
https://github.com/coreutils/coreutils.git
synced 2024-12-05 07:54:07 +08:00
*** empty log message ***
This commit is contained in:
parent
2115d8b251
commit
f35a629b10
43
lib/__fpending.c
Normal file
43
lib/__fpending.c
Normal file
@ -0,0 +1,43 @@
|
||||
size_t
|
||||
__fpending (FILE *fp)
|
||||
{
|
||||
#if FPENDING_GLIBC2
|
||||
return fp->_IO_write_ptr - fp->_IO_write_base;
|
||||
#endif
|
||||
|
||||
#if FPENDING__PTR
|
||||
/* Traditional Unix */
|
||||
return fp->_ptr - fp->_base;
|
||||
#endif
|
||||
|
||||
#if FPENDING__P
|
||||
/* BSD */
|
||||
return fp->_p - fp->_bf._base;
|
||||
#endif
|
||||
|
||||
#if FPENDING__P
|
||||
/* SCO, Unixware */
|
||||
return fp->__ptr - fp->__base;
|
||||
#endif
|
||||
|
||||
#if FPENDING__BUFP
|
||||
/* old glibc? */
|
||||
return fp->__bufp - fp->__buffer;
|
||||
#endif
|
||||
|
||||
#if FPENDING__PPTR
|
||||
/* old glibc iostream? */
|
||||
return fp->_pptr - fp->_pbase;
|
||||
#endif
|
||||
|
||||
#if FPENDING__PTR_DEREF
|
||||
/* VMS */
|
||||
return (*fp)->_ptr - (*fp)->_base;
|
||||
#endif
|
||||
|
||||
#if FPENDING_NOT_AVAILABLE
|
||||
/* e.g., DGUX R4.11 */
|
||||
return 1; /* i.e. the info is not available */
|
||||
#endif
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user