| 53 | ****************************************************************************/ |
| 54 | |
| 55 | int pthread_attr_setschedparam(FAR pthread_attr_t *attr, |
| 56 | FAR const struct sched_param *param) |
| 57 | { |
| 58 | int ret; |
| 59 | |
| 60 | linfo("attr=%p param=%p\n", attr, param); |
| 61 | |
| 62 | if (!attr || !param) |
| 63 | { |
| 64 | ret = EINVAL; |
| 65 | } |
| 66 | else |
| 67 | { |
| 68 | attr->priority = (short)param->sched_priority; |
| 69 | #ifdef CONFIG_SCHED_SPORADIC |
| 70 | attr->low_priority = (uint8_t)param->sched_ss_low_priority; |
| 71 | attr->max_repl = (uint8_t)param->sched_ss_max_repl; |
| 72 | attr->repl_period.tv_sec = param->sched_ss_repl_period.tv_sec; |
| 73 | attr->repl_period.tv_nsec = param->sched_ss_repl_period.tv_nsec; |
| 74 | attr->budget.tv_sec = param->sched_ss_init_budget.tv_sec; |
| 75 | attr->budget.tv_nsec = param->sched_ss_init_budget.tv_nsec; |
| 76 | #endif |
| 77 | ret = OK; |
| 78 | } |
| 79 | |
| 80 | linfo("Returning %d\n", ret); |
| 81 | return ret; |
| 82 | } |
no outgoing calls
no test coverage detected