Created
November 23, 2021 10:44
-
-
Save cho0h5/624322eb27297a9b013b6605107fe02b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <unistd.h> | |
#include <stdio.h> | |
int main() { | |
write(0, "write 0\n", 8); | |
write(1, "write 1\n", 8); | |
write(2, "write 2\n", 8); | |
fprintf(stdin, "fprintf stdin\n"); | |
fprintf(stdout, "fprintf stdout\n"); | |
fprintf(stderr, "fprintf stderr\n"); | |
printf("stdin fd: %d\nstdout fd: %d\nstderr fd: %d\n", | |
stdin->_fileno, | |
stdout->_fileno, | |
stderr->_fileno); | |
return 0; | |
} | |
// write 0 <- ??? | |
// write 1 | |
// write 2 | |
// fprintf stdout | |
// fprintf stderr | |
// stdin fd: 0 | |
// stdout fd: 1 | |
// stderr fd: 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment