Read (system call)

In modern POSIX compliant operating systems, a program that needs to access data from a file stored in a file system uses the read system call. The file is identified by a file descriptor that is normally obtained from a previous call to open. This system call reads in data in bytes, the number of which is specified by the caller, from the file and stores then into a buffer supplied by the calling process.

The read system call takes three arguments:

  1. The file descriptor of the file.
  2. The buffer where the read data is to be stored.
  3. The number of bytes to be read from the file.