fadvise.2 (2010 09)

f
fadvise(2) fadvise(2)
NAME
fadvise() - file advisory information
SYNOPSIS
#include <sys/fcntl.h>
#include <sys/fadvise.h>
int fadvise(
int fad_fd ,
off_t fad_offset,
size_t fad_len ,
enum fadv_hints fad_advice ,
fad_extparms_t *
fad_extparms
);
Parameters
fad_fd The open file descriptor to which the fadvise operation applies.
fad_offset The beginning of the specified range as a positive, byte offset.
fad_len The length of the specified range in bytes.
fad_advice Specifies advice to be applied to range (see fadvise (5)).
fad_extparms Pointer to an array of
fad_extparms_t
(see fadvise (5)).
DESCRIPTION
The
fadvise() function is used to advise the system about the expected behavior of the application
with respect to the data in the file associated with the open file descriptor, fad_fd , starting at fad_offset
and continuing for fad_len bytes. The specified range need not currently exist in the file. If fad_len is
zero, all data following fad_offset is specified.
The interpretation of the fad_offset and fad_len parameters are conditional in that they are ignored in the
case of a non-null fad_extparms argument. If non-null, the fad_extparms argument is used as a pointer
to an extended parameter list of type
fad_extparms_t
(see fadvise (5)).
The extended parameter list allows an application to batch hints over multiple ranges in one call. The
fad_count items are processed in list order where, in the case of overlapping ranges, entries lower on the
list of hints take precedence.
It should be noted that the effect of all hints is cumulative for a given file object. All hints will be
removed on processing the last close of the file object.
The fad_advice parameter is used to convey the hint to be applied to the data and may be one of the fol-
lowing values:
FADV_CCNUMA The cc-numa related policies are to be used by VM for physical memory
locality when allocating memory for file I/O. This attribute applies to the
entire file only.
Either one of the following policies can be combined with the
FADV_CCNUMA command (for further reference see fadvise(5):
FADV_VM_MEM_INTERLEAVED
Policy specifying that memory for the file will be allocated from
interleaved memory. Interleaved memory is memory allocated from
several locality domains and then striped together. It should be
used if equal-cost allocations are needed.
FADV_VM_MEM_FIRST_TOUCH
Policy specifying that memory for the file will be allocated from the
locality of the calling CPU. Fast when memory is available from the
closest locality otherwise search by distance for available memory
to allocate.
FADV_DONTNEED Specifies that the application will expect that it will not access the
specified range of data in the near future.
FADV_LARGEPAGE_HINT The application prefers that large pages be used by VM in allocating
memory for file I/O. The preferred page size is passed in the fad_pgsize
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (4 pages)