summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio64/fopen64.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio64/fopen64.c')
-rw-r--r--newlib/libc/stdio64/fopen64.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/newlib/libc/stdio64/fopen64.c b/newlib/libc/stdio64/fopen64.c
index 1eb89874e..d2ab74c35 100644
--- a/newlib/libc/stdio64/fopen64.c
+++ b/newlib/libc/stdio64/fopen64.c
@@ -70,6 +70,7 @@ static char sccsid[] = "%W% (Berkeley) %G%";
#ifdef __CYGWIN__
#include <fcntl.h>
#endif
+#include <sys/lock.h>
#ifdef __LARGE64_FILES
@@ -113,6 +114,10 @@ _DEFUN (_fopen64_r, (ptr, file, mode),
fp->_flags |= __SL64;
+#ifndef __SINGLE_THREAD__
+ __lock_init_recursive (*(_LOCK_RECURSIVE_T *)&fp->_lock);
+#endif
+
return fp;
}