bsd: attempt to get past socket()

This commit is contained in:
Frederic Meyer
2018-01-17 22:03:20 +01:00
parent 0b1d15b126
commit 6ff0fd44f5
2 changed files with 23 additions and 1 deletions

View File

@@ -19,9 +19,27 @@ void BSD_U::RegisterClient(Kernel::HLERequestContext& ctx) {
rb.Push<u32>(0);
}
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=%d type=%d protocol=%d", domain, type, protocol);
u32 fd = next_fd++;
IPC::RequestBuilder rb{ctx, 3};
rb.Push<u32>(fd);
rb.Push<u32>(0); // bsd errno (no error)
}
BSD_U::BSD_U() : ServiceFramework("bsd:u") {
static const FunctionInfo functions[] = {
{0, &BSD_U::RegisterClient, "RegisterClient"}
{0, &BSD_U::RegisterClient, "RegisterClient"},
{2, &BSD_U::Socket, "Socket"}
};
RegisterHandlers(functions);
}

View File

@@ -17,6 +17,10 @@ public:
private:
void RegisterClient(Kernel::HLERequestContext& ctx);
void Socket(Kernel::HLERequestContext& ctx);
/// Id to use for the next open file descriptor.
u32 next_fd = 1;
};
} // namespace BSD