eric pouech (@epo) commented about dlls/ucrtbase/tests/file.c:
+ setvbuf(stdout, NULL, _IONBF, 0); + + ok(ret == 4, "fprintf(stdout) returned %d\n", ret); + ok(!pos, "expected stdout to be buffered\n"); + } + + dup_fd = _dup(STDERR_FILENO); + if (dup_fd != -1) + { + file = freopen("std_stream_test.tmp", "w", stderr); + ok(file != NULL, "freopen failed\n"); + + ret = fprintf(stderr, "test"); + ok(ret == 4, "fprintf(stderr) returned %d\n", ret); + pos = _telli64(STDERR_FILENO); + ok(pos == 4 || broken(!GetProcAddress(GetModuleHandleA("ucrtbase"), "__CxxFrameHandler4") && !pos), this will only be tested on x86_64 (the assumption that the buffering is orthogonal to the machine seems reasonable, but remains to be tested for future native ucrtbase versions) perhaps we could do something like:
if (broken(!GetProcAddress(GetModuleHandleA("ucrtbase"), "__CxxFrameHandler4") && !pos))
trace("stderr is unbuffered\n");
else
ok(pos == 4, ...
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/5462#note_67320