summaryrefslogtreecommitdiff
path: root/glib/gbitlock.c
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2011-05-28 17:27:12 -0400
committerRyan Lortie <desrt@desrt.ca>2011-05-28 17:27:12 -0400
commit858a32879291ebb5612c7500fc195c30fb6e8496 (patch)
treef7f4646cc68af239bc48726900553a69456be854 /glib/gbitlock.c
parent83821352657a9481dbff6ab04e8ae60566c17d5e (diff)
downloadglib-858a32879291ebb5612c7500fc195c30fb6e8496.tar.gz
Fix futex(2) detection and use
Commit 22e7fc34c44c5ef95abf4fed429f2345410cc82c introduced a regression: futexes were always disabled and the emulated codepath was always being used. That commit was in response to an originally buggy implementationt hat wrote junk into config.h (but happened to be working properly). Fix up the mess and while we're at it, close bug #631231 by including syscall.h from the correct location and using __NR_futex instead of SYS_futex. Closes #631231.
Diffstat (limited to 'glib/gbitlock.c')
-rw-r--r--glib/gbitlock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/glib/gbitlock.c b/glib/gbitlock.c
index 1b8c41733..72e0d6eb2 100644
--- a/glib/gbitlock.c
+++ b/glib/gbitlock.c
@@ -56,7 +56,7 @@ _g_futex_thread_init (void) {
* If anyone actually gets bit by this, please file a bug. :)
*/
#include <linux/futex.h>
-#include <syscall.h>
+#include <sys/syscall.h>
#include <unistd.h>
/* < private >
@@ -80,7 +80,7 @@ static void
g_futex_wait (const volatile gint *address,
gint value)
{
- syscall (SYS_futex, address, (gsize) FUTEX_WAIT, (gsize) value, NULL);
+ syscall (__NR_futex, address, (gsize) FUTEX_WAIT, (gsize) value, NULL);
}
/* < private >
@@ -97,7 +97,7 @@ g_futex_wait (const volatile gint *address,
static void
g_futex_wake (const volatile gint *address)
{
- syscall (SYS_futex, address, (gsize) FUTEX_WAKE, (gsize) 1, NULL);
+ syscall (__NR_futex, address, (gsize) FUTEX_WAKE, (gsize) 1, NULL);
}
#else