Message ID | 20180925205129.25261-5-laurent@vivier.eu |
---|---|
State | New |
Headers | show |
Series | [PULL,v2,1/5] linux-user: move TargetFdTrans functions to their own file | expand |
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 58fb967499..019af632df 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -6772,6 +6772,9 @@ static abi_long do_syscall1(void *cpu_env, int num, abi_long arg1, } return ret; case TARGET_NR_write: + if (arg2 == 0 && arg3 == 0) { + return get_errno(safe_write(arg1, 0, 0)); + } if (!(p = lock_user(VERIFY_READ, arg2, arg3, 1))) return -TARGET_EFAULT; if (fd_trans_target_to_host_data(arg1)) {