summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/stdio/ofl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/stdio/ofl.c')
-rw-r--r--libc-top-half/musl/src/stdio/ofl.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/stdio/ofl.c b/libc-top-half/musl/src/stdio/ofl.c
new file mode 100644
index 0000000..33a8aa5
--- /dev/null
+++ b/libc-top-half/musl/src/stdio/ofl.c
@@ -0,0 +1,20 @@
+#include "stdio_impl.h"
+#include "lock.h"
+#include "fork_impl.h"
+
+static FILE *ofl_head;
+#if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT)
+static volatile int ofl_lock[1];
+volatile int *const __stdio_ofl_lockptr = ofl_lock;
+#endif
+
+FILE **__ofl_lock()
+{
+ LOCK(ofl_lock);
+ return &ofl_head;
+}
+
+void __ofl_unlock()
+{
+ UNLOCK(ofl_lock);
+}