1 --- linux-user/syscall.c 22 Mar 2007 15:08:55 -0000 1.95
2 +++ linux-user/syscall.c 31 Mar 2007 08:36:00 -0000
3 @@ -2043,6 +2047,7 @@ long do_syscall(void *cpu_env, int num,
5 ret = get_errno(do_fork(cpu_env, SIGCHLD, 0));
7 +#ifdef TARGET_NR_waitpid
8 case TARGET_NR_waitpid:
11 @@ -2051,6 +2056,7 @@ long do_syscall(void *cpu_env, int num,
17 p = lock_user_string(arg1);
18 ret = get_errno(creat(p, arg2));
19 @@ -2179,11 +2185,13 @@ long do_syscall(void *cpu_env, int num,
20 unlock_user(p3, arg3, 0);
23 +#ifdef TARGET_NR_umount
24 case TARGET_NR_umount:
25 p = lock_user_string(arg1);
26 ret = get_errno(umount(p));
27 unlock_user(p, arg1, 0);
33 @@ -2203,6 +2211,7 @@ long do_syscall(void *cpu_env, int num,
35 ret = get_errno(pause());
37 +#ifdef TARGET_NR_utime
40 struct utimbuf tbuf, *host_tbuf;
41 @@ -2221,6 +2230,7 @@ long do_syscall(void *cpu_env, int num,
42 unlock_user(p, arg1, 0);
46 case TARGET_NR_utimes:
48 struct timeval *tvp, tv[2];
49 @@ -2317,9 +2327,10 @@ long do_syscall(void *cpu_env, int num,
53 +#ifdef TARGET_NR_signal
54 case TARGET_NR_signal:
59 p = lock_user_string(arg1);
60 ret = get_errno(acct(path(p)));
61 @@ -2377,6 +2388,7 @@ long do_syscall(void *cpu_env, int num,
62 case TARGET_NR_setsid:
63 ret = get_errno(setsid());
65 +#ifdef TARGET_NR_sigaction
66 case TARGET_NR_sigaction:
68 #if !defined(TARGET_MIPS)
69 @@ -2431,6 +2443,7 @@ long do_syscall(void *cpu_env, int num,
74 case TARGET_NR_rt_sigaction:
76 struct target_sigaction *act;
77 @@ -2472,6 +2485,7 @@ long do_syscall(void *cpu_env, int num,
81 +#ifdef TARGET_NR_sigprocmask
82 case TARGET_NR_sigprocmask:
85 @@ -2508,6 +2522,7 @@ long do_syscall(void *cpu_env, int num,
90 case TARGET_NR_rt_sigprocmask:
93 @@ -2544,6 +2559,7 @@ long do_syscall(void *cpu_env, int num,
97 +#ifdef TARGET_NR_sigpending
98 case TARGET_NR_sigpending:
101 @@ -2555,6 +2571,7 @@ long do_syscall(void *cpu_env, int num,
106 case TARGET_NR_rt_sigpending:
109 @@ -2566,6 +2583,7 @@ long do_syscall(void *cpu_env, int num,
113 +#ifdef TARGET_NR_sigsuspend
114 case TARGET_NR_sigsuspend:
117 @@ -2575,6 +2593,7 @@ long do_syscall(void *cpu_env, int num,
118 ret = get_errno(sigsuspend(&set));
122 case TARGET_NR_rt_sigsuspend:
125 @@ -2616,10 +2635,12 @@ long do_syscall(void *cpu_env, int num,
126 ret = get_errno(sys_rt_sigqueueinfo(arg1, arg2, &uinfo));
129 +#ifdef TARGET_NR_sigreturn
130 case TARGET_NR_sigreturn:
131 /* NOTE: ret is eax, so not transcoding must be done */
132 ret = do_sigreturn(cpu_env);
135 case TARGET_NR_rt_sigreturn:
136 /* NOTE: ret is eax, so not transcoding must be done */
137 ret = do_rt_sigreturn(cpu_env);
138 @@ -2725,17 +2746,24 @@ long do_syscall(void *cpu_env, int num,
139 unlock_user(p, arg1, 0);
142 +#ifdef TARGET_NR_uselib
143 case TARGET_NR_uselib:
146 +#ifdef TARGET_NR_swapon
147 case TARGET_NR_swapon:
148 p = lock_user_string(arg1);
149 ret = get_errno(swapon(p, arg2));
150 unlock_user(p, arg1, 0);
153 case TARGET_NR_reboot:
155 +#ifdef TARGET_NR_readdir
156 case TARGET_NR_readdir:
159 +#ifdef TARGET_NR_mmap
161 #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_M68K)
163 @@ -2760,6 +2788,7 @@ long do_syscall(void *cpu_env, int num,
168 #ifdef TARGET_NR_mmap2
169 case TARGET_NR_mmap2:
170 #if defined(TARGET_SPARC) || defined(TARGET_MIPS)
171 @@ -2779,25 +2808,37 @@ long do_syscall(void *cpu_env, int num,
172 case TARGET_NR_mprotect:
173 ret = get_errno(target_mprotect(arg1, arg2, arg3));
175 +#ifdef TARGET_NR_mremap
176 case TARGET_NR_mremap:
177 ret = get_errno(target_mremap(arg1, arg2, arg3, arg4, arg5));
180 /* ??? msync/mlock/munlock are broken for softmmu. */
181 +#ifdef TARGET_NR_msync
182 case TARGET_NR_msync:
183 ret = get_errno(msync(g2h(arg1), arg2, arg3));
186 +#ifdef TARGET_NR_mlock
187 case TARGET_NR_mlock:
188 ret = get_errno(mlock(g2h(arg1), arg2));
191 +#ifdef TARGET_NR_munlock
192 case TARGET_NR_munlock:
193 ret = get_errno(munlock(g2h(arg1), arg2));
196 +#ifdef TARGET_NR_mlockall
197 case TARGET_NR_mlockall:
198 ret = get_errno(mlockall(arg1));
201 +#ifdef TARGET_NR_munlockall
202 case TARGET_NR_munlockall:
203 ret = get_errno(munlockall());
206 case TARGET_NR_truncate:
207 p = lock_user_string(arg1);
208 ret = get_errno(truncate(p, arg2));
209 @@ -2875,10 +2916,11 @@ long do_syscall(void *cpu_env, int num,
210 case TARGET_NR_ioperm:
213 +#ifdef TARGET_NR_socketcall
214 case TARGET_NR_socketcall:
215 ret = do_socketcall(arg1, arg2);
219 #ifdef TARGET_NR_accept
220 case TARGET_NR_accept:
221 ret = do_accept(arg1, arg2, arg3);
222 @@ -3087,11 +3129,13 @@ long do_syscall(void *cpu_env, int num,
226 +#ifdef TARGET_NR_swapoff
227 case TARGET_NR_swapoff:
228 p = lock_user_string(arg1);
229 ret = get_errno(swapoff(p));
230 unlock_user(p, arg1, 0);
233 case TARGET_NR_sysinfo:
235 struct target_sysinfo *target_value;
236 @@ -3119,9 +3163,11 @@ long do_syscall(void *cpu_env, int num,
240 +#ifdef TARGET_NR_ipc
242 ret = do_ipc(arg1, arg2, arg3, arg4, arg5, arg6);
245 case TARGET_NR_fsync:
246 ret = get_errno(fsync(arg1));
248 @@ -3170,10 +3216,14 @@ long do_syscall(void *cpu_env, int num,
250 case TARGET_NR_adjtimex:
252 +#ifdef TARGET_NR_create_module
253 case TARGET_NR_create_module:
255 case TARGET_NR_init_module:
256 case TARGET_NR_delete_module:
257 +#ifdef TARGET_NR_get_kernel_syms
258 case TARGET_NR_get_kernel_syms:
261 case TARGET_NR_quotactl:
263 @@ -3185,13 +3235,17 @@ long do_syscall(void *cpu_env, int num,
265 case TARGET_NR_bdflush:
267 +#ifdef TARGET_NR_sysfs
268 case TARGET_NR_sysfs:
271 case TARGET_NR_personality:
272 ret = get_errno(personality(arg1));
274 +#ifdef TARGET_NR_afs_syscall
275 case TARGET_NR_afs_syscall:
278 case TARGET_NR__llseek:
280 #if defined (__x86_64__)
281 @@ -3305,9 +3359,12 @@ long do_syscall(void *cpu_env, int num,
284 #endif /* TARGET_NR_getdents64 */
285 +#ifdef TARGET_NR__newselect
286 case TARGET_NR__newselect:
287 ret = do_select(arg1, arg2, arg3, arg4, arg5);
290 +#ifdef TARGET_NR_poll
293 struct target_pollfd *target_pfd;
294 @@ -3333,6 +3390,7 @@ long do_syscall(void *cpu_env, int num,
295 unlock_user(target_pfd, arg1, ret);
299 case TARGET_NR_flock:
300 /* NOTE: the flock constant seems to be the same for every
302 @@ -3434,10 +3492,14 @@ long do_syscall(void *cpu_env, int num,
306 +#ifdef TARGET_NR_query_module
307 case TARGET_NR_query_module:
310 +#ifdef TARGET_NR_nfsservctl
311 case TARGET_NR_nfsservctl:
314 case TARGET_NR_prctl:
317 @@ -3970,8 +4032,10 @@ long do_syscall(void *cpu_env, int num,
318 case TARGET_NR_gettid:
319 ret = get_errno(gettid());
321 +#ifdef TARGET_NR_readahead
322 case TARGET_NR_readahead:
325 #ifdef TARGET_NR_setxattr
326 case TARGET_NR_setxattr:
327 case TARGET_NR_lsetxattr: