Browse Source

posix_fadvise64: fix x86 implementation

Commit 73d59554144f429b1cf0d4d7fa7de42bdf59ad92 completely broke
the x86 implementation of posix_fadvise64. It moved the first
the assembly code retn instruction gets missing depending on the

Technically the file has two implementaions for posix_fadvise64,
one when __NR_fadvise64_64 is available, and second one if only
__NR_fadvise64 is there. Fix the #ifdef's to be proper for that.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Timo Teräs 14 years ago
parent
commit
074930dd7f
1 changed files with 3 additions and 1 deletions
  1. 3 1
      libc/sysdeps/linux/i386/posix_fadvise64.S

+ 3 - 1
libc/sysdeps/linux/i386/posix_fadvise64.S

@@ -22,7 +22,7 @@
 #include <bits/errno.h>
 #include <sys/syscall.h>
 
-#if defined __NR_fadvise64_64
+#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,
@@ -35,6 +35,7 @@
 .global posix_fadvise64
 .type   posix_fadvise64,%function
 posix_fadvise64:
+#if defined __NR_fadvise64_64
 	/* Save regs  */
 	pushl	%ebp
 	pushl	%ebx
@@ -91,6 +92,7 @@ overflow:
 
 	/* Returns 0 on success, else an error code.  */
 	negl	%eax
+#endif
 
 	/* Successful; return the syscall's value.  */
 	ret