From 84d72951c86ba5e36afaa9118a08ac888c691ddb Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Sat, 14 Sep 2013 21:38:09 +0200 Subject: glibc 2.3 compile fix --- threading_pthread.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'threading_pthread.c') diff --git a/threading_pthread.c b/threading_pthread.c index f10da9d0..8a28ee93 100644 --- a/threading_pthread.c +++ b/threading_pthread.c @@ -67,6 +67,7 @@ thread_start_low_priority (void (*fn)(void *ctx), void *ctx) { fprintf (stderr, "pthread_attr_init failed: %s\n", strerror (s)); return 0; } +#if !STATICLINK && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 4 int policy; s = pthread_attr_getschedpolicy (&attr, &policy); if (s != 0) { @@ -74,13 +75,14 @@ thread_start_low_priority (void (*fn)(void *ctx), void *ctx) { return 0; } int minprio = sched_get_priority_min (policy); +#endif s = pthread_create (&tid, &attr, (void *(*)(void *))fn, (void*)ctx); if (s != 0) { fprintf (stderr, "pthread_create failed: %s\n", strerror (s)); return 0; } -#if !STATICLINK +#if !STATICLINK && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 4 s = pthread_setschedprio (tid, minprio); if (s != 0) { fprintf (stderr, "pthread_setschedprio failed: %s\n", strerror (s)); -- cgit v1.2.3