* config/linux/futex_bits.h: Include errno.h.
(sys_futex0): If syscall returns -1, return -errno rather than
-1.
From-SVN: r208855
+2014-03-26 Jakub Jelinek <jakub@redhat.com>
+
+ * config/linux/futex_bits.h: Include errno.h.
+ (sys_futex0): If syscall returns -1, return -errno rather than
+ -1.
+
2014-03-26 Joseph Myers <joseph@codesourcery.com>
* libitm.texi (Index): Rename to Library Index.
#include <unistd.h>
#include <sys/syscall.h>
+#include <errno.h>
static inline long
sys_futex0 (std::atomic<int> *addr, long op, long val)
{
- return syscall (SYS_futex, (int*) addr, op, val, 0);
+ long res = syscall (SYS_futex, (int*) addr, op, val, 0);
+ if (__builtin_expect (res == -1, 0))
+ return -errno;
+ return res;
}