carb::launcher::fWaitFlagCloseStdOutStream
Defined in carb/launcher/ILauncher.h
-
constexpr WaitFlags carb::launcher::fWaitFlagCloseStdOutStream = 0x00000004
Flag to indicate that the
stdout
stream for a child should be closed before waiting on it.Note that doing so will truncate any remaining incoming data on the stream. This is useful for closing the stream and exiting the reader thread when the parent process is no longer interested in the output of the child process (ie: the parent only wanted to wait on a successful startup signal from the child). This flag has no effect if no read callback was provided for the
stdout
stream when the child process was launched.Note
[Linux] If this is used on a child process to close the parent process’s end of the
stdout
stream, the child process will be terminated with SIGPIPE if it ever tries to write tostdout
again. This is the default handling of writing to a broken pipe or socket on Linux. The only way around this default behavior is to ensure that the child process ignores SIGPIPE signals. Alternatively, the parent could just wait for the child process to exit before destroying its process handle or closing the stream.