posix_fadvise.2 (2010 09)
p
posix_fadvise(2) posix_fadvise(2)
ERRORS
If the posix_fadvise()
service fails, errno is set to one of the following values:
[EBADF] The fd argument is not a valid file descriptor.
[ESPIPE] The fd argument is associated with a pipe or FIFO.
[ENOTTY] The posix_fadvise operation is not supported by the underlying file system.
[EINVAL] The value of advice or one of the other input values has been found to be invalid.
[ENOSYS] A designated hint is not supported by the underlying file object.
EXAMPLES
int fd, ret;
/*
* Advise the system that we’re sequentially accessing the
* 64KB range and will not be re-using the data.
*/
fd = open (argv[1], O_RDONLY|O_CREAT, 0777);
ret = posix_fadvise (fd, 0, 0, 0, FADV_SEQUENTIAL);
if (ret == -1) {
printf ("fadvise() failure errno %d\n", errno);
exit;
}
ret = posix_fadvise (fd, 0, 0, 0, FADV_NOREUSE);
if (ret == -1)
printf ("fadvise() failure errno %d\n", errno);
exit;
}
AUTHOR
posix_fadvise() was derived by HP from the IEEE POSIX 1003.1-2001 Standard.
SEE ALSO
fadvise(2), fcntl(2), fadvise(5), fcntl(5).
STANDARDS CONFORMANCE
posix_fadvise(): POSIX.1 (2001)
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010