123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- #include <stdlib.h>
- #include <string.h>
- #include "pthread.h"
- #include "implement.h"
- #include "sched.h"
- int
- pthread_attr_setschedparam (pthread_attr_t * attr,
- const struct sched_param *param)
- {
- int priority;
- if (pte_is_attr (attr) != 0 || param == NULL)
- {
- return EINVAL;
- }
- priority = param->sched_priority;
-
- if (priority < sched_get_priority_min (SCHED_OTHER) ||
- priority > sched_get_priority_max (SCHED_OTHER))
- {
- return EINVAL;
- }
- memcpy (&(*attr)->param, param, sizeof (*param));
- return 0;
- }
|