summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorHendiadyoin1 <leon2002.la@gmail.com>2021-08-26 15:57:59 +0200
committerBrian Gianforcaro <b.gianfo@gmail.com>2021-09-07 21:26:21 +0000
commit93ce8fc985efb9bad73de3c582bb8347d997b1a7 (patch)
tree67848f1a3bebdb69cde404441eb165b10feec46b /Userland
parent5017cc2bd34607e6a5a7c2e22b95893ffbff1232 (diff)
downloadserenity-93ce8fc985efb9bad73de3c582bb8347d997b1a7.zip
UserspaceEmulator: Handle SO_ERROR in getsockopt
This makes GUI applications work again
Diffstat (limited to 'Userland')
-rw-r--r--Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
index 682a823347..dece7199bc 100644
--- a/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
+++ b/Userland/DevTools/UserspaceEmulator/Emulator_syscalls.cpp
@@ -709,7 +709,18 @@ int Emulator::virt$getsockopt(FlatPtr params_addr)
mmu().copy_to_vm((FlatPtr)params.value, &creds, sizeof(creds));
return rc;
}
+ if (params.option == SO_ERROR) {
+ int so_error;
+ socklen_t so_error_len = sizeof(so_error);
+ int rc = getsockopt(params.sockfd, params.level, SO_ERROR, &so_error, &so_error_len);
+ if (rc < 0)
+ return -errno;
+ // FIXME: Check params.value_size
+ mmu().copy_to_vm((FlatPtr)params.value, &so_error, sizeof(so_error));
+ return rc;
+ }
+ dbgln("Not implemented socket param: {}", params.option);
TODO();
}