mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 12:34:37 +00:00
posix_getsockname try
This commit is contained in:
parent
0dc1a4a7a1
commit
ce33e32ede
@ -30,6 +30,8 @@
|
||||
#include <Rpc.h>
|
||||
#endif
|
||||
#include <common/singleton.h>
|
||||
#include <core/libraries/network/net_error.h>
|
||||
#include <core/libraries/network/sockets.h>
|
||||
#include "aio.h"
|
||||
|
||||
namespace Libraries::Kernel {
|
||||
@ -205,6 +207,24 @@ int PS4_SYSV_ABI posix_getpagesize() {
|
||||
return 16_KB;
|
||||
}
|
||||
|
||||
int PS4_SYSV_ABI posix_getsockname(Libraries::Net::OrbisNetId s,
|
||||
Libraries::Net::OrbisNetSockaddr* addr, u32* paddrlen) {
|
||||
auto* netcall = Common::Singleton<Libraries::Net::NetInternal>::Instance();
|
||||
auto sock = netcall->FindSocket(s);
|
||||
if (!sock) {
|
||||
*Libraries::Kernel::__Error() = ORBIS_NET_ERROR_EBADF;
|
||||
LOG_ERROR(Lib_Net, "socket id is invalid = {}", s);
|
||||
return -1;
|
||||
}
|
||||
int returncode = sock->GetSocketAddress(addr, paddrlen);
|
||||
if (returncode >= 0) {
|
||||
return 0;
|
||||
}
|
||||
*Libraries::Kernel::__Error() = 0x20;
|
||||
LOG_ERROR(Lib_Net, "error code returned : {:#x}", (u32)returncode);
|
||||
return -1;
|
||||
}
|
||||
|
||||
void RegisterKernel(Core::Loader::SymbolsResolver* sym) {
|
||||
service_thread = std::jthread{KernelServiceThread};
|
||||
|
||||
@ -242,8 +262,7 @@ void RegisterKernel(Core::Loader::SymbolsResolver* sym) {
|
||||
LIB_FUNCTION("lUk6wrGXyMw", "libScePosix", 1, "libkernel", 1, 1, Libraries::Net::sys_recvfrom);
|
||||
LIB_FUNCTION("fFxGkxF2bVo", "libScePosix", 1, "libkernel", 1, 1,
|
||||
Libraries::Net::sys_setsockopt);
|
||||
// LIB_FUNCTION("RenI1lL1WFk", "libScePosix", 1, "libkernel", 1, 1,
|
||||
// Libraries::Net::sys_getsockname);
|
||||
LIB_FUNCTION("RenI1lL1WFk", "libScePosix", 1, "libkernel", 1, 1, posix_getsockname);
|
||||
LIB_FUNCTION("KuOmgKoqCdY", "libScePosix", 1, "libkernel", 1, 1, Libraries::Net::sys_bind);
|
||||
LIB_FUNCTION("5jRCs2axtr4", "libScePosix", 1, "libkernel", 1, 1,
|
||||
Libraries::Net::sceNetInetNtop); // TODO fix it to sys_ ...
|
||||
|
Loading…
Reference in New Issue
Block a user