Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #8320 > unrolled thread

What if a subprocess disconnects stdin and/or stdout?

Started byVictor Porton <porton@narod.ru>
First post2018-01-22 00:43 +0200
Last post2018-01-22 00:43 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.programming


Contents

  What if a subprocess disconnects stdin and/or stdout? Victor Porton <porton@narod.ru> - 2018-01-22 00:43 +0200

#8320 — What if a subprocess disconnects stdin and/or stdout?

FromVictor Porton <porton@narod.ru>
Date2018-01-22 00:43 +0200
SubjectWhat if a subprocess disconnects stdin and/or stdout?
Message-ID<p43532$1is6$1@gioia.aioe.org>
I am writing "Command Communication Library":
https://github.com/vporton/libcomcom

The most immediate purpose is to (synchronously as of the planned first 
release):

Run an OS command with the given string written to stdin and with stdout 
returned (as a string) to the caller after the command finished.

It is clear what to do if the child process exits.

But what if the child process does NOT exit but closes stdin and/or stdout? 
What should I do in this case? Should I kill the process? Should I wait when 
it finishes? Should I return the stdout now, even despite the process has 
not yet finished?

P.S. This libcomcom is a VERY long time should be already have been written. 
I wonder if I am the first person who solves this problem.

-- 
Victor Porton - http://portonvictor.org

[toc] | [standalone]


Back to top | Article view | comp.programming


csiph-web