* pthread-errnos.sym: New file.

* Makefile (gen-as-const-headers): New variable, list that file.
	* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
	header <pthread-errnos.h> instead of defining errno values here.
	* sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
	Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
	Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
	* sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
	* sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
	* sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
	* sysdeps/sh/pthread_spin_trylock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.

	* sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
	CLONE_CHILD_SETTID worked.
This commit is contained in:
Roland McGrath 2003-03-12 10:30:26 +00:00
parent 326132dbdb
commit 0bb2ac85a6
5 changed files with 56 additions and 11 deletions

View File

@ -1,3 +1,48 @@
2003-03-12 Roland McGrath <roland@redhat.com>
* pthread-errnos.sym: New file.
* Makefile (gen-as-const-headers): New variable, list that file.
* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Include generated
header <pthread-errnos.h> instead of defining errno values here.
* sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevelmutex.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevelmutex.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_trywait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_post.S: Likewise.
* sysdeps/unix/sysv/linux/sh/sem_wait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedwrlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_timedrdlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/sh/lowlevelmutex.S: Likewise.
* sysdeps/i386/i486/pthread_spin_trylock.S: Likewise.
* sysdeps/x86_64/pthread_spin_trylock.S: Likewise.
* sysdeps/sh/pthread_spin_trylock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/fork.c: Add an assert to check that
CLONE_CHILD_SETTID worked.
2003-03-12 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: New file.

View File

@ -144,7 +144,7 @@ tests = tst-attr1 tst-attr2 \
tst-eintr1 \
tst-tsd1 tst-tsd2 \
tst-tls1 tst-tls2 \
tst-fork1 tst-fork2 tst-fork3 tst-fork4 \
tst-fork1 tst-fork2 tst-fork3 \
tst-atfork1 \
tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel4 tst-cancel5 \
tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \

View File

@ -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 ();

View File

@ -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

View File

@ -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