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