https://bugs.winehq.org/show_bug.cgi?id=53677
Bug ID: 53677 Summary: invalid O_WRONLY read sets errno=EACCES instead of EBADF Product: Wine Version: 7.17 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: xantares09@hotmail.com Distribution: ---
Created attachment 73089 --> https://bugs.winehq.org/attachment.cgi?id=73089 minimal testcase
I noticed that an incorrect read from a file in write-only mode can result in errno to be set to EACCES instead of EBADF that is returned on native linux or on windows (either msvc or cross-compiled mingw), see attached testcase
$ x86_64-w64-mingw32-gcc main.c $ wine a.exe EBADF=9 EACCES=13 errno=13 errno should be EBADF
whereas on native linux or windows:
a
EBADF=9 EACCES=13 errno=9
tested with latest 7.17 on archlinux but also happens with 6.0 on ubuntu jammy