summaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/0001-posix_fadvise64-fix-x86-implementation.patch
blob: 382cc94abad72f0a979e13ed77aba17f2761ecb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
From d4db9d07a970e27e3042d09892fbaeca5f40c1a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timo=20Ter=C3=A4s?= <timo.teras@iki.fi>
Date: Wed, 20 Apr 2011 13:45:36 +0300
Subject: [PATCH] posix_fadvise64: fix x86 implementation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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>
---
 libc/sysdeps/linux/i386/posix_fadvise64.S |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libc/sysdeps/linux/i386/posix_fadvise64.S b/libc/sysdeps/linux/i386/posix_fadvise64.S
index b4aeff1..8a8947d 100644
--- a/libc/sysdeps/linux/i386/posix_fadvise64.S
+++ b/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
-- 
1.7.1