00001 #include <sys/mman.h> 00002 #include <native/task.h> 00003 00004 #define SIGNALS (0x1|0x4) /* Signals to send */ 00005 00006 RT_TASK task_desc; 00007 00008 int main (int argc, char *argv[]) 00009 00010 { 00011 int err; 00012 00013 mlockall(MCL_CURRENT|MCL_FUTURE); 00014 00015 /* Bind to a task which has been created elsewhere, either in 00016 kernel or user-space. The call will block us until such task is 00017 created with the expected name. */ 00018 00019 err = rt_task_bind(&task_desc,"SomeTaskName",TM_NONBLOCK); 00020 00021 if (!err) 00022 /* Send signals to the bound task */ 00023 rt_task_notify(&task_desc,SIGNALS); 00024 00025 /* ... */ 00026 }