futex_bits.h: Include errno.h.
* config/linux/futex_bits.h: Include errno.h. (sys_futex0): If syscall returns -1, return -errno rather than -1. From-SVN: r208855
This commit is contained in:
parent
816551fe37
commit
7cc51d643e
@ -1,3 +1,9 @@
|
||||
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.
|
||||
|
@ -31,9 +31,13 @@
|
||||
|
||||
#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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user