Skip to content

Commit 51d7aeb

Browse files
committed
[SDK] crt/sys/stat.h: Import MinGW-w64 patch "Change _S_IFBLK from 0x3000 to 0x6000"
Mingw-w64 commit id 850703ae46e1971c5789fa1bdd802fb9692c41c9 by Daniel Starke via Mingw-w64-public <[email protected]> headers: Change _S_IFBLK from 0x3000 to 0x6000 The _S_IFBLK macro, used to identify block special files in file systems, is being updated from 0x3000 to 0x6000. This change aligns mingw-w64 with the more commonly used value across Unix-like systems and other C libraries. The old value of 0x3000 may have caused compatibility issues when working with code that assumes the standard 0x6000 value for S_IFBLK. This update improves cross-platform compatibility and consistency with other systems, making it easier to write portable code that deals with file type identification. It also reduces potential confusion and errors that might arise from the non-standard value. One of these is for example python. This is only an example. It does not change the fact that python should be more careful about actual value implementation. Note that the current value implies character device + FIFO instead of character device + directory. Link: https://github.com/python/cpython/blob/f81990024554a75e2ab31133a72d9f0954690435/Python/fileutils.c#L1197 Link: https://github.com/torvalds/linux/blob/81e4f8d68c66da301bb881862735bd74c6241a19/include/uapi/linux/stat.h#L13 Signed-off-by: Daniel Starke <[email protected]> Signed-off-by: LIU Hao <[email protected]>
1 parent 127b363 commit 51d7aeb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sdk/include/crt/sys/stat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ extern "C" {
306306
#endif /* !defined(RC_INVOKED) */
307307

308308
#ifndef NO_OLDNAMES
309-
#define _S_IFBLK 0x3000 /* Block: Is this ever set under w32? */
309+
#define _S_IFBLK 0x6000 /* Block: Is this ever set under w32? */
310310

311311
#define S_IFMT _S_IFMT
312312
#define S_IFDIR _S_IFDIR

0 commit comments

Comments
 (0)