2.11.5. _sys_read()

This function reads the contents of a file into a buffer.

Syntax

int _sys_read(FILEHANDLE fh, unsigned char *buf, unsigned len, int mode);

Note

The mode parameter is here for historical reasons. It contains nothing useful and must be ignored.

Return

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:

    Early EOF

    The last read from a file returns some characters plus an EOF indicator.

    Late EOF

    The last read returns only EOF.

Copyright © 2007-2010 ARM. All rights reserved.ARM DUI 0349C
Non-ConfidentialID101213