summaryrefslogtreecommitdiffstats
path: root/meta/packages/qemu/files/31_syscalls.patch
blob: e7a1b338f36797f283651035232fd8d0bd14b08f (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
54
55
56
57
58
59
60
61
62
#DPATCHLEVEL=0
---
# Makefile.target      |    2 +-
# linux-user/syscall.c |   11 ++++++++---
# 2 files changed, 9 insertions(+), 4 deletions(-)
#
Index: linux-user/syscall.c
===================================================================
--- linux-user/syscall.c.orig	2007-06-13 11:51:52.000000000 +0100
+++ linux-user/syscall.c	2007-06-13 11:52:18.000000000 +0100
@@ -180,6 +180,7 @@ extern int getresuid(uid_t *, uid_t *, u
 extern int setresgid(gid_t, gid_t, gid_t);
 extern int getresgid(gid_t *, gid_t *, gid_t *);
 extern int setgroups(int, gid_t *);
+extern int uselib(const char*);
 
 /*
  * This list is the union of errno values overidden in asm-<arch>/errno.h
@@ -3215,7 +3216,8 @@ long do_syscall(void *cpu_env, int num, 
         break;
 #ifdef TARGET_NR_uselib
     case TARGET_NR_uselib:
-        goto unimplemented;
+        ret = get_errno(uselib(path((const char*)arg1)));
+        break;
 #endif
 #ifdef TARGET_NR_swapon
     case TARGET_NR_swapon:
@@ -4405,7 +4407,9 @@ long do_syscall(void *cpu_env, int num, 
         goto unimplemented;
 #ifdef TARGET_NR_mincore
     case TARGET_NR_mincore:
-        goto unimplemented;
+        page_unprotect_range((void*)arg3, ((size_t)arg2 + TARGET_PAGE_SIZE - 1) / TARGET_PAGE_SIZE);
+        ret = get_errno(mincore((void*)arg1, (size_t)arg2, (unsigned char*)arg3));
+        break;
 #endif
 #ifdef TARGET_NR_madvise
     case TARGET_NR_madvise:
@@ -4539,7 +4543,8 @@ long do_syscall(void *cpu_env, int num, 
         break;
 #ifdef TARGET_NR_readahead
     case TARGET_NR_readahead:
-        goto unimplemented;
+        ret = get_errno(readahead((int)arg1, (off64_t)arg2, (size_t)arg3));
+        break;
 #endif
 #ifdef TARGET_NR_setxattr
     case TARGET_NR_setxattr:
Index: Makefile.target
===================================================================
--- Makefile.target.orig	2007-06-13 11:51:52.000000000 +0100
+++ Makefile.target	2007-06-13 11:51:54.000000000 +0100
@@ -215,7 +215,7 @@ OP_LDFLAGS+=$(OS_LDFLAGS) $(ARCH_LDFLAGS
 #########################################################
 
 CPPFLAGS+=-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-LIBS+=-lm
+LIBS+=-lm -lrt
 ifndef CONFIG_USER_ONLY
 LIBS+=-lz
 endif