diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-09-14 21:38:09 +0200 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2013-09-14 21:38:09 +0200 |
commit | 84d72951c86ba5e36afaa9118a08ac888c691ddb (patch) | |
tree | 2c5734baf094224bbefb43064cb2c58cf2969560 | |
parent | ab2b7afb652b0eaaf253e5a204c74f02681d6548 (diff) |
glibc 2.3 compile fix
-rw-r--r-- | threading_pthread.c | 4 |
1 files changed, 3 insertions, 1 deletions
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)); |