shadPS4/src/core/libraries/kernel
Stephen Miller 6c34b86add
Some checks are pending
Build and Release / reuse (push) Waiting to run
Build and Release / clang-format (push) Waiting to run
Build and Release / get-info (push) Waiting to run
Build and Release / windows-sdl (push) Blocked by required conditions
Build and Release / windows-qt (push) Blocked by required conditions
Build and Release / macos-sdl (push) Blocked by required conditions
Build and Release / macos-qt (push) Blocked by required conditions
Build and Release / linux-sdl (push) Blocked by required conditions
Build and Release / linux-qt (push) Blocked by required conditions
Build and Release / linux-sdl-gcc (push) Blocked by required conditions
Build and Release / linux-qt-gcc (push) Blocked by required conditions
Build and Release / pre-release (push) Blocked by required conditions
Net: Fix various socket-related issues (#3347)
* Store platform-specific level in a separate variable

So the level logged in the getsockopt/setsockopt unreachable is actually useful in cases where the level is unknown.

* Define ORBIS_NET_IPPROTO_IPV6

Not implemented yet, but since it's known we might as well add it.

* Fix error codes

Our libSceNet code expects accurate ORBIS_NET_E* errors, while the sys_net code returns ORBIS_NET_ERROR_* errors.

* Remove duplicate getsockname implementation

* Use separate mutex for ReceivePacket calls

Calls to ReceivePacket shouldn't block other socket functions, and allowing them to block these functions frequently causes deadlocks in games that use multiple threads for socket behaviors.
That said, concurrent receives are still a potential issue, so the function should still have a mutex.

* Add missing error codes

* Clang

* Minor nit

Not sure why these were left separate from the rest of the net errnos

* Set __Error() in ConvertReturnErrorCode

Because the new error values are positive, the logic of "negative return is an error" doesn't work anymore. The easiest fix, while retaining corrected error values, is to just set __Error() in ConvertReturnErrorCode, and have that return -1 instead.
I also added some formatting fixes here too.

* Set errno on stubbed P2P socket error returns.

Otherwise the errno is just whatever was set by a previous failing function, which may cause issues in some games.
I used EAGAIN here since it appears to be valid for all three of these functions, but this can be changed if requested.

* Fix missed error returns

* Fix socket methods in file_system

Missed these
2025-07-30 21:54:28 +03:00
..
sync semaphore: Attempt to acquire before checking timeout 2024-12-24 15:39:17 +02:00
threads Wiring misc functions (#3293) 2025-07-24 00:34:13 +03:00
aio.cpp kernel: Clean up and fix some mistakes. (#2907) 2025-05-11 14:22:17 -07:00
aio.h sceKernelAio* implementation (#2160) 2025-01-16 18:27:52 +02:00
debug.cpp Minor libkernel changes (#2721) 2025-03-30 01:27:33 +02:00
debug.h Minor libkernel changes (#2721) 2025-03-30 01:27:33 +02:00
equeue.cpp Equeue: HrTimer fixes (#2987) 2025-06-15 19:03:57 +03:00
equeue.h Equeue: HrTimer fixes (#2987) 2025-06-15 19:03:57 +03:00
file_system.cpp Net: Fix various socket-related issues (#3347) 2025-07-30 21:54:28 +03:00
file_system.h libkernel: Filesystem code cleanup (#2554) 2025-03-26 18:03:35 +02:00
kernel.cpp Net: Fix various socket-related issues (#3347) 2025-07-30 21:54:28 +03:00
kernel.h Standardize RegisterLib names for HLE libraries (#3234) 2025-07-16 12:23:03 +03:00
memory.cpp Wiring misc functions (#3293) 2025-07-24 00:34:13 +03:00
memory.h Core: MapMemory fixes (#3142) 2025-06-21 19:22:03 -07:00
orbis_error.h core: Library cleanup (#1631) 2024-11-30 22:37:36 +02:00
posix_error.h core: Library cleanup (#1631) 2024-11-30 22:37:36 +02:00
process.cpp libkernel: Check returned module in sceKernelGetModuleInfoFromAddr (#3147) 2025-06-23 01:32:43 -07:00
process.h Handle error behavior in sceSysmoduleGetModuleInfoForUnwind stub (#2629) 2025-03-09 23:17:33 +02:00
threads.cpp kernel: Rewrite pthread emulation (#1440) 2024-11-21 22:59:38 +02:00
threads.h kernel: Implement scePthreadGetaffinity (#2916) 2025-05-12 10:46:53 -07:00
time.cpp externals: Remove winpthreads. (#2932) 2025-05-15 13:59:34 -07:00
time.h externals: Remove winpthreads. (#2932) 2025-05-15 13:59:34 -07:00