SPRU514Z July 2001 – October 2023 SM320F28335-EP
Read Characters from a File
int DEV_read (int dev_fd , char * buf , unsigned count );
The read function reads count bytes from the input file associated with dev_fd.
This function must return -1 to indicate an error if for some reason no bytes could be read from the file. This could be because of an attempt to read from a O_WRONLY file, or for device-specific reasons.
If count is 0, no bytes are read and this function returns 0.
This function returns the number of bytes read, from 0 to count. 0 indicates that EOF was reached before any bytes were read. It is not an error to read less than count bytes; this is common if the are not enough bytes left in the file or the request was larger than an internal device buffer size.