Files
clang-p2996/lldb/test/python_api/process/io/main.c
Johnny Chen 5886fb5bd3 rdar://problem/10492827
SBProcess.GetSTDERR() not getting stderr of the launched process

Since we are launch the inferior with:

    process = target.LaunchSimple(None, None, os.getcwd())

i.e., without specifying stdin/out/err.  A pseudo terminal is used for
handling the process I/O, and we are satisfied once the expected output
appears in process.GetSTDOUT().

llvm-svn: 147983
2012-01-12 00:29:46 +00:00

15 lines
336 B
C

#include <stdio.h>
int main(int argc, char const *argv[]) {
printf("Hello world.\n");
char line[100];
int count = 1;
while (fgets(line, sizeof(line), stdin)) { // Reading from stdin...
fprintf(stderr, "input line=>%d\n", count++);
if (count > 3)
break;
}
printf("Exiting now\n");
}