tasksuspend with vxwroks 6.4



Hi experts,

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");
taskSuspend(shellTaskId);
..........
.........

/* 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
encountered.

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() .?

Thanks
Sharath
.