]> git.proxmox.com Git - wasi-libc.git/commitdiff
Redefine the `access` bits to be compatible with other systems (#210)
authorDan Gohman <sunfish@mozilla.com>
Fri, 31 Jul 2020 20:44:58 +0000 (13:44 -0700)
committerGitHub <noreply@github.com>
Fri, 31 Jul 2020 20:44:58 +0000 (13:44 -0700)
Normally bits like this would be considered implementation details, but
in this case, `X_OK`, `W_OK`, and `R_OK` line up with `S_IXOTH`,
`S_IWOTH`, and `S_IROTH` on other systems, and those bits do have
well-known values.

expected/wasm32-wasi/predefined-macros.txt
libc-bottom-half/headers/public/__header_unistd.h

index f858b752ff256d7e3505ec2fdb78604f7ad6e2da..1c8283a073f68b3e20d075f2af05ae305181ef45 100644 (file)
 #define F_GETFD (1)
 #define F_GETFL (3)
 #define F_LOCK 1
-#define F_OK 0
+#define F_OK (0)
 #define F_SETFD (2)
 #define F_SETFL (4)
 #define F_TEST 3
 #define RS_HIPRI 0x01
 #define RUSAGE_CHILDREN 2
 #define RUSAGE_SELF 1
-#define R_OK 1
+#define R_OK (4)
 #define SARMAG 8
 #define SB 250
 #define SCHAR_MAX 127
 #define WONT 252
 #define WORD_BIT 32
 #define WRQ 02
-#define W_OK 2
-#define X_OK 4
+#define W_OK (2)
+#define X_OK (1)
 #define YESEXPR 0x50000
 #define YESSTR 0x50002
 #define YXDOMAIN ns_r_yxdomain
index e9eae2b6404e5968c8772f1e7283b3dca21b8346..6b80d63788317fb9d73573cf4b17fe909f937e00 100644 (file)
@@ -5,10 +5,10 @@ struct stat;
 
 #include <__seek.h>
 
-#define F_OK 0
-#define R_OK 1
-#define W_OK 2
-#define X_OK 4
+#define F_OK (0)
+#define X_OK (1)
+#define W_OK (2)
+#define R_OK (4)
 
 #ifdef __cplusplus
 extern "C" {