[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: ea83b2a8a6ebd76909e6d3170be13ec3ddaa4b0c URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ea83b2a8a6ebd76909e6d3170be13ec3ddaa4b0c Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index b90fa70..b1000c4 100644 --- a/configure.ac +++ b/configure.ac @@ -543,6 +543,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 1b26c84..75e2d1d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -169,6 +169,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, } #endif /* !HAVE_PTHREAD_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 785ef4b71fd6628fcbfc672fb66bd578e5ae08bd URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=785ef4b71fd6628fcbfc672fb66bd578e5ae08bd Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index b90fa70..b1000c4 100644 --- a/configure.ac +++ b/configure.ac @@ -543,6 +543,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 1b26c84..75e2d1d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -169,6 +169,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, } #endif /* !HAVE_PTHREAD_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: ea03c7a0f9b193e9acff08f4a67c4e1d8e2a39fc URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ea03c7a0f9b193e9acff08f4a67c4e1d8e2a39fc Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index b90fa70..b1000c4 100644 --- a/configure.ac +++ b/configure.ac @@ -543,6 +543,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 1b26c84..75e2d1d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -169,6 +169,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, } #endif /* !HAVE_PTHREAD_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 5936da18abf2d50d4acd7699c4e1789d0f71ba41 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5936da18abf2d50d4acd7699c4e1789d0f71ba41 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index b90fa70..b1000c4 100644 --- a/configure.ac +++ b/configure.ac @@ -543,6 +543,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 1b26c84..75e2d1d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -169,6 +169,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, } #endif /* !HAVE_PTHREAD_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: ce116f0100a19acf83d1a893baee107f7f4c7b7a URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ce116f0100a19acf83d1a893baee107f7f4c7b7a Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index b90fa70..b1000c4 100644 --- a/configure.ac +++ b/configure.ac @@ -543,6 +543,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 1b26c84..75e2d1d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -169,6 +169,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, } #endif /* !HAVE_PTHREAD_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 6332a1614e86350791c2550bab14de163e7ef82d URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6332a1614e86350791c2550bab14de163e7ef82d Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index b90fa70..b1000c4 100644 --- a/configure.ac +++ b/configure.ac @@ -543,6 +543,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 1b26c84..75e2d1d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -169,6 +169,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, } #endif /* !HAVE_PTHREAD_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 1a81c5de3fb7be74bb047a812d94550b278416d4 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1a81c5de3fb7be74bb047a812d94550b278416d4 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index b90fa70..b1000c4 100644 --- a/configure.ac +++ b/configure.ac @@ -543,6 +543,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 1b26c84..75e2d1d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -169,6 +169,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, } #endif /* !HAVE_PTHREAD_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: d158ab2b2ad2d4e54a9fbb15dd6e63d9bc1dab29 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=d158ab2b2ad2d4e54a9fbb15dd6e63d9bc1dab29 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 15a5048..86da6b1 100644 --- a/configure.ac +++ b/configure.ac @@ -546,6 +546,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 6616cef..3c9c970 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 653032b20878b5b3a9a8a5b9cbd0636a3e2218c9 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=653032b20878b5b3a9a8a5b9cbd0636a3e2218c9 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 36067ad..1ba7f8c 100644 --- a/configure.ac +++ b/configure.ac @@ -546,6 +546,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 6616cef..3c9c970 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 89153058bd523960ba977b9592133f6eab0792ab URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=89153058bd523960ba977b9592133f6eab0792ab Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 83fa57c..8a6d9e2 100644 --- a/configure.ac +++ b/configure.ac @@ -546,6 +546,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 6616cef..3c9c970 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: ac2b2d5db68d2b7c6ed2c0b699f7aec155e7c0cf URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=ac2b2d5db68d2b7c6ed2c0b699f7aec155e7c0cf Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 6ff8afb..5b9f518 100644 --- a/configure.ac +++ b/configure.ac @@ -546,6 +546,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 6616cef..3c9c970 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: cdd947a84fc9298e820742befd4b0d1f3a7f0769 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=cdd947a84fc9298e820742befd4b0d1f3a7f0769 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 6ff8afb..5b9f518 100644 --- a/configure.ac +++ b/configure.ac @@ -546,6 +546,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 6616cef..3c9c970 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 6123f41b5a4f0cfe80d06638916ed951d4ace963 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=6123f41b5a4f0cfe80d06638916ed951d4ace963 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 07b4d15..1a9d402 100644 --- a/configure.ac +++ b/configure.ac @@ -546,6 +546,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 6616cef..3c9c970 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: fe2c42db8916eb360fef41bcfa07095353165ab1 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=fe2c42db8916eb360fef41bcfa07095353165ab1 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 07b4d15..1a9d402 100644 --- a/configure.ac +++ b/configure.ac @@ -546,6 +546,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 6616cef..3c9c970 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 2cf7b10e57f7c7888fce5defcb9c46661e1d6cd0 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2cf7b10e57f7c7888fce5defcb9c46661e1d6cd0 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 5bcd7f8..1397659 100644 --- a/configure.ac +++ b/configure.ac @@ -540,6 +540,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 6616cef..3c9c970 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 1d2663abed2e72f1314463a3cd8c3d013bc08475 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=1d2663abed2e72f1314463a3cd8c3d013bc08475 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 5bcd7f8..1397659 100644 --- a/configure.ac +++ b/configure.ac @@ -540,6 +540,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 6616cef..3c9c970 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 8fdda739e84d749c6f175f3ebf9b3e2c18dce5f0 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8fdda739e84d749c6f175f3ebf9b3e2c18dce5f0 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 3d257c3..c61748c 100644 --- a/configure.ac +++ b/configure.ac @@ -540,6 +540,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 2f356a9..88b522d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: 2763016b7addd1cacc09c74003c899ad6d804e0a URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2763016b7addd1cacc09c74003c899ad6d804e0a Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index 3d257c3..c61748c 100644 --- a/configure.ac +++ b/configure.ac @@ -540,6 +540,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 2f356a9..88b522d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: wip/dovetail Commit: bc183bc4e88d69035f4b2b445749f6a9a4de5db2 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bc183bc4e88d69035f4b2b445749f6a9a4de5db2 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index cd9f047..42f2f5d 100644 --- a/configure.ac +++ b/configure.ac @@ -540,6 +540,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 2f356a9..88b522d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git
[Xenomai-git] Philippe Gerum : boilerplate/libc: add placeholder for pthread_setschedprio()
Module: xenomai-3 Branch: next Commit: bc183bc4e88d69035f4b2b445749f6a9a4de5db2 URL: http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=bc183bc4e88d69035f4b2b445749f6a9a4de5db2 Author: Philippe Gerum Date: Tue May 24 09:43:29 2016 +0200 boilerplate/libc: add placeholder for pthread_setschedprio() For outdated uClibc. --- configure.ac |1 + include/boilerplate/libc.h | 19 +++ 2 files changed, 20 insertions(+) diff --git a/configure.ac b/configure.ac index cd9f047..42f2f5d 100644 --- a/configure.ac +++ b/configure.ac @@ -540,6 +540,7 @@ AC_CHECK_FUNCS([pthread_mutexattr_setprotocol \ pthread_getattr_np \ pthread_atfork \ pthread_setname_np \ + pthread_setschedprio\ sched_getcpu\ clock_nanosleep \ shm_open\ diff --git a/include/boilerplate/libc.h b/include/boilerplate/libc.h index 2f356a9..88b522d 100644 --- a/include/boilerplate/libc.h +++ b/include/boilerplate/libc.h @@ -168,6 +168,25 @@ int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize, #endif /* !HAVE_PTHREAD_ATTR_SETAFFINITY_NP */ +#ifndef HAVE_PTHREAD_SETSCHEDPRIO + +static inline +int pthread_setschedprio(pthread_t thread, int prio) +{ + struct sched_param param; + int policy, ret; + + ret = pthread_getschedparam(thread, &policy, ¶m); + if (ret) + return ret; + + param.sched_priority = prio; + + return pthread_setschedparam(thread, policy, ¶m); +} + +#endif /* !HAVE_PTHREAD_SETSCHEDPRIO */ + #if !defined(HAVE_CLOCK_NANOSLEEP) && defined(CONFIG_XENO_MERCURY) /* * Best effort for a Mercury setup based on an outdated libc lacking ___ Xenomai-git mailing list Xenomai-git@xenomai.org https://xenomai.org/mailman/listinfo/xenomai-git