Date: 1/6/2004
| I'm working on porting the process handler class of Lgi to BeOS and I'm wondering how to get state information out of the file handles that are connected to the stdin and stdout of the process that is spawned by the class. i.e.
int s[2], pid;
pipe(s);
if (!(pid = fork()))
{
// stdout -> Read
close(1);
dup(s[1]);
close(s[0]);
// setup read & write handles
execv(Exe, Args);
}
while (!exited(pid))
{
// read from pid's stdout... IF there is data
// available. On linux you can use poll
}
Anyone know an equivilant way to find out whether there is data on the handle to read?
If I can fix this I can get my Ide working on BeOS and be twice as productive. i.e. more BeOS releases sooner.
|