* 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/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/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.
tst-eintr1 \
tst-tsd1 tst-tsd2 \
tst-tls1 tst-tls2 \
- tst-fork1 tst-fork2 tst-fork3 \
+ tst-fork1 tst-fork2 tst-fork3 tst-fork4 \
tst-atfork1 \
tst-cancel1 tst-cancel2 tst-cancel3 tst-cancel4 tst-cancel5 \
tst-cancel6 tst-cancel7 tst-cancel8 tst-cancel9 tst-cancel10 \
distribute = eintr.c
+gen-as-const-headers = pthread-errnos.sym
+
LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
--- /dev/null
+#include <errno.h>
+
+-- These errno codes are used by some assembly code.
+
+EAGAIN EAGAIN
+EBUSY EBUSY
+EDEADLK EDEADLK
+EINTR EINTR
+EINVAL EINVAL
+ETIMEDOUT ETIMEDOUT
+EWOULDBLOCK EWOULDBLOCK
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define EBUSY 16
+#include <pthread-errnos.h>
#ifdef UP
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define EBUSY 16
+#include <pthread-errnos.h>
.globl pthread_spin_trylock
.type pthread_spin_trylock,@function
pthread_spin_trylock:
tas.b @r4
bf/s 1f
- mov #EBUSY, r0
+ mov #EBUSY, r0
mov #0, r0
1:
rts
02111-1307 USA. */
#include <sysdep.h>
+#include <pthread-errnos.h>
.text
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define ETIMEDOUT 110
-
.globl __lll_lock_wait
.type __lll_lock_wait,@function
02111-1307 USA. */
#include <sysdep.h>
+#include <pthread-errnos.h>
.text
#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
#include <sysdep.h>
#include <shlib-compat.h>
#include <lowlevelcond.h>
+#include <pthread-errnos.h>
#ifdef UP
# define LOCK
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define ETIMEDOUT 110
-
.text
#include <sysdep.h>
#include <lowlevelrwlock.h>
+#include <pthread-errnos.h>
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EAGAIN 11
-#define EDEADLK 35
-
#ifndef UP
# define LOCK lock
#else
#include <sysdep.h>
#include <lowlevelrwlock.h>
+#include <pthread-errnos.h>
#define SYS_gettimeofday __NR_gettimeofday
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EAGAIN 11
-#define EINVAL 22
-#define EDEADLK 35
-#define ETIMEDOUT 110
-
#ifndef UP
# define LOCK lock
#else
#include <sysdep.h>
#include <lowlevelrwlock.h>
+#include <pthread-errnos.h>
#define SYS_gettimeofday __NR_gettimeofday
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EAGAIN 11
-#define EINVAL 22
-#define EDEADLK 35
-#define ETIMEDOUT 110
-
#ifndef UP
# define LOCK lock
#else
#include <sysdep.h>
#include <lowlevelrwlock.h>
+#include <pthread-errnos.h>
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EAGAIN 11
-#define EDEADLK 35
-
#ifndef UP
# define LOCK lock
#else
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
#define SYS_futex 240
#define FUTEX_WAKE 1
-#define EINVAL 22
-
.text
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
#define SYS_futex 240
#define FUTEX_WAKE 1
-#define EWOULDBLOCK 11
-#define EINVAL 22
-#define ETIMEDOUT 110
-
.text
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
#define SYS_futex 240
#define FUTEX_WAKE 1
-#define EAGAIN 11
-
.text
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
#define SYS_futex 240
#define FUTEX_WAKE 1
-#define EWOULDBLOCK 11
-
.text
02111-1307 USA. */
#include <sysdep.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
.text
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define ETIMEDOUT 110
-
.globl __lll_lock_wait
.type __lll_lock_wait,@function
#include <sysdep.h>
#include <shlib-compat.h>
#include <lowlevelcond.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#define SYS_gettimeofday __NR_gettimeofday
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define ETIMEDOUT 110
-
.text
mov.l .Ldisable1, r1
bsrf r1
mov.l @r15, r4
-.Ldisable1b:
+.Ldisable1b:
/* Lock. */
mov #1, r3
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <tcb-offsets.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EAGAIN 11
-#define EDEADLK 35
-
.text
.long __lll_mutex_lock_wait-.Lwait0b
.Lwake0:
.long __lll_mutex_unlock_wake-.Lwake0b
-.Lwait1:
+.Lwait1:
.long __lll_mutex_lock_wait-.Lwait1b
.Lwake1:
.long __lll_mutex_unlock_wake-.Lwake1b
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <tcb-offsets.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#define SYS_gettimeofday __NR_gettimeofday
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EAGAIN 11
-#define EDEADLK 35
-#define ETIMEDOUT 110
-
.text
.Ltcboff:
.word TLS_PRE_TCB_SIZE
.align 2
-.Lwait2:
+.Lwait2:
.long __lll_mutex_lock_wait-.Lwait2b
.Lwake2:
.long __lll_mutex_unlock_wake-.Lwake2b
-.Lwait3:
+.Lwait3:
.long __lll_mutex_lock_wait-.Lwait3b
.Lwake3:
.long __lll_mutex_unlock_wake-.Lwake3b
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <tcb-offsets.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#define SYS_gettimeofday __NR_gettimeofday
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EAGAIN 11
-#define EDEADLK 35
-#define ETIMEDOUT 110
-
.text
.Ltcboff:
.word TLS_PRE_TCB_SIZE
.align 2
-.Lwait6:
+.Lwait6:
.long __lll_mutex_lock_wait-.Lwait6b
.Lwake6:
.long __lll_mutex_unlock_wake-.Lwake6b
-.Lwait7:
+.Lwait7:
.long __lll_mutex_lock_wait-.Lwait7b
.Lwake7:
.long __lll_mutex_unlock_wake-.Lwake7b
#include <sysdep.h>
#include <lowlevelrwlock.h>
#include <tcb-offsets.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#define SYS_futex 240
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EAGAIN 11
-#define EDEADLK 35
-
.text
.Ltcboff:
.word TLS_PRE_TCB_SIZE
.align 2
-.Lwait4:
+.Lwait4:
.long __lll_mutex_lock_wait-.Lwait4b
.Lwake4:
.long __lll_mutex_unlock_wake-.Lwake4b
-.Lwait5:
+.Lwait5:
.long __lll_mutex_lock_wait-.Lwait5b
.Lwake5:
.long __lll_mutex_unlock_wake-.Lwake5b
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#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_post
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#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 sem_timedwait
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#include "lowlevel-atomic.h"
#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_trywait
02111-1307 USA. */
#include <sysdep.h>
+#include <pthread-errnos.h>
.text
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define ETIMEDOUT 110
-
/* Modified: %rax, %rsi. */
.globl __lll_lock_wait
02111-1307 USA. */
#include <sysdep.h>
+#include <pthread-errnos.h>
.text
#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
#include <sysdep.h>
#include <shlib-compat.h>
#include <lowlevelcond.h>
+#include <pthread-errnos.h>
#ifdef UP
# define LOCK
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define ETIMEDOUT 110
-
.text
#include <sysdep.h>
#include <lowlevelrwlock.h>
+#include <pthread-errnos.h>
#define SYS_futex 202
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EAGAIN 11
-#define EDEADLK 35
-
#ifndef UP
# define LOCK lock
#else
#include <sysdep.h>
#include <lowlevelrwlock.h>
+#include <pthread-errnos.h>
#define SYS_futex 202
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
-#define EAGAIN 11
-#define EDEADLK 35
-
#ifndef UP
# define LOCK lock
#else
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
#define SYS_futex 202
#define FUTEX_WAKE 1
-#define EINVAL 22
-
.text
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 202
-#define EWOULDBLOCK 11
-#define EINVAL 22
-#define ETIMEDOUT 110
-
.text
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
#define SYS_futex 202
#define FUTEX_WAKE 1
-#define EAGAIN 11
-
.text
#include <sysdep.h>
#include <shlib-compat.h>
+#include <pthread-errnos.h>
#ifndef UP
# define LOCK lock
#define SYS_futex 202
-#define EWOULDBLOCK 11
-
.text
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define EBUSY 16
+#include <pthread-errnos.h>
#ifdef UP