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 Mingw-w

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

2022-09-09 Thread Michel Zou
What version do you use ? I use mingw-w64 10.0.0 on arch and 7.0.0 on ubuntu focal. Maybe its fixed in some git version ? From: Biswapriyo Nath Sent: Friday, September 9, 2022 5:50 PM To: mingw-w64-public@lists.sourceforge.net Subject: Re: [Mingw-w64-public] inv

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 https://lists.sourceforge.net/lists/listinfo/mingw-

[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 I

Re: [Mingw-w64-public] [PATCH] crt: expose non-dllimport variant of rand_s

2022-09-09 Thread Martin Storsjö
On Fri, 9 Sep 2022, Matthew Lugg wrote: Hmm, to dig further, can you provide the following: - The command you used for disassembling the bitcode from the LTO object file (to save me time from having to look it up, since I don't think I've done that before) - The actual LTO object file produced a