|
|
DataMuseum.dkPresents historical artifacts from the history of: Commodore CBM-900 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about Commodore CBM-900 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 515 (0x203)
Types: TextFile
Notes: UNIX file
Names: »fflush.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
└─⟦f4b8d8c84⟧ UNIX Filesystem
└─⟦this⟧ »libc/stdio/fflush.c«
/*
* Standard I/O Library
* Write out any unwritten data in buffer
*/
#include <stdio.h>
#include <errno.h>
int
fflush(fp)
register FILE *fp;
{
register int cc;
fp->_cc = 0;
errno = 0;
if (fp->_ff&_FERR) {
return (EOF);
} else if ((cc = fp->_cp - fp->_dp) <= 0
|| write(fileno(fp), fp->_dp, cc) == cc
|| errno == EINTR) {
if (cc < 0)
;
else if (fp->_cp == _ep(fp))
fp->_dp = fp->_cp = fp->_bp;
else
fp->_dp = fp->_cp;
return (0);
} else {
fp->_ff |= _FERR;
return (EOF);
}
}