* tst-basic1.c (do_test): Add cast to avoid warning.
* tst-basic2.c (do_test): Likewise.
2003-03-14 Ulrich Drepper <drepper@redhat.com>
+ * tst-basic1.c (do_test): Add cast to avoid warning.
+ * tst-basic2.c (do_test): Likewise.
+
* sysdeps/unix/sysv/linux/x86_64/pthread_once.S: Use correct
amount of stack correction.
# endif
#endif
-#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 202
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
+/* For the calculation see asm/vsyscall.h. */
+#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
+
/* Modified: %rax, %rsi. */
.globl __lll_lock_wait
1:
leaq -1(%rsi), %rdx /* account for the preceeded xadd. */
- movq %r10, %rsi /* movl $FUTEX_WAIT, %ecx */
+ movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
movq $SYS_futex, %rax
syscall
.hidden __lll_timedwait_tid
.align 16
__lll_timedwait_tid:
- movq %rdi, %r8
- movq %rsi, %r9
+ pushq %r12
+ pushq %r13
+
+ movq %rdi, %r12
+ movq %rsi, %r13
subq $16, %rsp
/* Get current time. */
2: movq %rsp, %rdi
xorq %rsi, %rsi
- movq $SYS_gettimeofday, %rax
- syscall
+ movq $VSYSCALL_ADDR_vgettimeofday, %rax
+ callq *%rax
/* Compute relative timeout. */
movq 8(%rsp), %rax
movq $1000, %rdi
mul %rdi /* Milli seconds to nano seconds. */
- movq (%r9), %rdi
- movq 8(%r9), %rsi
+ movq (%r13), %rdi
+ movq 8(%r13), %rsi
subq (%rsp), %rdi
subq %rax, %rsi
jns 5f
movq %rdi, (%rsp) /* Store relative timeout. */
movq %rsi, 8(%rsp)
- movl (%r8), %edx
+ movl (%r12), %edx
testl %edx, %edx
jz 4f
movq %rsp, %r10
- xorq %rsi, %rsi /* movl $FUTEX_WAIT, %ecx */
- movq %r8, %rdi
+ xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
+ movq %r12, %rdi
movq $SYS_futex, %rax
syscall
jne 1f
4: xorl %eax, %eax
- addq $16, %rsp
+8: addq $16, %rsp
+ popq %r13
+ popq %r12
retq
1: cmpq $-ETIMEDOUT, %rax
jne 2b
6: movl $ETIMEDOUT, %eax
- addq $16, %rsp
- retq
+ jmp 8b
.size __lll_timedwait_tid,.-__lll_timedwait_tid
#endif
# endif
#endif
-#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 202
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
+/* For the calculation see asm/vsyscall.h. */
+#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
+
.globl __lll_mutex_lock_wait
.type __lll_mutex_lock_wait,@function
1:
leaq 1(%rsi), %rdx /* account for the preceeded xadd. */
- movq %r10, %rsi /* movl $FUTEX_WAIT, %ecx */
+ movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
movq $SYS_futex, %rax
syscall
.align 16
__lll_mutex_timedlock_wait:
/* Check for a valid timeout value. */
- cmpq $1000000000, 4(%rdx)
+ cmpq $1000000000, 8(%rdx)
jae 3f
+ pushq %r12
+ pushq %r13
+
/* Stack frame for the timespec and timeval structs. */
subq $16, %rsp
- movq %rdi, %r8
- movq %rdx, %r9
+ movq %rdi, %r12
+ movq %rdx, %r13
leaq 1(%rax), %rdx
/* Get current time. */
-1:
- movq %rsp, %rdi
+1: movq %rsp, %rdi
xorq %rsi, %rsi
- movq $SYS_gettimeofday, %rax
- syscall
+ movq $VSYSCALL_ADDR_vgettimeofday, %rax
+ /* This is a regular function call, all calleer-save registers
+ might be clobbered. */
+ callq *%rax
/* Compute relative timeout. */
movq 8(%rsp), %rax
movq $1000, %rdi
mul %rdi /* Milli seconds to nano seconds. */
- movq (%r9), %rdi
- movq 8(%r9), %rsi
+ movq (%r13), %rdi
+ movq 8(%r13), %rsi
subq (%rsp), %rdi
subq %rax, %rsi
jns 4f
movq %rsp, %r10
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
- movq %r8, %rdi
+ movq %r12, %rdi
movq $SYS_futex, %rax
syscall
movl $2, (%rdi)
xorl %eax, %eax
- addq $16, %rsp
+8: addq $16, %rsp
+ popq %r13
+ popq %r12
retq
/* Check whether the time expired. */
retq
5: movl $ETIMEDOUT, %eax
- addq $16, %rsp
- retq
+ jmp 8b
.size __lll_mutex_timedlock_wait,.-__lll_mutex_timedlock_wait
#endif
/* Wait for the remaining threads. The call will return immediately
if the CURR_EVENT memory has meanwhile been changed. */
-7: xorq %rsi, %rsi /* movl $FUTEX_WAIT, %ecx */
+7: xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
xorq %r10, %r10
8: movq $SYS_futex, %rax
syscall
# define LOCK lock
#endif
-#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 202
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
+/* For the calculation see asm/vsyscall.h. */
+#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
+
.text
jne 3f
4: movq %rsp, %rdi
- call __pthread_enable_asynccancel_2
+ callq __pthread_enable_asynccancel_2
/* Get the current time. */
leaq 24(%rsp), %rdi
- xorq %rcx, %rcx
- movq $SYS_gettimeofday, %rax
- syscall
+ xorq %rsi, %rsi
+ movq $VSYSCALL_ADDR_vgettimeofday, %rax
+ callq *%rax
/* Compute relative timeout. */
movq 32(%rsp), %rax
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- call __lll_mutex_lock_wait
+ callq __lll_mutex_lock_wait
jmp 2b
/* Unlock in loop requires waekup. */
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- call __lll_mutex_unlock_wake
+ callq __lll_mutex_unlock_wake
jmp 4b
/* Locking in loop failed. */
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- call __lll_mutex_lock_wait
+ callq __lll_mutex_lock_wait
#if cond_lock != 0
subq $cond_lock, %rdi
#endif
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- call __lll_mutex_unlock_wake
+ callq __lll_mutex_unlock_wake
jmp 11b
/* The initial unlocking of the mutex failed. */
#if cond_lock != 0
addq $cond_lock, %rdi
#endif
- call __lll_mutex_unlock_wake
+ callq __lll_mutex_unlock_wake
17: movq (%rsp), %rax
jmp 18b
movq %r12, %rdx
addq $wakeup_seq-cond_lock, %rdi
movq $SYS_futex, %rax
- movq %r10, %rsi /* movl $FUTEX_WAIT, %ecx */
+ movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
syscall
movq (%rsp), %rdi
jnz 3f /* Different for generation -> run initializer. */
/* Somebody else got here first. Wait. */
- movq %r10, %rsi /* movl $FUTEX_WAIT, %ecx */
+ movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
movq $SYS_futex, %rax
syscall
jmp 6b
jne 10f
11: addq $READERS_WAKEUP-MUTEX, %rdi
- movq %r10, %rsi /* movl $FUTEX_WAIT, %ecx */
+ movq %r10, %rsi /* movq $FUTEX_WAIT, %rsi */
movq $SYS_futex, %rax
syscall
13: decl READERS_QUEUED(%rdi)
jmp 2b
-5: xorq %rcx, %rcx
+5: xorq %rdx, %rdx
incl NR_READERS(%rdi)
je 8f
9: LOCK
jne 6f
7:
- movq %rcx, %rax
+ movq %rdx, %rax
retq
1:
#if MUTEX != 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_lock_wait
+ callq __lll_mutex_lock_wait
#if MUTEX != 0
subq $MUTEX, %rdi
#endif
14: cmpq %fs:SELF, %rax
jne 3b
/* Deadlock detected. */
- movq $EDEADLK, %rcx
+ movq $EDEADLK, %rdx
jmp 9b
6:
#if MUTEX != 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_unlock_wake
+ callq __lll_mutex_unlock_wake
#if MUTEX != 0
subq $MUTEX, %rdi
#endif
/* Overflow. */
8: decl NR_READERS(%rdi)
- movq $EAGAIN, %rcx
+ movq $EAGAIN, %rdx
jmp 9b
/* Overflow. */
4: decl READERS_QUEUED(%rdi)
- movq $EAGAIN, %rcx
+ movq $EAGAIN, %rdx
jmp 9b
10:
#if MUTEX != 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_unlock_wake
+ callq __lll_mutex_unlock_wake
#if MUTEX != 0
subq $MUTEX, %rdi
#endif
#if MUTEX == 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_lock_wait
+ callq __lll_mutex_lock_wait
#if MUTEX != 0
subq $MUTEX, %rdi
#endif
#include <pthread-errnos.h>
-#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 202
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
+/* For the calculation see asm/vsyscall.h. */
+#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
+
+
#ifndef UP
# define LOCK lock
#else
.type pthread_rwlock_timedrdlock,@function
.align 16
pthread_rwlock_timedrdlock:
+ pushq %r12
+ pushq %r13
subq $16, %rsp
- movq %rdi, %r8
- movq %rsi, %r9
- xorq %r10, %r10
+ movq %rdi, %r12
+ movq %rsi, %r13
/* Get the lock. */
movl $1, %esi
testl %esi, %esi
jne 1f
-2: movq WRITER(%r8), %rax
+2: movq WRITER(%r12), %rax
testq %rax, %rax
jne 14f
- cmpl $0, WRITERS_QUEUED(%r8)
+ cmpl $0, WRITERS_QUEUED(%r12)
je 5f
- cmpl $0, FLAGS(%r8)
+ cmpl $0, FLAGS(%r12)
je 5f
/* Check the value of the timeout parameter. */
-3: cmpl $1000000000, 8(%r9)
+3: cmpl $1000000000, 8(%r13)
jae 19f
- incl READERS_QUEUED(%r8)
+ incl READERS_QUEUED(%r12)
je 4f
- movl READERS_WAKEUP(%r8), %edx
+ movl READERS_WAKEUP(%r12), %edx
/* Unlock. */
LOCK
#if MUTEX == 0
- subl $1, (%r8)
+ subl $1, (%r12)
#else
- subl $1, MUTEX(%r8)
+ subl $1, MUTEX(%r12)
#endif
jne 10f
/* Get current time. */
11: movq %rsp, %rdi
xorq %rsi, %rsi
- movq $SYS_gettimeofday, %rax
- syscall
+ movq $VSYSCALL_ADDR_vgettimeofday, %rax
+ callq *%rax
/* Compute relative timeout. */
movq 8(%rsp), %rax
movq $1000, %rdi
mul %rdi /* Milli seconds to nano seconds. */
- movq (%r9), %rcx
- movq 8(%r9), %rdi
+ movq (%r13), %rcx
+ movq 8(%r13), %rdi
subq (%rsp), %rcx
subq %rax, %rdi
jns 15f
movq %rdi, 8(%rsp)
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
- leaq READERS_WAKEUP(%r8), %rdi
+ xorq %r10, %r10
+ leaq READERS_WAKEUP(%r12), %rdi
movq $SYS_futex, %rax
syscall
movq %rax, %rdx
movl $1, %esi
LOCK
#if MUTEX == 0
- xaddl %esi, (%r8)
+ xaddl %esi, (%r12)
#else
- xaddl %esi, MUTEX(%r8)
+ xaddl %esi, MUTEX(%r12)
#endif
testl %esi, %esi
jne 12f
-13: decl READERS_QUEUED(%r8)
+13: decl READERS_QUEUED(%r12)
cmpq $-ETIMEDOUT, %rdx
jne 2b
-18: movq $ETIMEDOUT, %rcx
+18: movq $ETIMEDOUT, %rdx
jmp 9f
-5: xorq %rcx, %rcx
- incl NR_READERS(%r8)
+5: xorq %rdx, %rdx
+ incl NR_READERS(%r12)
je 8f
9: LOCK
#if MUTEX == 0
- decl (%r8)
+ decl (%r12)
#else
- decl MUTEX(%r8)
+ decl MUTEX(%r12)
#endif
jne 6f
-7: movq %rcx, %rax
+7: movq %rdx, %rax
addq $16, %rsp
+ popq %r13
+ popq %r12
retq
1:
14: cmpq %fs:SELF, %rax
jne 3b
- movq $EDEADLK, %rcx
+ movq $EDEADLK, %rdx
jmp 9b
6:
#if MUTEX == 0
- movq %r8, %rdi
+ movq %r12, %rdi
#else
- leal MUTEX(%r8), %rdi
+ leal MUTEX(%r12), %rdi
#endif
callq __lll_mutex_unlock_wake
jmp 7b
/* Overflow. */
-8: decl NR_READERS(%r8)
- movq $EAGAIN, %rcx
+8: decl NR_READERS(%r12)
+ movq $EAGAIN, %rdx
jmp 9b
/* Overflow. */
-4: decl READERS_QUEUED(%r8)
- movq $EAGAIN, %rcx
+4: decl READERS_QUEUED(%r12)
+ movq $EAGAIN, %rdx
jmp 9b
10:
#if MUTEX == 0
- movq %r8, %rdi
+ movq %r12, %rdi
#else
- leaq MUTEX(%r8), %rdi
+ leaq MUTEX(%r12), %rdi
#endif
callq __lll_mutex_unlock_wake
jmp 11b
12:
#if MUTEX == 0
- movq %r8, %rdi
+ movq %r12, %rdi
#else
- leaq MUTEX(%r8), %rdi
+ leaq MUTEX(%r12), %rdi
#endif
- call __lll_mutex_lock_wait
+ callq __lll_mutex_lock_wait
jmp 13b
16: movq $-ETIMEDOUT, %rdx
jmp 17b
-19: movq $EINVAL, %rcx
+19: movq $EINVAL, %rdx
jmp 9b
.size pthread_rwlock_timedrdlock,.-pthread_rwlock_timedrdlock
#include <pthread-errnos.h>
-#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 202
#define FUTEX_WAIT 0
#define FUTEX_WAKE 1
+/* For the calculation see asm/vsyscall.h. */
+#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
+
#ifndef UP
# define LOCK lock
#else
.type pthread_rwlock_timedwrlock,@function
.align 16
pthread_rwlock_timedwrlock:
+ pushq %r12
+ pushq %r13
subq $16, %rsp
- movq %rdi, %r8
- movq %rsi, %r9
+ movq %rdi, %r12
+ movq %rsi, %r13
/* Get the lock. */
movl $1, %esi
testl %esi, %esi
jne 1f
-2: movq WRITER(%r8), %rax
+2: movq WRITER(%r12), %rax
testq %rax, %rax
jne 14f
- cmpl $0, NR_READERS(%r8)
+ cmpl $0, NR_READERS(%r12)
je 5f
/* Check the value of the timeout parameter. */
-3: cmpq $1000000000, 8(%r9)
+3: cmpq $1000000000, 8(%r13)
jae 19f
- incl WRITERS_QUEUED(%r8)
+ incl WRITERS_QUEUED(%r12)
je 4f
- movl WRITERS_WAKEUP(%r8), %edx
+ movl WRITERS_WAKEUP(%r12), %edx
LOCK
#if MUTEX == 0
- decl (%r8)
+ decl (%r12)
#else
- decl MUTEX(%r8)
+ decl MUTEX(%r12)
#endif
jne 10f
/* Get current time. */
11: movq %rsp, %rdi
xorq %rsi, %rsi
- movq $SYS_gettimeofday, %rax
- syscall
+ movq $VSYSCALL_ADDR_vgettimeofday, %rax
+ callq *%rax
/* Compute relative timeout. */
movq 8(%rsp), %rax
movq $1000, %rdi
mul %rdi /* Milli seconds to nano seconds. */
- movq (%r9), %rcx
- movq 8(%r9), %rdi
+ movq (%r13), %rcx
+ movq 8(%r13), %rdi
subq (%rsp), %rcx
subq %rax, %rdi
jns 15f
xorq %rsi, %rsi /* movq $FUTEX_WAIT, %rsi */
movq %rsp, %r10
- leaq WRITERS_WAKEUP(%r8), %rdi
+ leaq WRITERS_WAKEUP(%r12), %rdi
movq $SYS_futex, %rax
syscall
movq %rax, %rdx
movl $1, %esi
LOCK
#if MUTEX == 0
- xaddl %esi, (%r8)
+ xaddl %esi, (%r12)
#else
- xaddl %esi, MUTEX(%r8)
+ xaddl %esi, MUTEX(%r12)
#endif
testl %esi, %esi
jne 12f
-13: decl WRITERS_QUEUED(%r8)
+13: decl WRITERS_QUEUED(%r12)
cmpq $-ETIMEDOUT, %rdx
jne 2b
-18: movq $ETIMEDOUT, %rcx
+18: movq $ETIMEDOUT, %rdx
jmp 9f
-5: xorq %rcx, %rcx
+5: xorq %rcx, %rdx
movq %fs:SELF, %rax
- movq %rax, WRITER(%r8)
+ movq %rax, WRITER(%r12)
9: LOCK
#if MUTEX == 0
- decl (%r8)
+ decl (%r12)
#else
- decl MUTEX(%r8)
+ decl MUTEX(%r12)
#endif
jne 6f
-7: movq %rcx, %rax
+7: movq %rdx, %rax
addq $16, %rsp
+ popq %r13
+ popq %r12
retq
1:
14: cmpq %fs:SELF, %rax
jne 3b
-20: movq $EDEADLK, %rcx
+20: movq $EDEADLK, %rdx
jmp 9b
6:
#if MUTEX == 0
- movq %r8, %rdi
+ movq %r12, %rdi
#else
- leal MUTEX(%r8), %rdi
+ leal MUTEX(%r12), %rdi
#endif
callq __lll_mutex_unlock_wake
jmp 7b
/* Overflow. */
-4: decl WRITERS_QUEUED(%r8)
- movq $EAGAIN, %rcx
+4: decl WRITERS_QUEUED(%r12)
+ movq $EAGAIN, %rdx
jmp 9b
10:
#if MUTEX == 0
- movq %r8, %rdi
+ movq %r12, %rdi
#else
- leaq MUTEX(%r8), %rdi
+ leaq MUTEX(%r12), %rdi
#endif
callq __lll_mutex_unlock_wake
jmp 11b
12:
#if MUTEX == 0
- movq %r8, %rdi
+ movq %r12, %rdi
#else
- leaq MUTEX(%r8), %rdi
+ leaq MUTEX(%r12), %rdi
#endif
callq __lll_mutex_lock_wait
jmp 13b
16: movq $-ETIMEDOUT, %rdx
jmp 17b
-19: movq $EINVAL, %rcx
+19: movq $EINVAL, %rdx
jmp 9b
.size pthread_rwlock_timedwrlock,.-pthread_rwlock_timedwrlock
#if MUTEX != 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_lock_wait
+ callq __lll_mutex_lock_wait
#if MUTEX != 0
subq $MUTEX, %rdi
#endif
#if MUTEX != 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_unlock_wake
+ callq __lll_mutex_unlock_wake
#if MUTEX != 0
subq $MUTEX, %rdi
#endif
#if MUTEX != 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_unlock_wake
+ callq __lll_mutex_unlock_wake
#if MUTEX != 0
subq $MUTEX, %rdi
#endif
13: decl WRITERS_QUEUED(%rdi)
jmp 2b
-5: xorq %rcx, %rcx
+5: xorq %rdx, %rdx
movq %fs:SELF, %rax
movq %rax, WRITER(%rdi)
9: LOCK
jne 6f
7:
- movq %rcx, %rax
+ movq %rdx, %rax
retq
1:
#if MUTEX != 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_lock_wait
+ callq __lll_mutex_lock_wait
#if MUTEX != 0
subq $MUTEX, %rdi
#endif
14: cmpq %fs:SELF, %rax
jne 3b
- movq $EDEADLK, %rcx
+ movq $EDEADLK, %rdx
jmp 9b
6:
#if MUTEX != 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_unlock_wake
+ callq __lll_mutex_unlock_wake
jmp 7b
4: decl WRITERS_QUEUED(%rdi)
- movl $EAGAIN, %ecx
+ movl $EAGAIN, %edx
jmp 9b
10:
#if MUTEX != 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_unlock_wake
+ callq __lll_mutex_unlock_wake
#if MUTEX != 0
subq $MUTEX, %rdi
#endif
#if MUTEX != 0
addq $MUTEX, %rdi
#endif
- call __lll_mutex_lock_wait
+ callq __lll_mutex_lock_wait
#if MUTEX != 0
subq $MUTEX, %rdi
#endif
# define
#endif
-#define SYS_gettimeofday __NR_gettimeofday
#define SYS_futex 202
+/* For the calculation see asm/vsyscall.h. */
+#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
+
.text
retq
/* Check whether the timeout value is valid. */
-1: subq $16, %rsp
+1: pushq %r12
+ pushq %r13
+ subq $16, %rsp
- movq %rsp, %r10
movq %rdi, %r8
movq %rsi, %r9
7: xorq %rsi, %rsi
movq %rsp, %rdi
- movq $SYS_gettimeofday, %rax
- syscall
+ movq $VSYSCALL_ADDR_vgettimeofday, %rax
+ callq *%rax
/* Compute relative timeout. */
movq 8(%rsp), %rax
movq %rdi, (%rsp) /* Store relative timeout. */
movq %rsi, 8(%rsp)
+ movq %rsp, %r10
movq %r8, %rdi
xorq %rsi, %rsi
movq $SYS_futex, %rax
cmpxchgl %ecx, (%rdi)
jne 8b
- addq $16, %rsp
xorl %eax, %eax
+10: addq $16, %rsp
+ popq %r13
+ popq %r12
retq
3: negq %rax
movl %edx, (%rax)
#endif
- addq $16, %rsp
orl $-1, %eax
- retq
+ jmp 10b
.size sem_timedwait,.-sem_timedwait
int i;
for (i = 0; i < N; ++i)
- if (pthread_create (&t[i], NULL, tf, (void *) (i + 1)) != 0)
+ if (pthread_create (&t[i], NULL, tf, (void *) (long int) (i + 1)) != 0)
{
write (2, "create failed\n", 14);
_exit (1);
printf ("join failed: %d\n", e);
_exit (1);
}
- else if (r != (void *) (i + 1))
+ else if (r != (void *) (long int) (i + 1))
{
write (2, "result wrong\n", 13);
_exit (1);
exit (1);
}
- if (pthread_create (&th[i], NULL, tf, (void *) i) != 0)
+ if (pthread_create (&th[i], NULL, tf, (void *) (long int) i) != 0)
{
puts ("create failed");
exit (1);