about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--nptl/sysdeps/unix/sysv/linux/fork.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/Makefile b/nptl/sysdeps/unix/sysv/linux/Makefile
index 832ce2326b..9a84534d5b 100644
--- a/nptl/sysdeps/unix/sysv/linux/Makefile
+++ b/nptl/sysdeps/unix/sysv/linux/Makefile
@@ -22,3 +22,7 @@ sysdep_routines += register-atfork unregister-atfork fork-gen
 
 libpthread-sysdep_routines += pt-fork
 endif
+
+ifeq ($(subdir),posix)
+CFLAGS-fork.c = -D_IO_MTSAFE_IO
+endif
diff --git a/nptl/sysdeps/unix/sysv/linux/fork.c b/nptl/sysdeps/unix/sysv/linux/fork.c
index c1aa23c5c5..b643f89dfc 100644
--- a/nptl/sysdeps/unix/sysv/linux/fork.c
+++ b/nptl/sysdeps/unix/sysv/linux/fork.c
@@ -24,6 +24,7 @@
 #include <libio/libioP.h>
 #include <tls.h>
 #include "fork.h"
+#include <bits/stdio-lock.h>
 
 
 unsigned long int *__fork_generation_pointer;
@@ -41,8 +42,7 @@ fresetlockfiles (void)
   _IO_ITER i;
 
   for (i = _IO_iter_begin(); i != _IO_iter_end(); i = _IO_iter_next(i))
-    *((pthread_mutex_t *) _IO_iter_file(i)->_lock)
-      = (pthread_mutex_t) PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
+    _IO_lock_init (*((_IO_lock_t *) _IO_iter_file(i)->_lock));
 }