Commit ab18f2f5 by Richard Henderson Committed by Richard Henderson

libgomp: Fix default futex vs errno

	* config/linux/futex.h (futex_wait): Get error value from errno.
	(futex_wake): Likewise.

From-SVN: r209035
parent a19b0bfd
2014-04-02 Richard Henderson <rth@redhat.com>
* config/linux/futex.h (futex_wait): Get error value from errno.
(futex_wake): Likewise.
2014-03-25 Jakub Jelinek <jakub@redhat.com> 2014-03-25 Jakub Jelinek <jakub@redhat.com>
PR c++/60331 PR c++/60331
......
...@@ -41,8 +41,8 @@ ...@@ -41,8 +41,8 @@
static inline void static inline void
futex_wait (int *addr, int val) futex_wait (int *addr, int val)
{ {
long err = syscall (SYS_futex, addr, gomp_futex_wait, val, NULL); int err = syscall (SYS_futex, addr, gomp_futex_wait, val, NULL);
if (__builtin_expect (err == -ENOSYS, 0)) if (__builtin_expect (err < 0 && errno == ENOSYS, 0))
{ {
gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
...@@ -53,8 +53,8 @@ futex_wait (int *addr, int val) ...@@ -53,8 +53,8 @@ futex_wait (int *addr, int val)
static inline void static inline void
futex_wake (int *addr, int count) futex_wake (int *addr, int count)
{ {
long err = syscall (SYS_futex, addr, gomp_futex_wake, count); int err = syscall (SYS_futex, addr, gomp_futex_wake, count);
if (__builtin_expect (err == -ENOSYS, 0)) if (__builtin_expect (err < 0 && errno == ENOSYS, 0))
{ {
gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG; gomp_futex_wait &= ~FUTEX_PRIVATE_FLAG;
gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG; gomp_futex_wake &= ~FUTEX_PRIVATE_FLAG;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment