ack/plat/cpm/libsys/read.c
David Given 3131dc9915 Partially working port of stdio to CP/M. I'm not sure this will work; it's
getting way too complicated (stdio is horribly subtle). I think I need to
rethink things.
2019-06-15 22:22:01 +02:00

25 lines
321 B
C

/* $Source$
* $State$
* $Revision$
*/
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
#include <cpm.h>
ssize_t read(int fd, void* buffer, size_t count)
{
short save;
unsigned char before_n;
if (fd != 0)
{
errno = EBADF;
return -1;
}
return fread(buffer, 1, count, stdin);
}