I am building an OS-abstraction layer for our application, and for this 
I would like to know the RT-status of a task.
Using the rt_task_set_mode function it is possible to switch between RT 
and non-RT (using T_PRIMARY). But I would like to know what the state is 
of the current task. I did not find a function to retrieve the RT-state 
of a task; is a function available that will return the status of a task?

For the moment I am using the code shown below. Does this code work:

    rt_task_set_mode(0,0, &var);
    if(var&T_PRIMARY)
    {   /* Primary mode */
        ....
    }
    else
    {   /* Secondary mode */
        ....
    }

I would like to use this for a printf-implementation, where the text is 
printed if the task is non-RT or send to a logging task is the task is 
RT. I would like to call this code from Xenomai tasks, but also from 
plain Linux tasks. Is this possible?

Kind regards,
    Johan Borkhuis


_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help

Reply via email to