tasksuspend with vxwroks 6.4
- From: "sharath.b814" <sharath.b814@xxxxxxxxx>
- Date: Sat, 9 Jan 2010 01:05:24 -0800 (PST)
I am facing a problem when I call taskSuspend on "tShell0" in vxworks
6.4 here is the flow of the code.
shellTaskId = taskNameToId((char *) "tShell0");
/* then read from stdin to get the input*/
ioctl(fileno(f), FIONREAD, &num_bytes_available) ;
read ( fileno(f), buf,num_bytes_available);
The problem is read always returns me EOF. The fileno(f) that I am
reading from is a stream, so as soon as I press any key, EOF is
After debugging more I found that the If I dont call taskSuspend
(shellTaskId); on the shell task, EOF is not read, but the shell task
steals away all the input & runs it as a command. Basically I
understand that the tShell0's priority is more than the task that is
trying to read from the STDIN. Lowering the priority( higher value in
number) of tShell0 is not a good option, neither is making the task
that reads the STDIN, cause the INPUT can still be lost.
Is there someway to get around this problem.? Cause some how calling
taskSuspend(shellTaskId); is corrupting the FD & causing read to fail.
I cannot use taskLock in the task that reads my STDIN cause there are
few other critical task in the system that will get effected. Is there
some way to make the "tShell0" not read the STDIN.?
or Is there someway I could suspend tShell0 at a lower level after
from calling taskSuspend() .?
- Prev by Date: how to realloc the memory from netCluster pool
- Next by Date: The UK Embedded Masterclass 2010 - 6th and 11th May Cambridge & Reading
- Previous by thread: how to realloc the memory from netCluster pool
- Next by thread: The UK Embedded Masterclass 2010 - 6th and 11th May Cambridge & Reading