Commit 7cc51d64 by Jakub Jelinek Committed by Jakub Jelinek

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
parent 816551fe
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;
}
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