I’m having problems spawning a task in Neutrino. Here’s the section of
code that’s giving me the problem:
// start up analogIO
pid_t analogIOPid;
spawn_inheritance_type analogIOInherit;
char **argvAnalog = NULL;
analogIOInherit.flags = SPAWN_EXPLICIT_SCHED | SPAWN_SETSTACKMAX;
analogIOInherit.policy = SCHED_FIFO;
analogIOInherit.param.sched_priority = 55;
analogIOInherit.stack_max = 1024;
if ((analogIOPid = spawn("/cryobin/analogIO", 0, 0, &analogIOInherit,
argvAnalog, NULL)) == -1)
printf("\nerror opening analogIO process: errno %d\n", errno);
else printf("\nanalogIO process started succesfully\n");
When I run this code it fails and returns an errno of 22, which is EINVAL
(invalid argument). I can run the executable ‘analogIO’ from the command
prompt without any problems but I can’t start it from code.
Any help is greatly appreciated.
Thanks,
Dan