| 53 | ****************************************************************************/ |
| 54 | |
| 55 | int pthread_attr_getschedparam(FAR const pthread_attr_t *attr, |
| 56 | FAR 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 | param->sched_priority = (int)attr->priority; |
| 69 | #ifdef CONFIG_SCHED_SPORADIC |
| 70 | param->sched_ss_low_priority = (int)attr->low_priority; |
| 71 | param->sched_ss_max_repl = (int)attr->max_repl; |
| 72 | param->sched_ss_repl_period.tv_sec = attr->repl_period.tv_sec; |
| 73 | param->sched_ss_repl_period.tv_nsec = attr->repl_period.tv_nsec; |
| 74 | param->sched_ss_init_budget.tv_sec = attr->budget.tv_sec; |
| 75 | param->sched_ss_init_budget.tv_nsec = attr->budget.tv_nsec; |
| 76 | #endif |
| 77 | ret = OK; |
| 78 | } |
| 79 | |
| 80 | linfo("Returning %d\n", ret); |
| 81 | return ret; |
| 82 | } |