Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // (C) John Peterson. License GNU GPL 3.
- // Binary stdin/stdout pass-through.
- #include <iostream>
- #include <stdint.h>
- #include <sys/stat.h>
- typedef uint8_t u8;
- typedef uint32_t u32;
- int main(int argc, char **argv) {
- const u32 len = 0x2000;
- u8 buf[len];
- u32 size;
- freopen(NULL, "rb", stdin);
- freopen(NULL, "wb", stdout);
- while (true) {
- size = read(STDIN_FILENO, buf, len);
- if (size == 0) break;
- write(STDOUT_FILENO, buf, size);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement