If a read is interrupted by a signal before it reads any data, it shall return -1 with errno set to [EINTR].
The value returned may be less than nbyte if the number of bytes left in the file is less than nbyte, if the read request was interrupted by a signal, or if the file is a pipe or FIFO or special file and has fewer than nbyte bytes immediately available for reading.
Conforming applications should not assume which group ID will be used. If data is later written at this point, subsequent reads in the gap between the previous end of data and the newly written data shall return bytes with value 0 until data is written into the gap. Tweet This is my first article in what I'm hoping will be a series of articles on system programming for POSIX compliant operating systems with focus on Linux.
Implementations are allowed, but not required, to perform error checking for read requests of zero bytes.
If the file refers to a device special file, the result of subsequent read requests is implementation-defined. In the following example we also use read and write system calls to copy from one file descriptor to the other both descriptors returned by open system call so it is wise to open their man pages as well man 2 read and man 2 write.
If -1 is returned when any data is transferred, it is difficult to recover from the error on a seekable device and impossible on a non-seekable device.
An open for writing-only shall return an error if no process currently has the file open for reading. As the name suggests, fseek seeks the cursor to the given record in the file. That's it for this introductory article on Linux system programming topic. Future Directions None.
The result is undefined if this flag is applied to a FIFO. Referenced By.