From 7feebdcb8e0f40aefffef7c53a7baaabf49007c6 Mon Sep 17 00:00:00 2001
From: Peter S. Mazinger <ps.m@gmx.net>
Date: Wed, 6 Apr 2011 12:53:11 +0200
Subject: [PATCH 229/396] i386/posix_fadvise64: remove fallback code, uClibc does not do that

Makefile.arch: include it only if ADVANCED_REALTIME is defined.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
---
 libc/sysdeps/linux/i386/Makefile.arch     |    5 ++++-
 libc/sysdeps/linux/i386/posix_fadvise64.S |   20 +-------------------
 2 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/libc/sysdeps/linux/i386/Makefile.arch b/libc/sysdeps/linux/i386/Makefile.arch
index 966f8b5..a3bf32f 100644
--- a/libc/sysdeps/linux/i386/Makefile.arch
+++ b/libc/sysdeps/linux/i386/Makefile.arch
@@ -9,8 +9,11 @@ CSRC := brk.c __syscall_error.c sigaction.c
 
 SSRC := \
 	__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
-	sync_file_range.S syscall.S mmap.S mmap64.S posix_fadvise64.S
+	sync_file_range.S syscall.S mmap.S mmap64.S
 
+ifeq ($(UCLIBC_HAS_ADVANCED_REALTIME),y)
+SSRC += posix_fadvise64.S
+endif
 
 ifneq ($(UCLIBC_HAS_THREADS_NATIVE),y)
 SSRC += vfork.S clone.S
diff --git a/libc/sysdeps/linux/i386/posix_fadvise64.S b/libc/sysdeps/linux/i386/posix_fadvise64.S
index 8a8947d..7b91b5c 100644
--- a/libc/sysdeps/linux/i386/posix_fadvise64.S
+++ b/libc/sysdeps/linux/i386/posix_fadvise64.S
@@ -17,19 +17,9 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
-#define _ERRNO_H	1
-#include <features.h>
-#include <bits/errno.h>
 #include <sys/syscall.h>
 
-#if defined __NR_fadvise64_64 || defined __NR_fadvise64
-
-/* Was named __libc_posix_fadvise64 for some inexplicable reason.
-** google says only uclibc has *__libc*_posix_fadviseXXX,
-** so it cannot be compat with anything.
-**
-** Remove this comment and one at the end after 0.9.31
-*/
+#if (defined __NR_fadvise64_64 || defined __NR_fadvise64) && defined __UCLIBC_HAS_LFS__
 
 .text
 .global posix_fadvise64
@@ -98,12 +88,4 @@ overflow:
 	ret
 
 .size posix_fadvise64,.-posix_fadvise64
-
-/*
-** libc_hidden_def(__libc_posix_fadvise64)
-** #if defined __UCLIBC_HAS_LFS__ && defined __UCLIBC_HAS_ADVANCED_REALTIME__
-** weak_alias(__libc_posix_fadvise64,posix_fadvise64)
-** #endif
-*/
-
 #endif
-- 
1.7.0.4

