Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > F

fadvise(5)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

fadvise: fadvise.h — structures needed when using the fadvise() function

SYNOPSIS

#include <sys/fcntl.h> #include <sys/fadvise.h>

DESCRIPTION

The <sys/fadvise.h> header defines the structures fad_extparms and fad_parms and other literals needed when using the fadvise() function (see fadvise(2)).

The fad_extparms structure contains the following members:

intfad_countnumber of entries in fad_plist[]
struct fad_parmsfad_plist[1]array of struct fad_parms

The fad_parms structure contains the following members:

enum fadv_hintsfad_advicehint applying to parameter tuple.
off_t_fad_res1may be one of the following: byte offset of range in file; memory allocation policy for cc-numa systems.
size_t_fad_res2may be one of the following: byte size of range in file; memory locality to be used when allocating memory on cc-numa systems; the duration after which a dirty page is to be written to the file system.

APPLICATION USAGE

The following macros and aliases have been defined to align with the ISO POSIX-1 standard.

#ifdef _APP32_64BIT_OFF_T #define posix_fadvise(FD, OFF, LEN, CMD) fadvise64(FD, OFF, LEN, CMD, NULL) #else #define posix_fadvise(FD, OFF, LEN, CMD) fadvise(FD, OFF, LEN, CMD, NULL) #endif #define POSIX_FADV_NORMAL FADV_NORMAL #define POSIX_FADV_SEQUENTIAL FADV_SEQUENTIAL #define POSIX_FADV_RANDOM FADV_RANDOM #define POSIX_FADV_WILLNEED FADV_WILLNEED #define POSIX_FADV_DONTNEED FADV_DONTNEED #define POSIX_FADV_NOREUSE FADV_NOREUSE

The following aliases can be used with the FADV_CCNUMA hint.

#define FAD_POLICY _fad_res1 /* allocation policy */

The following aliases can be used with the FADV_LARGEPAGE_HINT hint.

#define FAD_PGSIZE _fad_res2 /* preferred large page size */

The following aliases can be used with the FADV_SYNC_RDWR hint.

#define FAD_SYNC_TIME _fad_res2 /* pageout interval in secs. */

EXAMPLES

#include <sys/fcntl.h> #include <sys/fadvise.h> fad_extparms_t fad_extparms; main(int argc, char *argv[]) { int fd; fd = open(argv[1], O_RDONLY); /* To setup a CCNuma policy of MEM_FIRST_TOUCH */ bzero(&fad_extparms, sizeof(fad_extparms_t)); fad_extparms.fad_count = 1; fad_extparms.fad_plist[0].fad_advice = FADV_CCNUMA; fad_extparms.fad_plist[0].FAD_POLICY = FADV_VM_MEM_FIRST_TOUCH; fadvise(fd, 0, 0, 0, &fad_extparms); }

WARNINGS

For 32-bit applications, _fad_res1 will be truncated to its least significant 32-bits for file systems that use 64-bit values.

STANDARDS CONFORMANCE

<sys/fcntl.h>: POSIX.1

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.