[wasm] Add O_NONBLOCK shim (#1235)

05975959e67f57063445baabb652262dd764cc72 added a use of `O_NONBLOCK` but
the constant cannot be imported from wasi-libc through ClangImporter
directly, so we need to add a shim for it as well as other constants.
This commit is contained in:
Yuta Saito 2025-04-01 00:54:37 +09:00 committed by GitHub
parent dcd762f754
commit 320c5837e2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -49,6 +49,9 @@ internal var O_TRUNC: Int32 {
internal var O_WRONLY: Int32 {
return _platform_shims_O_WRONLY()
}
internal var O_NONBLOCK: Int32 {
return _platform_shims_O_NONBLOCK()
}
internal var O_RDONLY: Int32 {
return _platform_shims_O_RDONLY()
}

View File

@ -102,6 +102,7 @@ static inline int32_t _platform_shims_O_CREAT(void) { return O_CREAT; }
static inline int32_t _platform_shims_O_EXCL(void) { return O_EXCL; }
static inline int32_t _platform_shims_O_TRUNC(void) { return O_TRUNC; }
static inline int32_t _platform_shims_O_WRONLY(void) { return O_WRONLY; }
static inline int32_t _platform_shims_O_NONBLOCK(void) { return O_NONBLOCK; }
static inline int32_t _platform_shims_O_RDONLY(void) { return O_RDONLY; }
static inline int32_t _platform_shims_O_DIRECTORY(void) { return O_DIRECTORY; }
static inline int32_t _platform_shims_O_NOFOLLOW(void) { return O_NOFOLLOW; }