aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain/uClibc/uClibc-0.9.32.1-Fix-__libc_epoll_pwait-compile-failure-on-x86.patch
blob: 8cda4f902c4fab61a595d2645f608e46cf0c96d0 (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
From 8245f3b4638fdff2011c2657af1bb211def704bc Mon Sep 17 00:00:00 2001
From: Phil Blundell <pb@pbcl.net>
Date: Sat, 11 Jun 2011 01:10:46 -0400
Subject: [PATCH] Fix __libc_epoll_pwait compile failure on x86

This prevents "memory input 7 is not directly addressable" errors.

| libc/sysdeps/linux/common/epoll.c: In function '__libc_epoll_pwait':
| libc/sysdeps/linux/common/epoll.c:71:80: error: memory input 7 is not directly addressable
| libc/sysdeps/linux/common/epoll.c:75:86: error: memory input 7 is not directly addressable
| make: *** [libc/sysdeps/linux/common/epoll.o] Error 1
| make: *** Waiting for unfinished jobs....

Signed-off-by: Phil Blundell <pb@pbcl.net>
Signed-off-by: Jason Woodward <jason.woodward@timesys.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 libc/sysdeps/linux/common/epoll.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libc/sysdeps/linux/common/epoll.c b/libc/sysdeps/linux/common/epoll.c
index 85b0cfd..ab3e73b 100644
--- a/libc/sysdeps/linux/common/epoll.c
+++ b/libc/sysdeps/linux/common/epoll.c
@@ -67,12 +67,13 @@ extern __typeof(epoll_pwait) __libc_epoll_pwait;
 int __libc_epoll_pwait(int epfd, struct epoll_event *events, int maxevents,
 						int timeout, const sigset_t *set)
 {
+    int nsig = _NSIG / 8;
 	if (SINGLE_THREAD_P)
-		return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, _NSIG / 8);
+		return INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig);
 # ifdef __UCLIBC_HAS_THREADS_NATIVE__
 	else {
 		int oldtype = LIBC_CANCEL_ASYNC ();
-		int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, _NSIG / 8);
+		int result = INLINE_SYSCALL(epoll_pwait, 6, epfd, events, maxevents, timeout, set, nsig);
 		LIBC_CANCEL_RESET (oldtype);
 		return result;
 	}
-- 
1.7.5.4