posix_fadvise
give advice about use of file data
- Provided by: freebsd-manpages (Version: 9.2+1-1)
- Report a bug
give advice about use of file data
Standard C Library (libc, -lc)
#include
<fcntl.h>
int
posix_fadvise(int
fd, off_t offset,
off_t len,
int advice);
The
posix_fadvise()
system call allows a process to describe to the system its data access
behavior for an open file descriptor fd. The advice
covers the data starting at offset offset and
continuing for len bytes. If len
is zero, all data from offset to the end of the file
is covered.
The behavior is specified by the advice parameter and may be one of:
POSIX_FADV_NORMALPOSIX_FADV_RANDOMPOSIX_FADV_SEQUENTIALPOSIX_FADV_WILLNEEDPOSIX_FADV_DONTNEEDPOSIX_FADV_NOREUSEThe posix_fadvise() function returns the
value 0 if successful; otherwise the value -1 is returned and
the global variable errno is set to indicate the
error.
The posix_fadvise() system call will fail
if:
EBADF]EINVAL]EINVAL]ENODEV]ESPIPE]The posix_fadvise() interface conforms to
IEEE Std 1003.1-2001 (“POSIX.1”).
The posix_fadvise() system call first
appeared in FreeBSD 9.1.