Skip to content

Commit e5a5fb2

Browse files
committed
WebAssembly: remove file locking on stdin; WASI doesn't support file locking
1 parent cd1c4fa commit e5a5fb2

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
@@ -488,6 +488,8 @@ const char *swift::_swift_stdlib_strtof_clocale(
488488
void swift::_swift_stdlib_flockfile_stdout() {
489489
#if defined(_WIN32)
490490
_lock_file(stdout);
491+
#elif defined(__wasi__)
492+
// WebAssembly/WASI doesn't support file locking yet
491493
#else
492494
flockfile(stdout);
493495
#endif
@@ -496,6 +498,8 @@ void swift::_swift_stdlib_flockfile_stdout() {
496498
void swift::_swift_stdlib_funlockfile_stdout() {
497499
#if defined(_WIN32)
498500
_unlock_file(stdout);
501+
#elif defined(__wasi__)
502+
// WebAssembly/WASI doesn't support file locking yet
499503
#else
500504
funlockfile(stdout);
501505
#endif

0 commit comments

Comments
 (0)