diff options
Diffstat (limited to 'Tests/RunCMake/print_stdin.c')
-rw-r--r-- | Tests/RunCMake/print_stdin.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/RunCMake/print_stdin.c b/Tests/RunCMake/print_stdin.c new file mode 100644 index 0000000..e083e62 --- /dev/null +++ b/Tests/RunCMake/print_stdin.c @@ -0,0 +1,18 @@ +#include <stdio.h> + +int main() +{ + char buf[1024]; + size_t nIn = sizeof(buf); + while (nIn == sizeof(buf)) { + nIn = fread(buf, 1, sizeof(buf), stdin); + if (nIn > 0) { + size_t nOut; + nOut = fwrite(buf, 1, nIn, stdout); + if (nOut != nIn) { + return 1; + } + } + } + return 0; +} |