Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <unistd.h>
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- int main()
- {
- char buf[32] = {0};
- int fd = open("pipe", O_RDONLY);
- printf("fd = %d\n", fd);
- // Some sort of CPU processing occurs...
- sleep(10);
- read(fd, buf, 6);
- printf("buf: %s\n", buf);
- }
- /* Execute this, then run this Python:
- * p = open('pipe', 'wb'); p.write('Hi'); p.write('There'); p.flush()
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement