1b8a62b91Sopenharmony_ciFrom: Dan Gohman <dev@sunfishcode.online> 2b8a62b91Sopenharmony_ciSubject: [PATCH] Translate errno codes from host to target for `SO_ERROR`. 3b8a62b91Sopenharmony_ci 4b8a62b91Sopenharmony_ciThis issue is reported upstream [here]. 5b8a62b91Sopenharmony_ci 6b8a62b91Sopenharmony_ci[here]: https://gitlab.com/qemu-project/qemu/-/issues/872 7b8a62b91Sopenharmony_ci 8b8a62b91Sopenharmony_ci--- 9b8a62b91Sopenharmony_ci linux-user/syscall.c | 3 +++ 10b8a62b91Sopenharmony_ci 1 file changed, 3 insertions(+) 11b8a62b91Sopenharmony_ci 12b8a62b91Sopenharmony_cidiff --git a/linux-user/syscall.c b/linux-user/syscall.c 13b8a62b91Sopenharmony_ciindex b9b18a7eaf..a8eae3c4ac 100644 14b8a62b91Sopenharmony_ci--- a/linux-user/syscall.c 15b8a62b91Sopenharmony_ci+++ b/linux-user/syscall.c 16b8a62b91Sopenharmony_ci@@ -2767,6 +2767,9 @@ get_timeout: 17b8a62b91Sopenharmony_ci if (optname == SO_TYPE) { 18b8a62b91Sopenharmony_ci val = host_to_target_sock_type(val); 19b8a62b91Sopenharmony_ci } 20b8a62b91Sopenharmony_ci+ if (level == SOL_SOCKET && optname == SO_ERROR) { 21b8a62b91Sopenharmony_ci+ val = host_to_target_errno(val); 22b8a62b91Sopenharmony_ci+ } 23b8a62b91Sopenharmony_ci if (len > lv) 24b8a62b91Sopenharmony_ci len = lv; 25b8a62b91Sopenharmony_ci if (len == 4) { 26b8a62b91Sopenharmony_ci-- 27b8a62b91Sopenharmony_ci2.32.0 28b8a62b91Sopenharmony_ci 29