use posix_fadvise instead of posix_fadvise64

This commit is contained in:
slaren 2023-12-20 21:53:52 +01:00
parent 24cc321931
commit f70f94dfb8

View file

@ -841,8 +841,8 @@ struct llama_mmap {
// prefetch/readahead impairs performance on NUMA systems // prefetch/readahead impairs performance on NUMA systems
if (numa) { prefetch = 0; } if (numa) { prefetch = 0; }
#ifdef __linux__ #ifdef __linux__
if (posix_fadvise64(fd, 0, file->size, POSIX_FADV_SEQUENTIAL)) { if (posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL)) {
fprintf(stderr, "warning: fadvise(.., POSIX_FADV_SEQUENTIAL) failed: %s\n", fprintf(stderr, "warning: posix_fadvise(.., POSIX_FADV_SEQUENTIAL) failed: %s\n",
strerror(errno)); strerror(errno));
} }
if (prefetch) { flags |= MAP_POPULATE; } if (prefetch) { flags |= MAP_POPULATE; }