diff --git a/qemu/linux-user/syscall.c b/qemu/linux-user/syscall.c index 5ff364d..64cff88 100644 --- a/qemu/linux-user/syscall.c +++ b/qemu/linux-user/syscall.c @@ -2043,6 +2043,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, case TARGET_NR_fork: ret = get_errno(do_fork(cpu_env, SIGCHLD, 0)); break; +#ifdef TARGET_NR_waitpid case TARGET_NR_waitpid: { int status; @@ -2051,6 +2052,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, tput32(arg2, status); } break; +#endif case TARGET_NR_creat: p = lock_user_string(arg1); ret = get_errno(creat(p, arg2)); @@ -2152,14 +2154,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, ret = get_errno(chmod(p, arg2)); unlock_user(p, arg1, 0); break; -#ifdef TARGET_NR_break - case TARGET_NR_break: - goto unimplemented; -#endif -#ifdef TARGET_NR_oldstat - case TARGET_NR_oldstat: - goto unimplemented; -#endif case TARGET_NR_lseek: ret = get_errno(lseek(arg1, arg2, arg3)); break; @@ -2191,15 +2185,9 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, ret = get_errno(stime(&host_time)); } break; - case TARGET_NR_ptrace: - goto unimplemented; case TARGET_NR_alarm: ret = alarm(arg1); break; -#ifdef TARGET_NR_oldfstat - case TARGET_NR_oldfstat: - goto unimplemented; -#endif case TARGET_NR_pause: ret = get_errno(pause()); break; @@ -2237,14 +2225,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, unlock_user(p, arg1, 0); } break; -#ifdef TARGET_NR_stty - case TARGET_NR_stty: - goto unimplemented; -#endif -#ifdef TARGET_NR_gtty - case TARGET_NR_gtty: - goto unimplemented; -#endif case TARGET_NR_access: p = lock_user_string(arg1); ret = get_errno(access(p, arg2)); @@ -2253,10 +2233,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, case TARGET_NR_nice: ret = get_errno(nice(arg1)); break; -#ifdef TARGET_NR_ftime - case TARGET_NR_ftime: - goto unimplemented; -#endif case TARGET_NR_sync: sync(); ret = 0; @@ -2313,13 +2289,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, ret = host_to_target_clock_t(ret); } break; -#ifdef TARGET_NR_prof - case TARGET_NR_prof: - goto unimplemented; -#endif - case TARGET_NR_signal: - goto unimplemented; - case TARGET_NR_acct: p = lock_user_string(arg1); ret = get_errno(acct(path(p))); @@ -2330,31 +2299,15 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, ret = get_errno(umount2(p, arg2)); unlock_user(p, arg1, 0); break; -#ifdef TARGET_NR_lock - case TARGET_NR_lock: - goto unimplemented; -#endif case TARGET_NR_ioctl: ret = do_ioctl(arg1, arg2, arg3); break; case TARGET_NR_fcntl: ret = get_errno(do_fcntl(arg1, arg2, arg3)); break; -#ifdef TARGET_NR_mpx - case TARGET_NR_mpx: - goto unimplemented; -#endif case TARGET_NR_setpgid: ret = get_errno(setpgid(arg1, arg2)); break; -#ifdef TARGET_NR_ulimit - case TARGET_NR_ulimit: - goto unimplemented; -#endif -#ifdef TARGET_NR_oldolduname - case TARGET_NR_oldolduname: - goto unimplemented; -#endif case TARGET_NR_umask: ret = get_errno(umask(arg1)); break; @@ -2363,8 +2316,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, ret = get_errno(chroot(p)); unlock_user(p, arg1, 0); break; - case TARGET_NR_ustat: - goto unimplemented; case TARGET_NR_dup2: ret = get_errno(dup2(arg1, arg2)); break; @@ -2451,6 +2402,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, unlock_user_struct(oact, arg3, 1); } break; +#ifdef TARGET_NR_sgetmask case TARGET_NR_sgetmask: { sigset_t cur_set; @@ -2460,6 +2412,8 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, ret = target_set; } break; +#endif +#ifdef TARGET_NR_ssetmask case TARGET_NR_ssetmask: { sigset_t set, oset, cur_set; @@ -2472,6 +2426,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, ret = target_set; } break; +#endif case TARGET_NR_sigprocmask: { int how = arg1; @@ -2711,10 +2666,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, unlock_user(p, arg1, 0); } break; -#ifdef TARGET_NR_oldlstat - case TARGET_NR_oldlstat: - goto unimplemented; -#endif case TARGET_NR_readlink: { void *p2; @@ -2725,17 +2676,11 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, unlock_user(p, arg1, 0); } break; - case TARGET_NR_uselib: - goto unimplemented; case TARGET_NR_swapon: p = lock_user_string(arg1); ret = get_errno(swapon(p, arg2)); unlock_user(p, arg1, 0); break; - case TARGET_NR_reboot: - goto unimplemented; - case TARGET_NR_readdir: - goto unimplemented; case TARGET_NR_mmap: #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_M68K) { @@ -2815,10 +2760,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, case TARGET_NR_setpriority: ret = get_errno(setpriority(arg1, arg2, arg3)); break; -#ifdef TARGET_NR_profil - case TARGET_NR_profil: - goto unimplemented; -#endif case TARGET_NR_statfs: p = lock_user_string(arg1); ret = get_errno(statfs(path(p), &stfs)); @@ -2844,7 +2785,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, case TARGET_NR_fstatfs: ret = get_errno(fstatfs(arg1, &stfs)); goto convert_statfs; -#ifdef TARGET_NR_statfs64 case TARGET_NR_statfs64: p = lock_user_string(arg1); ret = get_errno(statfs(path(p), &stfs)); @@ -2870,11 +2810,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, case TARGET_NR_fstatfs64: ret = get_errno(fstatfs(arg1, &stfs)); goto convert_statfs64; -#endif -#ifdef TARGET_NR_ioperm - case TARGET_NR_ioperm: - goto unimplemented; -#endif case TARGET_NR_socketcall: ret = do_socketcall(arg1, arg2); break; @@ -3047,21 +2982,9 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, } } break; -#ifdef TARGET_NR_olduname - case TARGET_NR_olduname: - goto unimplemented; -#endif -#ifdef TARGET_NR_iopl - case TARGET_NR_iopl: - goto unimplemented; -#endif case TARGET_NR_vhangup: ret = get_errno(vhangup()); break; -#ifdef TARGET_NR_idle - case TARGET_NR_idle: - goto unimplemented; -#endif #ifdef TARGET_NR_syscall case TARGET_NR_syscall: ret = do_syscall(cpu_env,arg1 & 0xffff,arg2,arg3,arg4,arg5,arg6,0); @@ -3162,36 +3085,19 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, case TARGET_NR_modify_ldt: ret = get_errno(do_modify_ldt(cpu_env, arg1, arg2, arg3)); break; - case TARGET_NR_vm86old: - goto unimplemented; case TARGET_NR_vm86: ret = do_vm86(cpu_env, arg1, arg2); break; #endif - case TARGET_NR_adjtimex: - goto unimplemented; - case TARGET_NR_create_module: - case TARGET_NR_init_module: - case TARGET_NR_delete_module: - case TARGET_NR_get_kernel_syms: - goto unimplemented; - case TARGET_NR_quotactl: - goto unimplemented; case TARGET_NR_getpgid: ret = get_errno(getpgid(arg1)); break; case TARGET_NR_fchdir: ret = get_errno(fchdir(arg1)); break; - case TARGET_NR_bdflush: - goto unimplemented; - case TARGET_NR_sysfs: - goto unimplemented; case TARGET_NR_personality: ret = get_errno(personality(arg1)); break; - case TARGET_NR_afs_syscall: - goto unimplemented; case TARGET_NR__llseek: { #if defined (__x86_64__) @@ -3278,7 +3184,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, } #endif break; -#ifdef TARGET_NR_getdents64 case TARGET_NR_getdents64: { struct dirent64 *dirp; @@ -3304,7 +3209,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, unlock_user(dirp, arg2, ret); } break; -#endif /* TARGET_NR_getdents64 */ case TARGET_NR__newselect: ret = do_select(arg1, arg2, arg3, arg4, arg5); break; @@ -3434,10 +3338,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, } } break; - case TARGET_NR_query_module: - goto unimplemented; - case TARGET_NR_nfsservctl: - goto unimplemented; case TARGET_NR_prctl: switch (arg1) { @@ -3454,40 +3354,22 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, break; } break; -#ifdef TARGET_NR_pread - case TARGET_NR_pread: + case TARGET_NR_pread64: page_unprotect_range(arg2, arg3); p = lock_user(arg2, arg3, 0); ret = get_errno(pread(arg1, p, arg3, arg4)); unlock_user(p, arg2, ret); break; - case TARGET_NR_pwrite: + case TARGET_NR_pwrite64: p = lock_user(arg2, arg3, 1); ret = get_errno(pwrite(arg1, p, arg3, arg4)); unlock_user(p, arg2, 0); break; -#endif case TARGET_NR_getcwd: p = lock_user(arg1, arg2, 0); ret = get_errno(sys_getcwd1(p, arg2)); unlock_user(p, arg1, ret); break; - case TARGET_NR_capget: - goto unimplemented; - case TARGET_NR_capset: - goto unimplemented; - case TARGET_NR_sigaltstack: - goto unimplemented; - case TARGET_NR_sendfile: - goto unimplemented; -#ifdef TARGET_NR_getpmsg - case TARGET_NR_getpmsg: - goto unimplemented; -#endif -#ifdef TARGET_NR_putpmsg - case TARGET_NR_putpmsg: - goto unimplemented; -#endif #ifdef TARGET_NR_vfork case TARGET_NR_vfork: ret = get_errno(do_fork(cpu_env, CLONE_VFORK | CLONE_VM | SIGCHLD, 0)); @@ -3520,21 +3402,16 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, ret = target_ftruncate64(cpu_env, arg1, arg2, arg3, arg4); break; #endif -#ifdef TARGET_NR_stat64 case TARGET_NR_stat64: p = lock_user_string(arg1); ret = get_errno(stat(path(p), &st)); unlock_user(p, arg1, 0); goto do_stat64; -#endif -#ifdef TARGET_NR_lstat64 case TARGET_NR_lstat64: p = lock_user_string(arg1); ret = get_errno(lstat(path(p), &st)); unlock_user(p, arg1, 0); goto do_stat64; -#endif -#ifdef TARGET_NR_fstat64 case TARGET_NR_fstat64: { ret = get_errno(fstat(arg1, &st)); @@ -3593,7 +3470,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, } } break; -#endif #ifdef USE_UID16 case TARGET_NR_lchown: p = lock_user_string(arg1); @@ -3853,14 +3729,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, ret = get_errno(setfsgid(arg1)); break; #endif - - case TARGET_NR_pivot_root: - goto unimplemented; -#ifdef TARGET_NR_mincore - case TARGET_NR_mincore: - goto unimplemented; -#endif -#ifdef TARGET_NR_madvise case TARGET_NR_madvise: /* A straight passthrough may not be safe because qemu sometimes turns private flie-backed mappings into anonymous mappings. @@ -3868,7 +3736,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, This is a hint, so ignoring and returning success is ok. */ ret = get_errno(0); break; -#endif #if TARGET_LONG_BITS == 32 case TARGET_NR_fcntl64: { @@ -3954,10 +3821,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, ret = 0; break; #endif -#ifdef TARGET_NR_security - case TARGET_NR_security: - goto unimplemented; -#endif #ifdef TARGET_NR_getpagesize case TARGET_NR_getpagesize: ret = TARGET_PAGE_SIZE; @@ -3966,9 +3829,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, case TARGET_NR_gettid: ret = get_errno(gettid()); break; - case TARGET_NR_readahead: - goto unimplemented; -#ifdef TARGET_NR_setxattr case TARGET_NR_setxattr: case TARGET_NR_lsetxattr: case TARGET_NR_fsetxattr: @@ -3982,7 +3842,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, case TARGET_NR_lremovexattr: case TARGET_NR_fremovexattr: goto unimplemented_nowarn; -#endif #ifdef TARGET_NR_set_thread_area case TARGET_NR_set_thread_area: #ifdef TARGET_MIPS @@ -4002,7 +3861,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, goto unimplemented_nowarn; #endif -#ifdef TARGET_NR_clock_gettime case TARGET_NR_clock_gettime: { struct timespec ts; @@ -4012,8 +3870,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, } break; } -#endif -#ifdef TARGET_NR_clock_getres case TARGET_NR_clock_getres: { struct timespec ts; @@ -4023,7 +3879,6 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, } break; } -#endif #if defined(TARGET_NR_set_tid_address) && defined(__NR_set_tid_address) case TARGET_NR_set_tid_address: @@ -4034,9 +3889,7 @@ long do_syscall(void *cpu_env, int num, long arg1, long arg2, long arg3, default: unimplemented: gemu_log("qemu: Unsupported syscall: %d\n", num); -#if defined(TARGET_NR_setxattr) || defined(TARGET_NR_get_thread_area) || defined(TARGET_NR_getdomainname) unimplemented_nowarn: -#endif ret = -ENOSYS; break; }