Re: [Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF

2022-09-14 Thread Michel Zou
@lists.sourceforge.net; Michel Zou Subject: Re: [Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF 在 2022/9/13 14:42, Michel Zou 写道: > > If I try to run the generated binaries from arch (mingw 10.0.0) on win10 I > got the same errno=13, > so I dont think it comes from wine.

Re: [Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF

2022-09-13 Thread LIU Hao
在 2022/9/13 14:42, Michel Zou 写道: If I try to run the generated binaries from arch (mingw 10.0.0) on win10 I got the same errno=13, so I dont think it comes from wine. I cross-built an executable and got 13 on Wine 6.0 but 9 on Windows 10. I can send you this executable if you would like.

Re: [Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF

2022-09-13 Thread Michel Zou
Subject: Re: [Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF 在 2022/9/11 17:20, LIU Hao 写道: > This is an ancient version though; I think I can check a more recent version > a few days later on my > XPS. > Got the same erroneous result: ``` lh_mouse

Re: [Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF

2022-09-12 Thread LIU Hao
在 2022/9/11 17:20, LIU Hao 写道: This is an ancient version though; I think I can check a more recent version a few days later on my XPS. Got the same erroneous result: ``` lh_mouse@lhmouse-xps ~/Desktop $ x86_64-w64-mingw32-gcc main.c lh_mouse@lhmouse-xps ~/Desktop $ ./a.exe

Re: [Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF

2022-09-11 Thread LIU Hao
在 2022-09-10 03:53, Biswapriyo Nath 写道: I am using msys2/mingw-w64 toolchain. The packages are compiled from git repository. For example, see the crt package here https://packages.msys2.org/base/mingw-w64-crt-git. And on the other side, I have VS2019. This is not reproducible on Windows 10

Re: [Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF

2022-09-09 Thread Biswapriyo Nath
I am using msys2/mingw-w64 toolchain. The packages are compiled from git repository. For example, see the crt package here https://packages.msys2.org/base/mingw-w64-crt-git. And on the other side, I have VS2019. ___ Mingw-w64-public mailing list

Re: [Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF

2022-09-09 Thread Michel Zou
] invalid O_WRONLY read sets errno=EACCES instead of EBADF I have compiled the code with mingw gcc and msvc in Windows 10 and both shows same output as following EBADF=9 EACCES=13 errno=9 ___ Mingw-w64-public mailing list Mingw-w64-public

Re: [Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF

2022-09-09 Thread Biswapriyo Nath
I have compiled the code with mingw gcc and msvc in Windows 10 and both shows same output as following EBADF=9 EACCES=13 errno=9 ___ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net

[Mingw-w64-public] invalid O_WRONLY read sets errno=EACCES instead of EBADF

2022-09-09 Thread Michel Zou
Hello, 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 yield on linux , msvc or macos. Here is a small reproducer: https://gist.github.com/xantares/23dc23776aee9d867223f376b6fa9809 I use latest mingw on arch, but