linux-user: Implement gethostname
Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
This commit is contained in:
parent
f287b2c2d4
commit
3d21d29c32
@ -8867,6 +8867,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef TARGET_NR_gethostname
|
||||||
|
case TARGET_NR_gethostname:
|
||||||
|
{
|
||||||
|
char *name = lock_user(VERIFY_WRITE, arg1, arg2, 0);
|
||||||
|
if (name) {
|
||||||
|
ret = get_errno(gethostname(name, arg2));
|
||||||
|
unlock_user(name, arg1, arg2);
|
||||||
|
} else {
|
||||||
|
ret = -TARGET_EFAULT;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
unimplemented:
|
unimplemented:
|
||||||
|
Loading…
Reference in New Issue
Block a user