Merge pull request #1712 from LuisBiceps/test/libc-guest-errors-thread-errno

test(libc): reset errno after the worker thread in guest_errors
This commit is contained in:
Dean 2026-10-09 21:03:23 +13:00 committed by GitHub
commit e4492fac50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -15,10 +15,12 @@ int main() {
Require(*__error_nid_postfix() == 13);
Require(std::strcmp(strerror_nid_postfix(78), "Function not implemented") == 0);
char* parent = strerror_nid_postfix(22);
Require(*__error_nid_postfix() == 13);
std::thread worker([] {
Require(std::strcmp(strerror_nid_postfix(45), "Operation not supported") == 0);
});
worker.join();
*__error_nid_postfix() = 13;
Require(std::strcmp(parent, "Invalid argument") == 0);
char buffer[128];
for (int error = 0; error <= 96; ++error) {