| |||
| Home > The C and C++ Libraries > Tailoring the input/output functions > _sys_read() | |||
This function reads the contents of a file into a buffer.
int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode);
The mode parameter is here for historical reasons. It contains nothing useful and must be ignored.
The return value is one of the following:
The number of characters not read
(that is, len - result were
read).
An error indication.
An EOF indicator. The EOF indication
involves the setting of 0x80000000 in the normal
result. The target-independent code is capable of handling either:
The last read from a file returns some characters
plus an EOF indicator.
The
last read returns only EOF.