mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
fix(libkernel): map EPIPE on Linux and test send with MSG_NOSIGNAL on a closed peer
Case and test by hikazey in the PR thread. Co-authored-by: hikazey <hikazey@users.noreply.github.com> Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -82,6 +82,7 @@ int NativeError() {
|
||||
case ETIMEDOUT: return 60;
|
||||
case EINTR: return 4;
|
||||
case EINVAL: return 22;
|
||||
case EPIPE: return 32;
|
||||
default: return 5;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -55,6 +55,11 @@ int main() {
|
||||
Require(std::strcmp(request, received) == 0);
|
||||
|
||||
Require(close_nid_postfix(accepted) == 0);
|
||||
#ifndef _WIN32
|
||||
std::int64_t sent = 0;
|
||||
for (int i = 0; i < 100 && sent >= 0; ++i) sent = send_nid_postfix(client, request, sizeof(request), 0x20000);
|
||||
Require(sent == -1 && *__error_nid_postfix() == 32);
|
||||
#endif
|
||||
Require(close_nid_postfix(client) == 0);
|
||||
Require(close_nid_postfix(listener) == 0);
|
||||
Require(close_nid_postfix(listener) == -1 && *__error_nid_postfix() == 9);
|
||||
|
||||
Reference in New Issue
Block a user