提交 fb5590f7 编写于 作者: P Peter Maydell 提交者: Riku Voipio

linux-user: Implement *listxattr syscalls

Implement listxattr, flistxattr and llistxattr syscalls.
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Signed-off-by: NRiku Voipio <riku.voipio@linaro.org>
上级 30297b55
......@@ -7798,9 +7798,43 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
#ifdef TARGET_NR_setxattr
case TARGET_NR_listxattr:
case TARGET_NR_llistxattr:
{
void *p, *b = 0;
if (arg2) {
b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
if (!b) {
ret = -TARGET_EFAULT;
break;
}
}
p = lock_user_string(arg1);
if (p) {
if (num == TARGET_NR_listxattr) {
ret = get_errno(listxattr(p, b, arg3));
} else {
ret = get_errno(llistxattr(p, b, arg3));
}
} else {
ret = -TARGET_EFAULT;
}
unlock_user(p, arg1, 0);
unlock_user(b, arg2, arg3);
break;
}
case TARGET_NR_flistxattr:
ret = -TARGET_EOPNOTSUPP;
{
void *b = 0;
if (arg2) {
b = lock_user(VERIFY_WRITE, arg2, arg3, 0);
if (!b) {
ret = -TARGET_EFAULT;
break;
}
}
ret = get_errno(flistxattr(arg1, b, arg3));
unlock_user(b, arg2, arg3);
break;
}
case TARGET_NR_setxattr:
case TARGET_NR_lsetxattr:
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册