linux-user: Add move_mount() syscall
PATCH 1/2 linux-user: Add move_mount() syscall
--- linux-user/syscall.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)
linux-user/syscall.c +27 -0
@@ -9139,6 +9139,33 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,unlock_user (p, arg1,0 );return ret;#endif +#ifdef TARGET_NR_move_mount +case TARGET_NR_move_mount: + { +void *p2, *p4; + +if (!arg2 || !arg4) { +return -TARGET_EFAULT ; + } + + p2 =lock_user_string (arg2); +if (!p2) { +return -TARGET_EFAULT ; + } + + p4 =lock_user_string (arg4); +if (!p4) { +unlock_user (p2, arg2,0 ); +return -TARGET_EFAULT ; + } + ret =get_errno (move_mount (arg1, p2, arg3, p4, arg5)); + +unlock_user (p2, arg2,0 ); +unlock_user (p4, arg4,0 ); + +return ret; + } +#endif #ifdef TARGET_NR_stime/* not on alpha */ case TARGET_NR_stime: {
base-commit: 81072abf1575b11226b3779af76dc71dfa85ee5d
Signature · 1 line
2.40.0
PATCH 2/2 linux-user: Add open_tree() syscall
--- linux-user/syscall.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
linux-user/syscall.c +26 -0
@@ -9166,6 +9166,32 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,return ret; }#endif +#ifdef TARGET_NR_open_tree +case TARGET_NR_open_tree: + { +void *p2; + +if (!arg2) { +return -TARGET_EFAULT ; + } + + p2 =lock_user_string (arg2); +if (!p2) { +return -TARGET_EFAULT ; + } + +int host_flags = arg3 & ~TARGET_O_CLOEXEC ; +if (arg3 &TARGET_O_CLOEXEC ) { + host_flags |=O_CLOEXEC ; + } + + ret =get_errno (open_tree (arg1, p2, host_flags)); + +unlock_user (p2, arg2,0 ); + +return ret; + } +#endif #ifdef TARGET_NR_stime/* not on alpha */ case TARGET_NR_stime: {
Signature · 1 line
2.40.0
Re: [PATCH 2/2] linux-user: Add open_tree() syscall
Le 24/04/2023 à 17:34, Thomas Weißschuh a écrit :
Quoted 32 lines
Signed-off-by Thomas Weißschuh <[email protected]>--- linux-user/syscall.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)linux-user/syscall.c +19
-0@@ -9166,6 +9166,32 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,return ret; }#endif +#ifdef TARGET_NR_open_tree +case TARGET_NR_open_tree: + { +void *p2; + +if (!arg2) { +return -TARGET_EFAULT ; + } + + p2 =lock_user_string (arg2); +if (!p2) { +return -TARGET_EFAULT ; + } + +int host_flags = arg3 & ~TARGET_O_CLOEXEC ; +if (arg3 &TARGET_O_CLOEXEC ) { + host_flags |=O_CLOEXEC ; + } +
linux-user/syscall.c static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, · line 9197
Quoted 10 lines
linux-user/syscall.c +7
-0+ ret =get_errno (open_tree (arg1, p2, host_flags)); + +unlock_user (p2, arg2,0 ); + +return ret; + } +#endif #ifdef TARGET_NR_stime/* not on alpha */ case TARGET_NR_stime: {
Laurent Vivier
AppliedRe: [PATCH 2/2] linux-user: Add open_tree() syscall
In reply to Thomas WeißschuhLe 24/04/2023 à 17:34, Thomas Weißschuh a écrit :
Quoted 32 lines
Signed-off-by Thomas Weißschuh <[email protected]>--- linux-user/syscall.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)linux-user/syscall.c +19
-0@@ -9166,6 +9166,32 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,return ret; }#endif +#ifdef TARGET_NR_open_tree +case TARGET_NR_open_tree: + { +void *p2; + +if (!arg2) { +return -TARGET_EFAULT ; + } + + p2 =lock_user_string (arg2); +if (!p2) { +return -TARGET_EFAULT ; + } + +int host_flags = arg3 & ~TARGET_O_CLOEXEC ; +if (arg3 &TARGET_O_CLOEXEC ) { + host_flags |=O_CLOEXEC ; + } +
linux-user/syscall.c static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1, · line 9197
Quoted 10 lines
linux-user/syscall.c +7
-0+ ret =get_errno (open_tree (arg1, p2, host_flags)); + +unlock_user (p2, arg2,0 ); + +return ret; + } +#endif #ifdef TARGET_NR_stime/* not on alpha */ case TARGET_NR_stime: {
Applied to my linux-user-for-8.1 branch.
(moved the variable declaration to the beginning of the block)
Thanks,
Laurent
Le 24/04/2023 à 17:34, Thomas Weißschuh a écrit :
Quoted 44 lines
Signed-off-by Thomas Weißschuh <[email protected]>--- linux-user/syscall.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)linux-user/syscall.c +27
-0@@ -9139,6 +9139,33 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,unlock_user (p, arg1,0 );return ret;#endif +#ifdef TARGET_NR_move_mount +case TARGET_NR_move_mount: + { +void *p2, *p4; + +if (!arg2 || !arg4) { +return -TARGET_EFAULT ; + } + + p2 =lock_user_string (arg2); +if (!p2) { +return -TARGET_EFAULT ; + } + + p4 =lock_user_string (arg4); +if (!p4) { +unlock_user (p2, arg2,0 ); +return -TARGET_EFAULT ; + } + ret =get_errno (move_mount (arg1, p2, arg3, p4, arg5)); + +unlock_user (p2, arg2,0 ); +unlock_user (p4, arg4,0 ); + +return ret; + } +#endif #ifdef TARGET_NR_stime/* not on alpha */ case TARGET_NR_stime: {
Quoted 1 line
base-commit:
81072abf1575b11226b3779af76dc71dfa85ee5d
Laurent Vivier
AppliedLe 24/04/2023 à 17:34, Thomas Weißschuh a écrit :
Quoted 44 lines
Signed-off-by Thomas Weißschuh <[email protected]>--- linux-user/syscall.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)linux-user/syscall.c +27
-0@@ -9139,6 +9139,33 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,unlock_user (p, arg1,0 );return ret;#endif +#ifdef TARGET_NR_move_mount +case TARGET_NR_move_mount: + { +void *p2, *p4; + +if (!arg2 || !arg4) { +return -TARGET_EFAULT ; + } + + p2 =lock_user_string (arg2); +if (!p2) { +return -TARGET_EFAULT ; + } + + p4 =lock_user_string (arg4); +if (!p4) { +unlock_user (p2, arg2,0 ); +return -TARGET_EFAULT ; + } + ret =get_errno (move_mount (arg1, p2, arg3, p4, arg5)); + +unlock_user (p2, arg2,0 ); +unlock_user (p4, arg4,0 ); + +return ret; + } +#endif #ifdef TARGET_NR_stime/* not on alpha */ case TARGET_NR_stime: {
Quoted 1 line
base-commit:
81072abf1575b11226b3779af76dc71dfa85ee5d
Applied to my linux-user-for-8.1 branch.
Thanks,
Laurent