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