Hi,
I'm trying to catch the signal SIGXCPU, in order to know when a task goes in
secondary mode.
I would like to know, why I have to comment the fonction mlockall.
PS : The problem is not related to the Code, but, there is a piece of it :
#include "config.h"
#include <native/task.h>
#include <stdio.h>
#include <assert.h>
#include <signal.h>
void WorkingTask (void* cookie)
{
while (1) {};
}
static RT_TASK Rt_Work_Task;
void go (void * cookie)
{
printf("Test for switch : %d\r\n",(int)rt_task_self());
}
void warn_upon_switch(int sig __attribute__((unused)))
{
printf("/!\\ Secondary Mode /!\\ : ");
}
int main (void)
{
RT_TASK Rt_main_task;
int erreur;
/* Pagination Locked */
// mlockall( MCL_CURRENT | MCL_FUTURE ); <- This is the line which makes
my question
signal(SIGXCPU, warn_upon_switch);
/* Real-Time Task */
rt_task_spawn (&Rt_main_task, "go", 2048, 20, T_FPU | T_JOINABLE,
&go,&Rt_main_task);
/* Waiting for the end */
rt_task_join(&Rt_main_task);
return 0;
}
Regards,
Charles
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help