summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/posix_fadvise.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-12-01 07:41:02 +0000
committerMike Frysinger <vapier@gentoo.org>2005-12-01 07:41:02 +0000
commitf027f2b507d7705a5585e657aa9b0142140d260f (patch)
tree796f5ab93a3fd0b844500eabd6f0ef2d83291746 /libc/sysdeps/linux/common/posix_fadvise.c
parent9e25f3a5c5892d3a9a792d9c95dc32b7561c1895 (diff)
touchup how we declare the posix_fadvise functions and fix the case where posix_fadvise kernel call exists but not posix_fadvise64
Diffstat (limited to 'libc/sysdeps/linux/common/posix_fadvise.c')
-rw-r--r--libc/sysdeps/linux/common/posix_fadvise.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/libc/sysdeps/linux/common/posix_fadvise.c b/libc/sysdeps/linux/common/posix_fadvise.c
index b37f28861..52fc35700 100644
--- a/libc/sysdeps/linux/common/posix_fadvise.c
+++ b/libc/sysdeps/linux/common/posix_fadvise.c
@@ -8,21 +8,20 @@
* GNU Library General Public License (LGPL) version 2 or later.
*/
+/* need to hide the posix_fadvise64 prototype or the weak_alias()
+ * will fail when __NR_fadvise64_64 doesnt exist */
+#define posix_fadvise64 __hide_posix_fadvise64
#include "syscalls.h"
#include <fcntl.h>
+#undef posix_fadvise64
#ifdef __NR_fadvise64
-#define __NR___syscall_fadvise64 __NR_fadvise64
-_syscall4(int, __syscall_fadvise64, int, fd, off_t, offset,
+#define __NR_posix_fadvise __NR_fadvise64
+_syscall4(int, posix_fadvise, int, fd, off_t, offset,
off_t, len, int, advice);
-int __libc_posix_fadvise(int fd, off_t offset, off_t len, int advice)
-{
- return (__syscall_fadvise64(fd, offset, len, advice));
-}
-weak_alias(__libc_posix_fadvise, posix_fadvise);
#if defined __UCLIBC_HAS_LFS__ && !defined __NR_fadvise64_64
-weak_alias(__libc_posix_fadvise, posix_fadvise64);
+weak_alias(posix_fadvise, posix_fadvise64);
#endif
#else