popen & poll for output
Asked 07 September, 2021
Viewed 332 times
  • 56
Votes

We are using popen and poll with timeout for reading output from a process.

I have a case where we with popen start ssh that creates a reverse tunnel and moves to background. Ssh probably forks a process to bacground and stops the calling process.

Now my popen does not complete on feof but it waits till timeout. Is there any way to prevent this behaviour? In the likes when calling process exits we do not wait for output of a child?

Thank you!

0 Answer