summaryrefslogtreecommitdiffstats
path: root/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2008-07-09 16:47:01 +0000
committerCarmelo Amoroso <carmelo.amoroso@st.com>2008-07-09 16:47:01 +0000
commit62a21af8006ab04282fdc354c5b4dc765f56d058 (patch)
tree568761d58289238aa14cced3f0010809d4d28c00 /libpthread/nptl/sysdeps/unix/sysv/linux/fork.c
parentef250238dc1572caf859c2b64652f9cdfb0d9e42 (diff)
downloaduClibc-alpine-62a21af8006ab04282fdc354c5b4dc765f56d058.tar.bz2
uClibc-alpine-62a21af8006ab04282fdc354c5b4dc765f56d058.tar.xz
BIG BIG commit: all left files merged from trunk [rev 22714]. Currenntly NPTL sh4 port build and work fine. All committed to allow Khem Ray working on a working branch to integrate the ARM nptl port. MIPS nptl port not tested but should still building and working fine. There are some other part non yet merged with trunk (misc/internals and some headers file that need some more work). Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libpthread/nptl/sysdeps/unix/sysv/linux/fork.c')
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/fork.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c
index f8a64c0cb..d8219c2ee 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/fork.c
@@ -30,7 +30,6 @@
#include <atomic.h>
#include <errno.h>
-
unsigned long int *__fork_generation_pointer;
@@ -45,7 +44,7 @@ fresetlockfiles (void)
FILE *fp;
#ifdef __USE_STDIO_FUTEXES__
for (fp = _stdio_openlist; fp != NULL; fp = fp->__nextopen)
- _IO_lock_init(fp->_lock);
+ STDIO_INIT_MUTEX(fp->__lock);
#else
pthread_mutexattr_t attr;
@@ -121,11 +120,7 @@ pid_t __libc_fork (void)
break;
}
-#ifdef __USE_STDIO_FUTEXES__
- _IO_lock_lock (_stdio_openlist_lock);
-#else
- __pthread_mutex_lock(&_stdio_openlist_lock);
-#endif
+ __UCLIBC_IO_MUTEX_LOCK(_stdio_openlist_add_lock);
#ifndef NDEBUG
pid_t ppid = THREAD_GETMEM (THREAD_SELF, tid);
@@ -169,11 +164,7 @@ pid_t __libc_fork (void)
fresetlockfiles ();
/* Reset locks in the I/O code. */
-#ifdef __USE_STDIO_FUTEXES__
- _IO_lock_init (_stdio_openlist_lock);
-#else
- __stdio_init_mutex(&_stdio_openlist_lock);
-#endif
+ STDIO_INIT_MUTEX(_stdio_openlist_add_lock);
/* Run the handlers registered for the child. */
while (allp != NULL)
@@ -205,11 +196,7 @@ pid_t __libc_fork (void)
THREAD_SETMEM (THREAD_SELF, pid, parentpid);
/* We execute this even if the 'fork' call failed. */
-#ifdef __USE_STDIO_FUTEXES__
- _IO_lock_unlock(_stdio_openlist_lock);
-#else
- __pthread_mutex_unlock(&_stdio_openlist_lock);
-#endif
+ __UCLIBC_IO_MUTEX_UNLOCK(_stdio_openlist_add_lock);
/* Run the handlers registered for the parent. */
while (allp != NULL)