* popen and threads: I'm really perplexed.
@ 2001-06-19 15:49 Greg P
0 siblings, 0 replies; only message in thread
From: Greg P @ 2001-06-19 15:49 UTC (permalink / raw)
Hello,
I've written a program that creates a posix thread which then uses
popen to execute a shell command (like "ps" for instance). popen is
executing just fine. I then use fgets to read the output of the shell
command inside the thread. The problem is, the fgets call is getting
an EWOULDBLOCK error. perror is printing the message "system call
interrupted". What in the world is going on here? I've created the
thread to do the "blocking" calls (like reading the output from popen)
so that my main application is not blocked. I've tried modifying the
thread's scheduling attributes to no avail.
The maddening thing about this, is that the thread creation and popen
calls are encapsulated in one "spawn" routine that I've written. I
created a test program for this routine and the test works perfectly.
When I call the "spawn" routine inside of another (far more complex)
program, I get this weird failure.
Any help on this one would be incredibly appreciated.
Greg
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-06-19 15:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-06-19 15:49 popen and threads: I'm really perplexed Greg P
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox