diff options
| author | comex <comexk@gmail.com> | 2023-07-01 15:02:25 -0700 |
|---|---|---|
| committer | comex <comexk@gmail.com> | 2023-07-01 17:27:35 -0700 |
| commit | 0e191c271125321589dfdbb09731413550710c9a (patch) | |
| tree | e0d9e826197d2fd66cc9b7fd8d11cc8c7fd6e3ac /src/core/hle/service/sockets/bsd.cpp | |
| parent | 98685d48e3cb9f25f6919f004ec62cadf33afad2 (diff) | |
Updates:
- Address PR feedback.
- Add SecureTransport backend for macOS.
Diffstat (limited to 'src/core/hle/service/sockets/bsd.cpp')
| -rw-r--r-- | src/core/hle/service/sockets/bsd.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 6034cc0b5..e63b0a357 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -443,15 +443,28 @@ void BSD::Close(HLERequestContext& ctx) { } void BSD::DuplicateSocket(HLERequestContext& ctx) { + struct InputParameters { + s32 fd; + u64 reserved; + }; + static_assert(sizeof(InputParameters) == 0x10); + + struct OutputParameters { + s32 ret; + Errno bsd_errno; + }; + static_assert(sizeof(OutputParameters) == 0x8); + IPC::RequestParser rp{ctx}; - const s32 fd = rp.Pop<s32>(); - [[maybe_unused]] const u64 unused = rp.Pop<u64>(); + auto input = rp.PopRaw<InputParameters>(); - Expected<s32, Errno> res = DuplicateSocketImpl(fd); + Expected<s32, Errno> res = DuplicateSocketImpl(input.fd); IPC::ResponseBuilder rb{ctx, 4}; rb.Push(ResultSuccess); - rb.Push(res.value_or(0)); // ret - rb.Push(res ? 0 : static_cast<s32>(res.error())); // bsd errno + rb.PushRaw(OutputParameters{ + .ret = res.value_or(0), + .bsd_errno = res ? Errno::SUCCESS : res.error(), + }); } void BSD::EventFd(HLERequestContext& ctx) { |
