Blog
BeOS file handle state
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.
 
Reply
From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]