aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-11-18 19:54:14 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-11-18 19:54:14 +0530
commit8705cb99a3b10dbdfd5490f04ed7c361971c26b2 (patch)
tree947440cf7f9c40115f07218d49ede5c2fe75c0c2 /src
parent0ef9ec196e7fa0732a9bce5b3223d4e66a0997ba (diff)
downloadnnn-8705cb99a3b10dbdfd5490f04ed7c361971c26b2.tar.gz
Seek advantage of kernel readahead()
References: 1. http://man7.org/linux/man-pages/man2/posix_fadvise.2.html 2. https://www.oreilly.com/library/view/linux-system-programming/9781449341527/ch04.html
Diffstat (limited to 'src')
-rw-r--r--src/nnn.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/nnn.c b/src/nnn.c
index a267994..4a7f7e3 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3512,6 +3512,8 @@ static int dentfill(char *path, struct entry **dents)
open_max = max_openfds();
}
+ posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
+
dp = readdir(dirp);
if (!dp)
goto exit;