Visible to Intel only — GUID: bsi1653012212807
Ixiasoft
Visible to Intel only — GUID: bsi1653012212807
Ixiasoft
16.1.1.70. read()
Prototype
int read(int fd, void *ptr, size_t len)Commonly Called By
C/C++ programsDevice drivers
Thread-safe
See description.Available from ISR
No.Include
<unistd.h>Description
The read() function reads a block of data from a file or device. read() is wrapper function that passes control directly to the read() function registered for the device driver associated with the open file descriptor fd. The input argument, ptr, is the location to place the data read and len is the length of the data to read in bytes.Calls to read() are thread-safe only if the implementation of read() provided by the driver that is manipulated is thread-safe.
Valid values for the fd parameter are: stdout, stdin, and stderr, or any value returned from a call to open().
Return
The return argument is the number of bytes read, which might be less than the requested lengthThe return value is –1 upon an error. In the event of an error, errno is set to indicate the cause.