Skip to content

posix_fadvise() and POSIX_FADV_* #148

@abonander

Description

@abonander

I'm working on an application which will be reading many small files, but only once each. I'd like to be able to use posix_fadvise(fd, 0, 0, POSIX_FADV_WILLNEED) to tell the kernel to asynchronously prefetch the file so when it comes time to access it, it will already have been pulled into the page cache in its entirety (less than 1MB on average) and can be read with minimal blocking.

I was going to implement this myself and issue a PR, but I noticed the semantically similar posix_madvise() has its constants (POSIX_MADV_*) duplicated across the Linux and various BSD/misc *nix modules and I'm not sure why because they have the same values AFAICT.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions