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