1 /* vi: set sw=4 ts=4: */
3 * posix_fadvise64() for uClibc
4 * http://www.opengroup.org/onlinepubs/009695399/functions/posix_fadvise.html
6 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
8 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
12 #include <sys/syscall.h>
13 #include <bits/wordsize.h>
15 #ifdef __NR_arm_fadvise64_64
16 # define __NR_fadvise64_64 __NR_arm_fadvise64_64
19 #if defined __NR_fadvise64_64 && __WORDSIZE == 32
23 int posix_fadvise64(int fd, off64_t offset, off64_t len, int advice)
25 INTERNAL_SYSCALL_DECL (err);
26 /* ARM has always been funky. */
27 # if defined(__UCLIBC_SYSCALL_ALIGN_64BIT__) || defined(__arm__)
28 int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd, advice,
29 OFF64_HI_LO (offset), OFF64_HI_LO (len));
31 int ret = INTERNAL_SYSCALL (fadvise64_64, err, 6, fd,
32 OFF64_HI_LO (offset), OFF64_HI_LO (len),
35 if (INTERNAL_SYSCALL_ERROR_P (ret, err))
36 return INTERNAL_SYSCALL_ERRNO (ret, err);