DataMuseum.dk

Presents historical artifacts from the history of:

Commodore CBM-900

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Commodore CBM-900

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦b3c97d2c2⟧ TextFile

    Length: 395 (0x18b)
    Types: TextFile
    Notes: UNIX file
    Names: »_fputc.c«

Derivation

└─⟦f27320a65⟧ Bits:30001972 Commodore 900 hard disk image with partial source code
    └─⟦f4b8d8c84⟧ UNIX V7 Filesystem
        └─ ⟦this⟧ »libc/stdio/_fputc.c« 

TextFile

/*
 * Standard I/O Library Internals
 * Unbuffered output
 */

#include <stdio.h>
#include <errno.h>

int
_fputc(c, fp)
register unsigned char	c;
register FILE	*fp;
{
	char	s[1] = c;

	fp->_cc = 0;
	errno = 0;
	if (fp->_ff&_FERR || _fpseek(fp)) {
		return (EOF);
	} else if (write(fileno(fp), s, 1) == 1) {
		return (c);
	} else {
		if (errno != EINTR)
			fp->_ff |= _FERR;
		return (EOF);
	}
}