summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/sockets/bsd_u.cpp
diff options
context:
space:
mode:
authorflerovium^-^ <binarynoob96@gmail.com>2018-01-18 20:35:03 +0100
committerbunnei <bunneidev@gmail.com>2018-01-18 20:35:03 +0100
commit463356f0a74d103ff1d4e6ef5cbd73b8a8b53135 (patch)
tree7480773cc23bb2b15870319be0b8249ea81a0c0f /src/core/hle/service/sockets/bsd_u.cpp
parentMerge pull request #98 from lioncash/xcode (diff)
downloadyuzu-463356f0a74d103ff1d4e6ef5cbd73b8a8b53135.tar
yuzu-463356f0a74d103ff1d4e6ef5cbd73b8a8b53135.tar.gz
yuzu-463356f0a74d103ff1d4e6ef5cbd73b8a8b53135.tar.bz2
yuzu-463356f0a74d103ff1d4e6ef5cbd73b8a8b53135.tar.lz
yuzu-463356f0a74d103ff1d4e6ef5cbd73b8a8b53135.tar.xz
yuzu-463356f0a74d103ff1d4e6ef5cbd73b8a8b53135.tar.zst
yuzu-463356f0a74d103ff1d4e6ef5cbd73b8a8b53135.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/sockets/bsd_u.cpp67
1 files changed, 67 insertions, 0 deletions
diff --git a/src/core/hle/service/sockets/bsd_u.cpp b/src/core/hle/service/sockets/bsd_u.cpp
new file mode 100644
index 000000000..a819acc96
--- /dev/null
+++ b/src/core/hle/service/sockets/bsd_u.cpp
@@ -0,0 +1,67 @@
+// Copyright 2018 yuzu emulator team
+// Licensed under GPLv2 or any later version
+// Refer to the license.txt file included.
+
+#include "core/hle/ipc_helpers.h"
+#include "core/hle/service/sockets/bsd_u.h"
+
+namespace Service {
+namespace Sockets {
+
+void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) {
+ LOG_WARNING(Service, "(STUBBED) called");
+
+ IPC::RequestBuilder rb{ctx, 3};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u32>(0); // bsd errno
+}
+
+void BSD_U::Socket(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+
+ u32 domain = rp.Pop<u32>();
+ u32 type = rp.Pop<u32>();
+ u32 protocol = rp.Pop<u32>();
+
+ LOG_WARNING(Service, "(STUBBED) called domain=%u type=%u protocol=%u", domain, type, protocol);
+
+ u32 fd = next_fd++;
+
+ IPC::RequestBuilder rb{ctx, 4};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u32>(fd);
+ rb.Push<u32>(0); // bsd errno
+}
+
+void BSD_U::Connect(Kernel::HLERequestContext& ctx) {
+ LOG_WARNING(Service, "(STUBBED) called");
+
+ IPC::RequestBuilder rb{ctx, 4};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u32>(0); // ret
+ rb.Push<u32>(0); // bsd errno
+}
+
+void BSD_U::SendTo(Kernel::HLERequestContext& ctx) {
+ LOG_WARNING(Service, "(STUBBED) called");
+
+ IPC::RequestBuilder rb{ctx, 4};
+
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u32>(0); // ret
+ rb.Push<u32>(0); // bsd errno
+}
+
+BSD_U::BSD_U() : ServiceFramework("bsd:u") {
+ static const FunctionInfo functions[] = {{0, &BSD_U::RegisterClient, "RegisterClient"},
+ {2, &BSD_U::Socket, "Socket"},
+ {11, &BSD_U::SendTo, "SendTo"},
+ {14, &BSD_U::Connect, "Connect"}};
+ RegisterHandlers(functions);
+}
+
+} // namespace Sockets
+} // namespace Service