summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-03-18 19:22:43 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-03-18 19:25:44 +0100
commitcf330bc70608049a66a5b12d9dc8de37325d81af (patch)
tree0476edda28331988c4d67e654d8436ad52ae2c22
parent12d1a7cf6b0f94139a5e274d06cabbf725238522 (diff)
Use sched_param for now
This exposes more structure names than desired, but we can see how to fix that another way later. * sysdeps/pthread/bits/thread-attr.h (__need_schedparam): Do not define macro. (struct __pthread_attr): Make __schedparam field struct sched_param instead of struct __sched_param. * sysdeps/generic/pt-attr.c (__pthread_default_attr): Use sched_priority instead of __sched_priority. * sysdeps/generic/pt-getschedparam.c (__pthread_getschedparam): Likewise. * sysdeps/generic/timer_routines.h (thread_attr_compare): Likewise.
-rw-r--r--sysdeps/generic/pt-attr.c2
-rw-r--r--sysdeps/generic/pt-getschedparam.c2
-rw-r--r--sysdeps/generic/timer_routines.h4
-rw-r--r--sysdeps/pthread/bits/thread-attr.h5
4 files changed, 6 insertions, 7 deletions
diff --git a/sysdeps/generic/pt-attr.c b/sysdeps/generic/pt-attr.c
index 3579746..5a56f7f 100644
--- a/sysdeps/generic/pt-attr.c
+++ b/sysdeps/generic/pt-attr.c
@@ -25,7 +25,7 @@
const struct __pthread_attr __pthread_default_attr =
{
- __schedparam: { __sched_priority: 0 },
+ __schedparam: { sched_priority: 0 },
__stacksize: 0,
__stackaddr: NULL,
#ifdef PAGESIZE
diff --git a/sysdeps/generic/pt-getschedparam.c b/sysdeps/generic/pt-getschedparam.c
index 90e22f8..25022b3 100644
--- a/sysdeps/generic/pt-getschedparam.c
+++ b/sysdeps/generic/pt-getschedparam.c
@@ -24,7 +24,7 @@ __pthread_getschedparam (pthread_t thread, int *policy,
struct sched_param *param)
{
*policy = SCHED_OTHER;
- param->__sched_priority = 0;
+ param->sched_priority = 0;
return 0;
}
diff --git a/sysdeps/generic/timer_routines.h b/sysdeps/generic/timer_routines.h
index c69d7c1..d851ee6 100644
--- a/sysdeps/generic/timer_routines.h
+++ b/sysdeps/generic/timer_routines.h
@@ -33,8 +33,8 @@ thread_attr_compare (const pthread_attr_t *left, const pthread_attr_t *right)
struct __pthread_attr *ileft = (struct __pthread_attr *) left;
struct __pthread_attr *iright = (struct __pthread_attr *) right;
- return (ileft->__schedparam.__sched_priority
- == iright->__schedparam.__sched_priority
+ return (ileft->__schedparam.sched_priority
+ == iright->__schedparam.sched_priority
&& ileft->__stackaddr == iright->__stackaddr
&& ileft->__stacksize == iright->__stacksize
&& ileft->__guardsize == iright->__guardsize
diff --git a/sysdeps/pthread/bits/thread-attr.h b/sysdeps/pthread/bits/thread-attr.h
index d6a7d13..3b1591f 100644
--- a/sysdeps/pthread/bits/thread-attr.h
+++ b/sysdeps/pthread/bits/thread-attr.h
@@ -19,8 +19,7 @@
#ifndef _BITS_THREAD_ATTR_H
#define _BITS_THREAD_ATTR_H 1
-#define __need_schedparam
-#include <bits/sched.h>
+#include <sched.h>
#define __need_size_t
#include <stddef.h>
@@ -33,7 +32,7 @@ enum __pthread_contentionscope;
that not all of them are supported on all systems. */
struct __pthread_attr
{
- struct __sched_param __schedparam;
+ struct sched_param __schedparam;
void *__stackaddr;
size_t __stacksize;
size_t __guardsize;