Revert SetPosixErrno changes

shadow's using it for posix sockets, so significant modifications would introduce unnecessary merge conflicts.
This commit is contained in:
Stephen Miller 2025-02-27 15:03:59 -06:00
parent 12dc1adf66
commit 3f54872c53

View File

@ -87,9 +87,33 @@ int ErrnoToSceKernelError(int error) {
void SetPosixErrno(int e) { void SetPosixErrno(int e) {
// Some error numbers are different between supported OSes // Some error numbers are different between supported OSes
switch (e) { switch (e) {
case EPERM:
g_posix_errno = POSIX_EPERM;
break;
case ENOENT: case ENOENT:
g_posix_errno = POSIX_ENOENT; g_posix_errno = POSIX_ENOENT;
break; break;
case EAGAIN:
g_posix_errno = POSIX_EAGAIN;
break;
case ENOMEM:
g_posix_errno = POSIX_ENOMEM;
break;
case EINVAL:
g_posix_errno = POSIX_EINVAL;
break;
case ENOSPC:
g_posix_errno = POSIX_ENOSPC;
break;
case ERANGE:
g_posix_errno = POSIX_ERANGE;
break;
case EDEADLK:
g_posix_errno = POSIX_EDEADLK;
break;
case ETIMEDOUT:
g_posix_errno = POSIX_ETIMEDOUT;
break;
default: default:
UNREACHABLE_MSG("errno = {}", e); UNREACHABLE_MSG("errno = {}", e);
g_posix_errno = e; g_posix_errno = e;