Commit Graph
9 Commits
Author SHA1 Message Date
Adrià e7011684e8 Merge pull request #9583 from DavidSamir/test/win-guest-fopen-errors
test(libc): run guest_fopen_errors on Windows
2026-10-26 11:20:45 +01:00
AlxcBTW fa7d4bd1d0 test(libc): cover freopen_s 2026-10-25 19:04:10 +01:00
Adrià FranchandClaude Sonnet 5.5 2736e7f7a8 test(libc): delete the Windows loop link before removing the fopen fixture
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 18:23:53 +01:00
David 7bab4ec508 test(libc): run guest_fopen_errors on Windows
The test was registered only under if(UNIX) because it built its symbolic
link loop with ::symlink. On Windows it now makes the loop with
CreateSymbolicLinkW (unprivileged create) and exits 77, which CTest reports
as skipped, when the account cannot create symbolic links.
2026-10-25 18:23:46 +01:00
boykopovar cfae18d656 fix(tests): use typed streams in fopen error checks 2026-10-24 23:17:51 +03:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Alexej Szpevák 5433b32b7d fix(libc): return the open error from fopen_s instead of ENOENT
fopen_s returned ENOENT for every failed open, including an invalid mode, a directory opened for writing and the loop and long-name cases. C11 K.3.5.2.1 only asks for a nonzero value; Microsoft's CRT, which shares Dinkumware's library, returns errno. fopen_s now returns the errno fopen set.
2026-10-17 11:52:14 +02:00
Alexej Szpevák 8806043613 fix(libc): translate the host errno of a failed freopen
freopen closed the stream and returned the host's errno from the failed reopen as is, with the same Linux numbers for a symlink loop or an over-long name as fopen had. It now passes it through GuestErrnoFromHost_nid_no_patch.
2026-10-17 11:51:32 +02:00
Alexej Szpevák dc324d3d5f fix(libc): translate the host errno of a failed fopen
fopen left the host's errno in place when the host open failed, so on Linux a symlink loop reached the title as 40 and an over-long name as 36, which are EMSGSIZE and EINPROGRESS on FreeBSD. GuestErrnoFromHost_nid_no_patch maps the host value to FreeBSD 11.4's: 1 to 34 are shared except EAGAIN (35), and ELOOP, ENAMETOOLONG, ENOTEMPTY, EDQUOT, EOVERFLOW and EDEADLK get their FreeBSD numbers; anything else is EIO.
2026-10-17 11:51:00 +02:00