aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'nptl/sysdeps')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/fork.c8
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/lowlevelmutex.S5
-rw-r--r--nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S7
3 files changed, 10 insertions, 10 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/fork.c b/nptl/sysdeps/unix/sysv/linux/fork.c
index eba28064ea..e75f9d51da 100644
--- a/nptl/sysdeps/unix/sysv/linux/fork.c
+++ b/nptl/sysdeps/unix/sysv/linux/fork.c
@@ -25,6 +25,7 @@
#include <tls.h>
#include "fork.h"
#include <bits/stdio-lock.h>
+#include <assert.h>
unsigned long int *__fork_generation_pointer;
@@ -68,6 +69,8 @@ __libc_fork (void)
_IO_list_lock ();
+ pid_t ppid = THREAD_GETMEM (THREAD_SELF, tid);
+
#ifdef ARCH_FORK
pid = ARCH_FORK ();
#else
@@ -75,8 +78,11 @@ __libc_fork (void)
pid = INLINE_SYSCALL (fork, 0);
#endif
+
if (pid == 0)
{
+ assert (THREAD_GETMEM (THREAD_SELF, tid) != ppid);
+
if (__fork_generation_pointer != NULL)
*__fork_generation_pointer += 4;
@@ -101,6 +107,8 @@ __libc_fork (void)
}
else
{
+ assert (THREAD_GETMEM (THREAD_SELF, tid) == ppid);
+
/* We execute this even if the 'fork' call failed. */
_IO_list_unlock ();
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/lowlevelmutex.S b/nptl/sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
index dd9ac3cf35..6df513cbec 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/lowlevelmutex.S
@@ -17,6 +17,7 @@
02111-1307 USA. */
#include <sysdep.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
.text
@@ -26,10 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EWOULDBLOCK 11
-#define EINVAL 22
-#define ETIMEDOUT 110
-
.globl __lll_mutex_lock_wait
.type __lll_mutex_lock_wait,@function
diff --git a/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S
index c275f204db..f7bca99fc3 100644
--- a/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/sh/sem_wait.S
@@ -18,6 +18,7 @@
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
@@ -26,12 +27,6 @@
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EINTR 4
-#define EAGAIN 11
-#define EWOULDBLOCK EAGAIN
-#define EINVAL 22
-#define ETIMEDOUT 110
-
.text
.globl __new_sem_wait