Skip to content

Commit 5e5c605

Browse files
zhuoweikateinoigakukun
authored andcommitted
WebAssembly: remove file locking on stdin; WASI doesn't support file locking
1 parent 431f9a2 commit 5e5c605

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

stdlib/public/stubs/Stubs.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,8 @@ const char *swift::_swift_stdlib_strtof_clocale(
503503
void swift::_swift_stdlib_flockfile_stdout() {
504504
#if defined(_WIN32)
505505
_lock_file(stdout);
506+
#elif defined(__wasi__)
507+
// WebAssembly/WASI doesn't support file locking yet
506508
#else
507509
flockfile(stdout);
508510
#endif
@@ -511,6 +513,8 @@ void swift::_swift_stdlib_flockfile_stdout() {
511513
void swift::_swift_stdlib_funlockfile_stdout() {
512514
#if defined(_WIN32)
513515
_unlock_file(stdout);
516+
#elif defined(__wasi__)
517+
// WebAssembly/WASI doesn't support file locking yet
514518
#else
515519
funlockfile(stdout);
516520
#endif

0 commit comments

Comments
 (0)