2 Copyright © 1995-2013, The AROS Development Team. All rights reserved.
14 /*****************************************************************************
25 Read one character from the stream. If there is no character
26 available or an error occurred, the function returns EOF.
29 stream - Read from this stream
32 The character read or EOF on end of file or error.
33 If EOF is returned feof() and ferror() indicate if it was an
34 end-of-file situation or an error.
43 getc(), feof(), ferror(), fputc(), putc()
47 ******************************************************************************/
51 if (!(stream
->flags
& __STDCIO_STDIO_READ
))
53 SetIoErr(ERROR_READ_PROTECTED
);
55 stream
->flags
|= __STDCIO_STDIO_ERROR
;
59 if (stream
->flags
& __STDCIO_STDIO_FLUSHONREAD
)
62 stream
->flags
&= ~__STDCIO_STDIO_FLUSHONREAD
;
65 c
= FGetC (stream
->fh
);
72 errno
= __stdc_ioerr2errno (ioerr
);
73 stream
->flags
|= __STDCIO_STDIO_ERROR
;
76 stream
->flags
|= __STDCIO_STDIO_EOF
;