summaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2010-07-02 11:21:44 +0200
committerAndreas Schwab <schwab@redhat.com>2010-07-02 11:25:12 +0200
commitce7d1719493b21690826ed0f64ab70b513f145b5 (patch)
tree267a62315efc29d8fca3d539d42674dbd5aa345b /nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
parent70d0a630700f602a457832383161d261fe222db5 (diff)
parent48b42dde17d79a0effc9ba85110aef2172e3e641 (diff)
Merge remote branch 'origin/master' into fedora/master
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S18
1 files changed, 17 insertions, 1 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
index 0291beb169..ca49cb89d0 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2005,2007,2009,2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -77,6 +77,9 @@ sem_timedwait:
je .Lreltmo
#endif
+ cmpq $0, (%rsi)
+ js 16f
+
/* This push is only needed to store the sem_t pointer for the
exception handler. */
pushq %rdi
@@ -169,6 +172,19 @@ sem_timedwait:
retq
+16:
+#if USE___THREAD
+ movq errno@gottpoff(%rip), %rdx
+ movl $ETIMEDOUT, %fs:(%rdx)
+#else
+ callq __errno_location@plt
+ movl $ETIMEDOUT, (%rax)
+#endif
+
+ orl $-1, %eax
+
+ retq
+
#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
.Lreltmo:
pushq %r12