posix_madvise(3) Library Functions Manual posix_madvise(3) posix_madvise - C (libc, -lc) #include int posix_madvise(size_t size; void addr[size], size_t size, int advice); glibc (. feature_test_macros(7)): posix_madvise(): _POSIX_C_SOURCE >= 200112L The posix_madvise() function allows an application to advise the system about its expected patterns of usage of memory in the address range starting at addr and continuing for size bytes. The system is free to use this advice in order to improve the performance of memory accesses (or to ignore the advice altogether), but calling posix_madvise() shall not affect the semantics of access to memory in the specified range. advice : POSIX_MADV_NORMAL - , . . POSIX_MADV_SEQUENTIAL , . , . POSIX_MADV_RANDOM . , . POSIX_MADV_WILLNEED . . POSIX_MADV_DONTNEED . posix_madvise() 0. . EINVAL addr is not a multiple of the system page size or size is negative. EINVAL advice. ENOMEM . POSIX.1 permits an implementation to generate an error if size is 0. On Linux, specifying size as 0 is permitted (as a successful no-op). glibc madvise(2). , glibc 2.6, POSIX_MADV_DONTNEED , madvise(2), MADV_DONTNEED, . POSIX.1-2008. glibc 2.2. POSIX.1-2001. madvise(2), posix_fadvise(2) () Alexey, Azamat Hackimov , kogamatranslator49 , Darima Kogan , Max Is , Yuri Kozlov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () . Linux man-pages 6.18 8 2026 . posix_madvise(3)