summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2021-09-24 14:20:32 +0200
committerMorph <39850852+Morph1984@users.noreply.github.com>2021-09-24 22:46:52 +0200
commit06f22c3d284114f5df2c66260e20aaae70db3cf9 (patch)
treeb0fd83639672f157f1b3d9190f1c95aafb04f967
parentMerge pull request #7084 from ameerj/clang-12 (diff)
downloadyuzu-06f22c3d284114f5df2c66260e20aaae70db3cf9.tar
yuzu-06f22c3d284114f5df2c66260e20aaae70db3cf9.tar.gz
yuzu-06f22c3d284114f5df2c66260e20aaae70db3cf9.tar.bz2
yuzu-06f22c3d284114f5df2c66260e20aaae70db3cf9.tar.lz
yuzu-06f22c3d284114f5df2c66260e20aaae70db3cf9.tar.xz
yuzu-06f22c3d284114f5df2c66260e20aaae70db3cf9.tar.zst
yuzu-06f22c3d284114f5df2c66260e20aaae70db3cf9.zip
-rw-r--r--src/core/hle/service/sockets/bsd.cpp15
-rw-r--r--src/core/hle/service/sockets/bsd.h1
2 files changed, 15 insertions, 1 deletions
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp
index 7d85ecb6a..95a70dfd3 100644
--- a/src/core/hle/service/sockets/bsd.cpp
+++ b/src/core/hle/service/sockets/bsd.cpp
@@ -415,6 +415,19 @@ void BSD::Write(Kernel::HLERequestContext& ctx) {
});
}
+void BSD::Read(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+ const s32 fd = rp.Pop<s32>();
+
+ LOG_DEBUG(Service, "called. fd={} len={}", fd, ctx.GetWriteBufferSize());
+
+ ExecuteWork(ctx, RecvWork{
+ .fd = fd,
+ .flags = 0,
+ .message = std::vector<u8>(ctx.GetWriteBufferSize()),
+ });
+}
+
void BSD::Close(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const s32 fd = rp.Pop<s32>();
@@ -855,7 +868,7 @@ BSD::BSD(Core::System& system_, const char* name) : ServiceFramework{system_, na
{22, &BSD::Shutdown, "Shutdown"},
{23, nullptr, "ShutdownAllSockets"},
{24, &BSD::Write, "Write"},
- {25, nullptr, "Read"},
+ {25, &BSD::Read, "Read"},
{26, &BSD::Close, "Close"},
{27, nullptr, "DuplicateSocket"},
{28, nullptr, "GetResourceStatistics"},
diff --git a/src/core/hle/service/sockets/bsd.h b/src/core/hle/service/sockets/bsd.h
index 1d2df9c61..d68beef5c 100644
--- a/src/core/hle/service/sockets/bsd.h
+++ b/src/core/hle/service/sockets/bsd.h
@@ -135,6 +135,7 @@ private:
void Send(Kernel::HLERequestContext& ctx);
void SendTo(Kernel::HLERequestContext& ctx);
void Write(Kernel::HLERequestContext& ctx);
+ void Read(Kernel::HLERequestContext& ctx);
void Close(Kernel::HLERequestContext& ctx);
void EventFd(Kernel::HLERequestContext& ctx);