Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef _GNU_SOURCE
- #define _GNU_SOURCE
- #endif
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <unistd.h>
- #include <fcntl.h>
- #include <sys/wait.h>
- #include <errno.h>
- const int PIPE_SIZE = 65536;
- int main() {
- char buf[PIPE_SIZE - 1];
- while (1) {
- memset(buf, 0, PIPE_SIZE);
- size_t received_size = read(STDIN_FILENO, buf, sizeof buf);
- if ((int)received_size == 0) {
- break;
- }
- printf(">>>>>\n");
- printf("%s\n", buf);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement