From 21a67b797e40df930b83bd407ffc165b3f4b91b2 Mon Sep 17 00:00:00 2001 From: Filipe David Manana Date: Mon, 26 Apr 2010 13:04:40 +0200 Subject: Add file:advise/4 - a wrapper to the POSIX syscall posix_fadvise Useful for informing the Operating System about the access pattern for a file's data, so that it can adapt the caching strategy to maximize disk IO performance. --- erts/emulator/drivers/unix/unix_efile.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'erts/emulator/drivers/unix') diff --git a/erts/emulator/drivers/unix/unix_efile.c b/erts/emulator/drivers/unix/unix_efile.c index 0cece76221..ea016526ef 100644 --- a/erts/emulator/drivers/unix/unix_efile.c +++ b/erts/emulator/drivers/unix/unix_efile.c @@ -1448,3 +1448,14 @@ efile_symlink(Efile_error* errInfo, char* old, char* new) return check_error(symlink(old, new), errInfo); #endif } + +int +efile_fadvise(Efile_error* errInfo, int fd, Sint64 offset, + Sint64 length, int advise) +{ +#ifdef HAVE_POSIX_FADVISE + return check_error(posix_fadvise(fd, offset, length, advise), errInfo); +#else + return check_error(0, errInfo); +#endif +} -- cgit v1.2.3