xtos_ rt_ get_ current
Reads the calling thread’s Linux scheduler policy and static priority.
On this page
Declaration
#include <xtos/rt.h>
int xtos_rt_get_current(int *policy, int *priority);Parameters
| Parameter | Type | Description |
|---|---|---|
| policy | int * | Non-NULL output pointer supplied by the caller. |
| priority | int * | Non-NULL output pointer supplied by the caller. |
Return value
Returns 0 and writes both outputs on success; returns -1 on failure.
Errors
| errno | Condition |
|---|---|
| EINVAL | policy or priority is NULL. |
| system errno | Preserves errno from sched_getscheduler or sched_getparam. |
Notes
- Reads only the calling thread and does not return affinity; use sched_getaffinity separately for that.
- The caller owns the output storage; do not use partially written results after failure.
Example
Source
This reference describes headers and implementation at OpenXTOS commit dd313955ad57542bcd2af8827157d1bbd0cf5e83.