Skip to main content
edited tags
Link
Peter Cordes
  • 6.5k
  • 23
  • 41
Became Hot Network Question
Source Link

Difference between posix_fadvise and readahead

As per manpage, readahead is Linux specific:

CONFORMING TO

The readahead() system call is Linux-specific, and its use should be avoided in portable applications.

and posix_fadvise is portable:

CONFORMING TO

POSIX.1-2001, POSIX.1-2008. Note that the type of the len argument was changed from size_t to off_t in POSIX.1-2001 TC1.

But both of them seem to do the same thing. But what are the consequences of exchanging both functions, other than risking portability?