|
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 - download
Length: 523 (0x20b) Types: TextFile Notes: UNIX file Names: »fwrite.c«
└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code └─⟦f4b8d8c84⟧ UNIX Filesystem └─ ⟦this⟧ »libc/stdio/fwrite.c«
/* * Standard I/O Library * Write nitems of size to file fp */ #include <stdio.h> int fwrite(bp, size, nitems, fp) register unsigned char *bp; int size, nitems; register FILE *fp; { register unsigned int nb = size*nitems; if (fp->_ff&_FUNGOT) (*fp->_gt)(fp); if (fp->_bp!=NULL || !(fp->_ff&_FSTBUF)) { for (; nb && putc(*bp++, fp)!=EOF; nb--) ; if (nb) return (0); else return (nitems); } else if (write(fileno(fp), bp, nb) != nb) { fp->_ff |= _FERR; return (0); } else return (nitems); }