XTOS / OPEN SOURCE REAL-TIME SYSTEMOPEN SOURCE · VERSION 0.9.0 · BUILD FROM SOURCE
libxtos-rtxtos_rt_get_current

xtos_rt_get_current

Reads the calling thread’s Linux scheduler policy and static priority.

On this page

Declaration

c
#include <xtos/rt.h>

int xtos_rt_get_current(int *policy, int *priority);

Parameters

ParameterTypeDescription
policyint *Non-NULL output pointer supplied by the caller.
priorityint *Non-NULL output pointer supplied by the caller.

Return value

Returns 0 and writes both outputs on success; returns -1 on failure.

Errors

errnoCondition
EINVALpolicy or priority is NULL.
system errnoPreserves 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.