summaryrefslogtreecommitdiff
path: root/missing/flock.c
diff options
context:
space:
mode:
Diffstat (limited to 'missing/flock.c')
-rw-r--r--missing/flock.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/missing/flock.c b/missing/flock.c
index 435d66aefb..0b76961762 100644
--- a/missing/flock.c
+++ b/missing/flock.c
@@ -1,10 +1,19 @@
-#include "ruby/config.h"
+#include "ruby/internal/config.h"
#include "ruby/ruby.h"
#if defined _WIN32
-#elif defined HAVE_FCNTL && defined HAVE_FCNTL_H && !defined(__native_client__)
+#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 sytems doesn't have
+/* These are the flock() constants. Since this systems doesn't have
flock(), the values of the constants are probably not available.
*/
# ifndef LOCK_SH
@@ -73,7 +82,7 @@ flock(int fd, int operation)
# define F_TEST 3 /* Test a region for other processes locks */
# endif
-/* These are the flock() constants. Since this sytems doesn't have
+/* These are the flock() constants. Since this systems doesn't have
flock(), the values of the constants are probably not available.
*/
# ifndef LOCK_SH