1 #include <fcntl.h>
2 #include <unsupported_api.h>
3
4 #include "syscall.h"
5
posix_fadvise(int fd,off_t base,off_t len,int advice)6 int posix_fadvise(int fd, off_t base, off_t len, int advice)
7 {
8 unsupported_api(__FUNCTION__);
9 #if defined(SYSCALL_FADVISE_6_ARG)
10 /* Some archs, at least arm and powerpc, have the syscall
11 * arguments reordered to avoid needing 7 argument registers
12 * due to 64-bit argument alignment. */
13 return -__syscall(SYS_fadvise, fd, advice,
14 __SYSCALL_LL_E(base), __SYSCALL_LL_E(len));
15 #else
16 return -__syscall(SYS_fadvise, fd, __SYSCALL_LL_O(base),
17 __SYSCALL_LL_E(len), advice);
18 #endif
19 }
20
21 weak_alias(posix_fadvise, posix_fadvise64);
22