aboutsummaryrefslogtreecommitdiffstats
path: root/missing/flock.c
diff options
context:
space:
mode:
Diffstat (limited to 'missing/flock.c')
-rw-r--r--missing/flock.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/missing/flock.c b/missing/flock.c
index c0b3f80601..9daf1c38cc 100644
--- a/missing/flock.c
+++ b/missing/flock.c
@@ -2,6 +2,13 @@
#include "ruby/ruby.h"
#if defined _WIN32
+#elif defined __wasi__
+#include <errno.h>
+
+int flock(int fd, int operation) {
+ errno = EINVAL;
+ return -1;
+}
#elif defined HAVE_FCNTL && defined HAVE_FCNTL_H
/* These are the flock() constants. Since this systems doesn't have