Provides advisory information to the system regarding future behavior of the application with respect to a given file.
This function advises the system on the expected future behavior of the application with regards to a given file. The system can take this advice into account when performing operations on file data specified by this function. The advice is given over the range covered by the offset parameter and continuing for the number of bytes specified by the len parameter. If the value of the len parameter is 0, then all data following the offset parameter is covered.
Item | Description |
---|---|
fd | File descriptor of the file to be advised |
offset | Represents the beginning of the address range |
len | Determines the length of the address range |
advice | Defines the advice to be given |
Upon successful completion, the posix_fadvise subroutine returns 0. Otherwise, one of the following error codes will be returned.
Item | Description |
---|---|
EBADF | The fd parameter is not a valid file descriptor |
EINVAL | The value of the advice parameter is invalid |
ESPIPE | The fd parameter is associated with a pipe of FIFO |